-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
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
Hide FAB onScrollView #24
Comments
Hi, Call hide() method in your scroll listener. To show it again, call show() method. Best wishes,
|
I'm using RecyclerView used the setOnScrollLister if anyone has doubts below is the code I used .
|
I'm not sure whether this should work correctly. getY() is actually an inherited method from android.view.View class, which returns the visual position of the RecyclerView. In order to get this work, I suggest:
The sample code may look like this: @Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
int scrollLimit = 4 // convert this value to density-dependent pixel
boolean scrollLimitReached = Math.abs(dy) >= scrollLimit;
if (scrollLimitReached) {
boolean scrollUp = dy >= 0;
if (scrollUp) {
actionButton.show();
} else {
actionButton.hide();
}
}
} Hope this helps. Good luck |
wow great, thanks. |
Issue solved |
Hello ! How do I hide FAB to scroll the page ?
Thank you
The text was updated successfully, but these errors were encountered: