Fix crashes introduced yesterday

This commit is contained in:
len
2016-07-31 14:07:12 +02:00
parent b6a06189fb
commit 4200409f79
3 changed files with 17 additions and 12 deletions

View File

@@ -37,8 +37,8 @@ class AutofitRecyclerView @JvmOverloads constructor(context: Context, attrs: Att
override fun onMeasure(widthSpec: Int, heightSpec: Int) {
super.onMeasure(widthSpec, heightSpec)
if (spanCount == 0 && columnWidth > 0) {
val spanCount = Math.max(1, measuredWidth / columnWidth)
manager.spanCount = spanCount
val count = Math.max(1, measuredWidth / columnWidth)
spanCount = count
}
}