Show FABs on scrolling down

pull/183/head
M66B 4 years ago
parent d2144403be
commit c020266833

@ -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…
Cancel
Save