Ashinch / ReadYou

An Android RSS reader presented in Material You style.
GNU General Public License v3.0
5.11k stars 202 forks source link

Refactor of RYScaffold to use TopAppBar with scrolling behaviour #873

Open yajaru opened 1 week ago

yajaru commented 1 week ago

This is a small refactor of the RYScaffold to use a TopAppBar with nested scrolling instead of an in-content header.

This also moves the Switch Account action from being on the Feeds page header text on-click to an actual dedicated button. I think this is more discoverable b/c it is not obvious how to switch accounts from the Feeds page if you don't already know about this feature.

Jump to top is also preserved for the browsing pages via an on-click callback on RYScaffold's new TopAppBar. This is basically what it was before, just move around a little.

Note that there is some goofyness around pages that are smaller that the viewport. Ideally I'd like them to not be scrollable at all but, I was not able to figure out how to do that elegantly. I could always pass down a boolean flag to RYScaffold to turn the scrolling off but, that feels nasty. If you have any ideas, let me know.

Before

before - unscrolled before - scrolled

After

after - unscrolled after - scrolled

JunkFood02 commented 6 days ago

use a TopAppBar with nested scrolling instead of an in-content header

Why?

JunkFood02 commented 1 day ago

The LargeTopAppBar component doesn't offer the flexibility we need. We can't customize the text styles for the large and small titles, the content padding, and other aspects. Additionally, using nestedScroll might lead to unexpected issues like what you've mentioned. I've implemented a workaround in #896. Please take a look and let me know if you're happy with the result