Skip to content

Commit ed56e11

Browse files
committed
fix #541, properly fill contentdescriptions of tabs
1 parent da60122 commit ed56e11

File tree

1 file changed

+11
-0
lines changed
  • app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities

1 file changed

+11
-0
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ class MainActivity : SimpleActivity() {
432432
skippedTabs++
433433
} else {
434434
val tab = main_tabs_holder.newTab().setIcon(getTabIcon(index))
435+
tab.contentDescription = getTabContentDescription(index)
435436
main_tabs_holder.addTab(tab, index - skippedTabs, config.lastUsedViewPagerPage == index - skippedTabs)
436437
}
437438
}
@@ -479,6 +480,16 @@ class MainActivity : SimpleActivity() {
479480
return resources.getColoredDrawableWithColor(drawableId, config.textColor)
480481
}
481482

483+
private fun getTabContentDescription(position: Int): String {
484+
val stringId = when (position) {
485+
0 -> R.string.files_tab
486+
1 -> R.string.recent_files_tab
487+
else -> R.string.storage_analysis
488+
}
489+
490+
return resources.getString(stringId)
491+
}
492+
482493
private fun checkOTGPath() {
483494
ensureBackgroundThread {
484495
if (!config.wasOTGHandled && hasPermission(PERMISSION_WRITE_STORAGE) && hasOTGConnected() && config.OTGPath.isEmpty()) {

0 commit comments

Comments
 (0)