diff --git a/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/ui/AddonsManagerAdapter.kt b/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/ui/AddonsManagerAdapter.kt index 4ed1ad119614..64c4df655d26 100644 --- a/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/ui/AddonsManagerAdapter.kt +++ b/android-components/components/feature/addons/src/main/java/mozilla/components/feature/addons/ui/AddonsManagerAdapter.kt @@ -248,6 +248,7 @@ class AddonsManagerAdapter( } @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) + @Suppress("LongMethod") internal fun bindAddon( holder: AddonViewHolder, addon: Addon, @@ -291,6 +292,10 @@ class AddonsManagerAdapter( } holder.addButton.isInvisible = addon.isInstalled() + holder.addButton.contentDescription = context.getString( + R.string.mozac_feature_addons_install_addon_content_description_2, + addonName, + ) holder.addButton.setOnClickListener { if (!addon.isInstalled()) { addonsManagerDelegate.onInstallAddonButtonClicked(addon) diff --git a/android-components/components/feature/addons/src/main/res/layout/mozac_feature_addons_item.xml b/android-components/components/feature/addons/src/main/res/layout/mozac_feature_addons_item.xml index 24b066ad25d1..9ed77d46fef8 100644 --- a/android-components/components/feature/addons/src/main/res/layout/mozac_feature_addons_item.xml +++ b/android-components/components/feature/addons/src/main/res/layout/mozac_feature_addons_item.xml @@ -151,7 +151,6 @@ android:layout_alignParentEnd="true" android:layout_centerVertical="true" android:background="?attr/selectableItemBackgroundBorderless" - android:contentDescription="@string/mozac_feature_addons_install_addon_content_description" app:srcCompat="@drawable/mozac_ic_plus_24" app:tint="?android:attr/textColorPrimary" /> diff --git a/android-components/components/feature/addons/src/main/res/values/strings.xml b/android-components/components/feature/addons/src/main/res/values/strings.xml index 2091d64276a9..e1279908e6ce 100644 --- a/android-components/components/feature/addons/src/main/res/values/strings.xml +++ b/android-components/components/feature/addons/src/main/res/values/strings.xml @@ -140,7 +140,9 @@ Cancel - Install Add-on + Install Add-on + + Install %1$s Cancel diff --git a/fenix/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuAddonsManagerRobot.kt b/fenix/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuAddonsManagerRobot.kt index 3c73bc82a616..94c5c3f50074 100644 --- a/fenix/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuAddonsManagerRobot.kt +++ b/fenix/app/src/androidTest/java/org/mozilla/fenix/ui/robots/SettingsSubMenuAddonsManagerRobot.kt @@ -204,7 +204,7 @@ class SettingsSubMenuAddonsManagerRobot { private fun installButtonForAddon(addonName: String) = onView( allOf( - withContentDescription(R.string.mozac_feature_addons_install_addon_content_description), + withContentDescription("Install $addonName"), isDescendantOfA(withId(R.id.add_on_item)), hasSibling(hasDescendant(withText(addonName))), ),