diff --git a/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt index 72ab42637e6..923afc08687 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt @@ -557,9 +557,18 @@ class FileDisplayActivity : FileActivity(), menu.removeItem(shareFileMenuItem.itemId) } + setRolesAccessibilityToMenuItems() + return true } + private fun setRolesAccessibilityToMenuItems() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + selectAllMenuItem?.contentDescription = + getString(R.string.actionbar_select_all) + getString(R.string.button_role_accessibility) + } + } + override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { android.R.id.home -> { diff --git a/owncloudApp/src/main/java/com/owncloud/android/ui/preview/PreviewVideoActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/ui/preview/PreviewVideoActivity.kt index 330f12d2c2a..3647ca7863c 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/ui/preview/PreviewVideoActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/ui/preview/PreviewVideoActivity.kt @@ -328,6 +328,21 @@ class PreviewVideoActivity : FileActivity(), Player.Listener, OnPrepareVideoPlay val hasWritePermission: Boolean = safeFile.hasWritePermission menu.filterMenuOptions(menuOptions, hasWritePermission) } + setRolesAccessibilityToMenuItems(menu) + } + + private fun setRolesAccessibilityToMenuItems(menu: Menu) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + val roleAccessibilityDescription = getString(R.string.button_role_accessibility) + menu.apply { + menu.findItem(R.id.action_open_file_with)?.contentDescription = getString(R.string.actionbar_open_with) + roleAccessibilityDescription + menu.findItem(R.id.action_send_file)?.contentDescription = getString(R.string.actionbar_send_file) + roleAccessibilityDescription + menu.findItem(R.id.action_set_available_offline)?.contentDescription = getString(R.string.set_available_offline) + roleAccessibilityDescription + menu.findItem(R.id.action_unset_available_offline)?.contentDescription = getString(R.string.unset_available_offline) + roleAccessibilityDescription + menu.findItem(R.id.action_see_details)?.contentDescription = getString(R.string.actionbar_see_details) + roleAccessibilityDescription + menu.findItem(R.id.action_remove_file)?.contentDescription = getString(R.string.common_remove) + roleAccessibilityDescription + } + } } override fun onMenuItemSelected(menuItem: MenuItem): Boolean {