Skip to content

Instantly share code, notes, and snippets.

@ntngel1
Created November 14, 2019 08:26
Show Gist options
  • Save ntngel1/41dc8bbd9b9900fc2fd641b9eeac2175 to your computer and use it in GitHub Desktop.
Save ntngel1/41dc8bbd9b9900fc2fd641b9eeac2175 to your computer and use it in GitHub Desktop.
override fun findSnapView(layoutManager: RecyclerView.LayoutManager) =
if (layoutManager is LinearLayoutManager) {
if (layoutManager.canScrollHorizontally()) {
getStartView(layoutManager, getHorizontalHelper(layoutManager))
} else {
getStartView(layoutManager, getVerticalHelper(layoutManager))
}
} else {
super.findSnapView(layoutManager)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment