Skip to content

Commit

Permalink
Merge pull request #2 from rostopira/patch-1
Browse files Browse the repository at this point in the history
Make reason of crash understandable (Issue #1)
  • Loading branch information
severianremi authored Oct 28, 2019
2 parents bb41007 + fda3698 commit 29737c1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.yalantis.colormatchtabs.colormatchtabs.listeners.OnColorTabSelectedLi
import com.yalantis.colormatchtabs.colormatchtabs.menu.ArcMenu
import com.yalantis.colormatchtabs.colormatchtabs.model.ColorTab
import com.yalantis.colormatchtabs.colormatchtabs.utils.getDimen
import java.lang.IllegalArgumentException

/**
* Created by anna on 10.05.17.
Expand Down Expand Up @@ -92,6 +93,8 @@ class ColorMatchTabLayout : HorizontalScrollView, MenuToggleListener {
}

override fun onMeasure(widthMeasureSpec: Int, originHeightMeasureSpec: Int) {
if (tabs.size < 2)
throw IllegalArgumentException("Layout must contain at least 2 tabs")
var heightMeasureSpec = originHeightMeasureSpec
// If we have a MeasureSpec which allows us to decide our height, try and use the default
// height
Expand Down Expand Up @@ -252,4 +255,4 @@ class ColorMatchTabLayout : HorizontalScrollView, MenuToggleListener {
*/
override fun onCloseMenu() = tabStripLayout.onCloseMenu()

}
}

0 comments on commit 29737c1

Please sign in to comment.