Display notification filter/clear actions as menu items (#3877)

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 notifications" is shown as an icon, if possible
- "Clear notifications" is only ever shown as a menu item, to reduce the
chance the user inadvertently selects it

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;

- mainToolbar -- displays the icons, and the current "location" (Home,
Notifications, etc)
- topNav -- displays the row of tabs at the top
- bottomNav -- displays the row of tabs at the bottom

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.
This commit is contained in:
Nik Clayton 2023-08-19 14:41:10 +02:00 committed by GitHub
commit 059352f471
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 152 additions and 304 deletions

View file

@ -41,7 +41,7 @@ enum class AppTheme(val value: String) {
*
* - Adding a new preference that does not change the interpretation of an existing preference
*/
const val SCHEMA_VERSION = 2023022701
const val SCHEMA_VERSION = 2023072401
object PrefKeys {
// Note: not all of these keys are actually used as SharedPreferences keys but we must give
@ -61,7 +61,6 @@ object PrefKeys {
const val ANIMATE_GIF_AVATARS = "animateGifAvatars"
const val USE_BLURHASH = "useBlurhash"
const val SHOW_SELF_USERNAME = "showSelfUsername"
const val SHOW_NOTIFICATIONS_FILTER = "showNotificationsFilter"
const val SHOW_CARDS_IN_TIMELINES = "showCardsInTimelines"
const val CONFIRM_REBLOGS = "confirmReblogs"
const val CONFIRM_FAVOURITES = "confirmFavourites"
@ -104,4 +103,9 @@ object PrefKeys {
/** UI text scaling factor, stored as float, 100 = 100% = no scaling */
const val UI_TEXT_SCALE_RATIO = "uiTextScaleRatio"
/** Keys that are no longer used (e.g., the preference has been removed */
object Deprecated {
const val SHOW_NOTIFICATIONS_FILTER = "showNotificationsFilter"
}
}