We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there an option to snap one item at a item no matter how fast the user flings?
The text was updated successfully, but these errors were encountered:
i too request for this feature
Sorry, something went wrong.
Hi guys @akifsabeh , @root-ansh I tried this, and it works fine
recyclerView.onFlingListener = object : RecyclerView.OnFlingListener() { override fun onFling(velocityX: Int, velocityY: Int): Boolean { if (abs(velocityX) > 3000) { var cur = layoutManager.centerItemPosition if (velocityX > 0) { cur += 1 } else { cur -= 1 } if (cur >= list.size) { cur = 0 } else if (cur < 0) { cur = list.size - 1 } recyclerView.smoothScrollToPosition(cur) return true } return false } }
No branches or pull requests
Is there an option to snap one item at a item no matter how fast the user flings?
The text was updated successfully, but these errors were encountered: