From 487ce37d915e07e54fe9381bb33d4e6bbf260102 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 9 Jul 2022 13:11:00 -0400 Subject: [PATCH] Set content descriptions for bottom nav badges Doesn't seem to produce #6708, but at least it'll be used by screen readers? --- .../java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index e2f3e3c6b..39beffe0d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -382,7 +382,10 @@ class MainActivity : BaseActivity() { private fun setUnreadUpdatesBadge() { val updates = if (preferences.showUpdatesNavBadge().get()) preferences.unreadUpdatesCount().get() else 0 if (updates > 0) { - nav.getOrCreateBadge(R.id.nav_updates).number = updates + nav.getOrCreateBadge(R.id.nav_updates).apply { + number = updates + setContentDescriptionQuantityStringsResource(R.plurals.notification_chapters_generic) + } } else { nav.removeBadge(R.id.nav_updates) } @@ -391,7 +394,10 @@ class MainActivity : BaseActivity() { private fun setExtensionsBadge() { val updates = preferences.extensionUpdatesCount().get() if (updates > 0) { - nav.getOrCreateBadge(R.id.nav_browse).number = updates + nav.getOrCreateBadge(R.id.nav_browse).apply { + number = updates + setContentDescriptionQuantityStringsResource(R.plurals.update_check_notification_ext_updates) + } } else { nav.removeBadge(R.id.nav_browse) }