Fixed formatting

This commit is contained in:
Christophe Smet
2018-10-30 15:13:02 +01:00
parent 5740def0f9
commit 8b83050f87

View File

@@ -268,9 +268,6 @@ class StackLayoutManager(scrollOrientation: ScrollOrientation,
}
override fun canScrollHorizontally(): Boolean {
if (itemCount == 0) {
return false
}
return when(mScrollOrientation) {
ScrollOrientation.LEFT_TO_RIGHT, ScrollOrientation.RIGHT_TO_LEFT -> true
else -> false
@@ -278,9 +275,6 @@ class StackLayoutManager(scrollOrientation: ScrollOrientation,
}
override fun canScrollVertically(): Boolean {
if (itemCount == 0) {
return false
}
return when(mScrollOrientation) {
ScrollOrientation.TOP_TO_BOTTOM, ScrollOrientation.BOTTOM_TO_TOP -> true
else -> false
@@ -288,16 +282,14 @@ class StackLayoutManager(scrollOrientation: ScrollOrientation,
}
override fun onLayoutChildren(recycler: RecyclerView.Recycler, state: RecyclerView.State) {
mLayout?.requestLayout()
removeAndRecycleAllViews(recycler)
if (itemCount > 0) {
mScrollOffset = getValidOffset(mScrollOffset)
loadItemView(recycler)
}
}
override fun scrollHorizontallyBy(dx: Int, recycler: RecyclerView.Recycler, state: RecyclerView.State): Int {
return handleScrollBy(dx, recycler)