mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
fix #236, adding some content descriptions for Talkback
This commit is contained in:
@ -158,6 +158,7 @@ class CallActivity : SimpleActivity() {
|
||||
|
||||
val newRoute = if (isSpeakerOn) CallAudioState.ROUTE_SPEAKER else CallAudioState.ROUTE_EARPIECE
|
||||
CallManager.inCallService?.setAudioRoute(newRoute)
|
||||
call_toggle_speaker.contentDescription = getString(if (isSpeakerOn) R.string.turn_speaker_off else R.string.turn_speaker_on)
|
||||
}
|
||||
|
||||
private fun toggleMicrophone() {
|
||||
@ -166,6 +167,7 @@ class CallActivity : SimpleActivity() {
|
||||
call_toggle_microphone.setImageDrawable(getDrawable(drawable))
|
||||
audioManager.isMicrophoneMute = !isMicrophoneOn
|
||||
CallManager.inCallService?.setMuted(!isMicrophoneOn)
|
||||
call_toggle_microphone.contentDescription = getString(if (isMicrophoneOn) R.string.turn_microphone_off else R.string.turn_microphone_on)
|
||||
}
|
||||
|
||||
private fun toggleDialpadVisibility() {
|
||||
|
@ -299,6 +299,7 @@ class MainActivity : SimpleActivity() {
|
||||
skippedTabs++
|
||||
} else {
|
||||
val tab = main_tabs_holder.newTab().setIcon(getTabIcon(index))
|
||||
tab.contentDescription = getTabContentDescription(index)
|
||||
val wasAlreadySelected = selectedTabIndex > -1 && selectedTabIndex == index - skippedTabs
|
||||
val shouldSelect = !isAnySelected && wasAlreadySelected
|
||||
if (shouldSelect) {
|
||||
@ -324,6 +325,16 @@ class MainActivity : SimpleActivity() {
|
||||
return resources.getColoredDrawableWithColor(drawableId, config.textColor)
|
||||
}
|
||||
|
||||
private fun getTabContentDescription(position: Int): String {
|
||||
val stringId = when (position) {
|
||||
0 -> R.string.contacts_tab
|
||||
1 -> R.string.favorites_tab
|
||||
else -> R.string.call_history_tab
|
||||
}
|
||||
|
||||
return resources.getString(stringId)
|
||||
}
|
||||
|
||||
private fun refreshItems(openLastTab: Boolean = false) {
|
||||
if (isDestroyed || isFinishing) {
|
||||
return
|
||||
|
Reference in New Issue
Block a user