-
-
Notifications
You must be signed in to change notification settings - Fork 392
Display notification filter/clear actions as menu items #3877
Display notification filter/clear actions as menu items #3877
Conversation
Previously the notification filter and clear actions were shown as buttons in the UI, with a preference that determined whether they were displayed. Remove this preference, and display them as menu items. - "Filter" is shown as an icon, if possible - "Clear" is only ever shown as a menu item If the user has disabled the top navigation bar a new options menu item is shown to the right of the tabs, whether they are at the top or bottom of the screen.
|
I am not sure how I feel about options menu together with tabs but I support moving actions into toolbar & dropdown menu |
The menu is required (it should have been added when removing the top nav bar was added as an option) because you need a place to put functions that would otherwise be gesture-only. Otherwise those functions are not accessible to eg screen reader users. |
app/src/main/java/com/keylesspalace/tusky/components/notifications/NotificationsFragment.kt
Outdated
Show resolved
Hide resolved
I guess these changes need an issue? |
…ter-menu # Conflicts: # app/src/main/res/values-cy/strings.xml # app/src/main/res/values-de/strings.xml # app/src/main/res/values-fa/strings.xml # app/src/main/res/values-gd/strings.xml # app/src/main/res/values-gl/strings.xml # app/src/main/res/values-is/strings.xml # app/src/main/res/values-ja/strings.xml # app/src/main/res/values-nl/strings.xml # app/src/main/res/values-oc/strings.xml # app/src/main/res/values-tr/strings.xml # app/src/main/res/values-vi/strings.xml # app/src/main/res/values-zh-rCN/strings.xml
Previous code either used setSupportActionBar (if the mainNav was enabled), or reproduced the logo/options menu functionality of an action bar if it was disabled. There's no need to do that -- just have three toolbars (1 or 2 of which might be hidden), and use precisely one of them as the action bar. Then you get logo support, navigation, and options menu handling for free. This also simplifies the layouts and means you don't need to different bits of code for loading an image in to the action bar logo.
|
Turns out the code before this PR was overly complicated, and it's straightforward to have three toolbars (one for the mainnav, one for the top tabs, and one for the bottom tabs). Whichever one of those is assigned to be the support action bar will display the logo and the options menu "for free", and does it with the correct theme/colours (which addresses one of your other comments). I've adjusted the UI strings to make it clear these are operations on notifications as well. I've updated the screenshots in the first comment on this PR to show the current behaviour. PTAL. |
Very nice!
PTAL? :-) One of my comments is not yet resolved: This solves a rather noticeable bug (context menu not reachable) which should have an issue, I guess. |
Please take a look.
I don't understand what you mean here. |
I gather then that we don't want to have issues for meaninful changes (for documentation / communication / release notes / ...)? Here in this PR we have two quite distinct changes:
I have no reservations against doing both but I would document either change as an (one) issue. |
Not always, no. It can help, but it's not mandatory. That's why it's important that the PR description stand alone in describing what has changed and why. If you look at recent PRs that I've merged from other people you'll see that I sometimes rewrite the PR description and/or title to try and make what's changed and why easier to understand. Release notes are written by generating a list of the merged PRs since the previous tag (e.g., v23.0...develop) and reviewing each one to decide what to include in the release notes. |
…ter-menu # Conflicts: # app/src/main/java/com/keylesspalace/tusky/MainActivity.kt







Previously the notification filter and clear actions were shown as buttons in the UI, with a preference that determined whether they were displayed.
Remove this preference, and display them as menu items.
To ensure that the options menu appears correctly, remove the code that creates a "fake" action bar, and adjust the layouts so that there are three toolbars;
Only one of them is set as the support action bar (depending on the user's preferences). This provides the "show a logo" and "show the options menu" functionality as standard, without needing to re-implement as the previous code did.