mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-04-15 10:47:31 +02:00
fix #541, properly fill contentdescriptions of tabs
This commit is contained in:
parent
da6012202c
commit
ed56e1169f
@ -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()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user