FredJul / Flym

Flym News Reader is a light Android feed reader (RSS/Atom)
Other
953 stars 403 forks source link

Hide bottom navigation when scrolling #648

Closed fireph closed 4 years ago

fireph commented 4 years ago

This uses the coordinator layout behavior to hide the BottomNavigationView when scrolling down and having it reappear when scrolling up. It is toggle-able as a checkbox in the settings and the FloatingActionButton follows it correct when hiding/showing. It will also properly re-show bottom nav when toggling the setting off if the bottom bar is currently hidden.

If you are ok with having this behavior be the default, I can remove the settings toggle and remove the if/else statements to simplify everything.

Also tested with snackbars and it works correctly (that is why the inner coordinator layout is needed). There can be some finicky-ness with padding on the snackbars in some cases. 😕

See the video below for how it works with the setting enabled and disabled.

2020-08-26_15-08-55

fireph commented 4 years ago

643

FredJul commented 4 years ago

Hi again, I have merged this excellent work, but noticed too late a little regression: the "mark all as read" fab is hard to select when the bottom navigation bar is hidden because it is under the Android home/back bar. Do you have an idea on how to solve that ?

FredJul commented 4 years ago

Actually I found two other bugs:

Unless we find a solution I unfortunately may have to revert the bottom bar hiding (no problem so far with the top bar). But I'll pretty sure we can find one 😉