mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-29 19:25:34 +00:00
Show FABs on scrolling down
This commit is contained in:
parent
d2144403be
commit
c020266833
1 changed files with 10 additions and 14 deletions
|
@ -694,23 +694,19 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
rvMessage.addItemDecoration(dateDecorator);
|
||||
|
||||
rvMessage.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
|
||||
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
|
||||
scrolling = false;
|
||||
if (viewType == AdapterMessage.ViewType.UNIFIED || viewType == AdapterMessage.ViewType.FOLDER)
|
||||
fabCompose.show();
|
||||
updateExpanded();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||
if (dy != 0) {
|
||||
scrolling = true;
|
||||
if (viewType == AdapterMessage.ViewType.UNIFIED || viewType == AdapterMessage.ViewType.FOLDER)
|
||||
fabCompose.hide();
|
||||
updateExpanded();
|
||||
boolean down = (dy > 0);
|
||||
if (scrolling != down) {
|
||||
scrolling = down;
|
||||
if (viewType == AdapterMessage.ViewType.UNIFIED || viewType == AdapterMessage.ViewType.FOLDER)
|
||||
if (dy > 0)
|
||||
fabCompose.hide();
|
||||
else
|
||||
fabCompose.show();
|
||||
updateExpanded();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue