fix #541, properly fill contentdescriptions of tabs

This commit is contained in:
tibbi 2022-02-09 22:34:45 +01:00
parent da6012202c
commit ed56e1169f

View File

@ -432,6 +432,7 @@ class MainActivity : SimpleActivity() {
skippedTabs++ skippedTabs++
} else { } else {
val tab = main_tabs_holder.newTab().setIcon(getTabIcon(index)) val tab = main_tabs_holder.newTab().setIcon(getTabIcon(index))
tab.contentDescription = getTabContentDescription(index)
main_tabs_holder.addTab(tab, index - skippedTabs, config.lastUsedViewPagerPage == index - skippedTabs) main_tabs_holder.addTab(tab, index - skippedTabs, config.lastUsedViewPagerPage == index - skippedTabs)
} }
} }
@ -479,6 +480,16 @@ class MainActivity : SimpleActivity() {
return resources.getColoredDrawableWithColor(drawableId, config.textColor) return resources.getColoredDrawableWithColor(drawableId, config.textColor)
} }
private fun getTabContentDescription(position: Int): String {
val stringId = when (position) {
0 -> R.string.files_tab
1 -> R.string.recent_files_tab
else -> R.string.storage_analysis
}
return resources.getString(stringId)
}
private fun checkOTGPath() { private fun checkOTGPath() {
ensureBackgroundThread { ensureBackgroundThread {
if (!config.wasOTGHandled && hasPermission(PERMISSION_WRITE_STORAGE) && hasOTGConnected() && config.OTGPath.isEmpty()) { if (!config.wasOTGHandled && hasPermission(PERMISSION_WRITE_STORAGE) && hasOTGConnected() && config.OTGPath.isEmpty()) {