diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActionBarView.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActionBarView.kt index 2e2b5a5d93..21b3fb82df 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActionBarView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationActionBarView.kt @@ -171,6 +171,7 @@ class ConversationActionBarView : LinearLayout { fun bind(setting: ConversationSetting, itemCount: Int, listener: (ConversationSetting) -> Unit) { binding.root.setOnClickListener { listener.invoke(setting) } + binding.root.contentDescription = setting.contentDescription binding.iconImageView.setImageResource(setting.iconResId) binding.iconImageView.isVisible = setting.iconResId > 0 binding.titleView.text = setting.title @@ -201,7 +202,8 @@ fun interface ConversationActionBarDelegate { data class ConversationSetting( val title: String, val settingType: ConversationSettingType, - val iconResId: Int = 0 + val iconResId: Int = 0, + val contentDescription: String = "" ) enum class ConversationSettingType { diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsActivity.kt index a6ef72524e..7ccdf2c3a1 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsActivity.kt @@ -41,9 +41,13 @@ class ExpirationSettingsActivity: PassphraseRequiredActionBarActivity() { private val viewModel: ExpirationSettingsViewModel by viewModels { val afterReadOptions = resources.getIntArray(R.array.read_expiration_time_values).map(Int::toString) - .zip(resources.getStringArray(R.array.read_expiration_time_names)) { value, name -> RadioOption(value, name)} + .zip(resources.getStringArray(R.array.read_expiration_time_names)) { value, name -> + RadioOption(value, name, getString(R.string.AccessibilityId_time_option)) + } val afterSendOptions = resources.getIntArray(R.array.send_expiration_time_values).map(Int::toString) - .zip(resources.getStringArray(R.array.send_expiration_time_names)) { value, name -> RadioOption(value, name)} + .zip(resources.getStringArray(R.array.send_expiration_time_names)) { value, name -> + RadioOption(value, name, getString(R.string.AccessibilityId_time_option)) + } viewModelFactory.create(threadId, mayAddTestExpiryOption(afterReadOptions), mayAddTestExpiryOption(afterSendOptions)) } @@ -161,16 +165,22 @@ class ExpirationSettingsActivity: PassphraseRequiredActionBarActivity() { if (viewModel.recipient.value?.isContactRecipient == true && viewModel.recipient.value?.isLocalNumber == false) { deleteTypeOptions.addAll( listOf( - RadioOption(value = "-1", title = getString(R.string.expiration_off)), + RadioOption( + value = "-1", + title = getString(R.string.expiration_off), + contentDescription = getString(R.string.AccessibilityId_disable_disappearing_messages) + ), RadioOption( value = ExpirationType.DELETE_AFTER_READ_VALUE.toString(), title = getString(R.string.expiration_type_disappear_after_read), - subtitle = getString(R.string.expiration_type_disappear_after_read_description) + subtitle = getString(R.string.expiration_type_disappear_after_read_description), + contentDescription = getString(R.string.AccessibilityId_disappear_after_read_option) ), RadioOption( value = ExpirationType.DELETE_AFTER_SEND_VALUE.toString(), title = getString(R.string.expiration_type_disappear_after_send), - subtitle = getString(R.string.expiration_type_disappear_after_send_description) + subtitle = getString(R.string.expiration_type_disappear_after_send_description), + contentDescription = getString(R.string.AccessibilityId_disappear_after_send_option) ) ) ) @@ -179,7 +189,11 @@ class ExpirationSettingsActivity: PassphraseRequiredActionBarActivity() { if (viewModel.recipient.value?.isContactRecipient == true && viewModel.recipient.value?.isLocalNumber == false) { deleteTypeOptions.addAll( listOf( - RadioOption(value = "-1", title = getString(R.string.expiration_off)), + RadioOption( + value = "-1", + title = getString(R.string.expiration_off), + contentDescription = getString(R.string.AccessibilityId_disable_disappearing_messages) + ), RadioOption( value = "0", title = getString(R.string.expiration_type_disappear_legacy), @@ -189,13 +203,15 @@ class ExpirationSettingsActivity: PassphraseRequiredActionBarActivity() { value = ExpirationType.DELETE_AFTER_READ_VALUE.toString(), title = getString(R.string.expiration_type_disappear_after_read), subtitle = getString(R.string.expiration_type_disappear_after_read_description), - enabled = false + enabled = false, + contentDescription = getString(R.string.AccessibilityId_disappear_after_read_option) ), RadioOption( value = ExpirationType.DELETE_AFTER_SEND_VALUE.toString(), title = getString(R.string.expiration_type_disappear_after_send), subtitle = getString(R.string.expiration_type_disappear_after_send_description), - enabled = false + enabled = false, + contentDescription = getString(R.string.AccessibilityId_disappear_after_send_option) ) ) ) @@ -212,7 +228,8 @@ class ExpirationSettingsActivity: PassphraseRequiredActionBarActivity() { value = ExpirationType.DELETE_AFTER_SEND_VALUE.toString(), title = getString(R.string.expiration_type_disappear_after_send), subtitle = getString(R.string.expiration_type_disappear_after_send_description), - enabled = false + enabled = false, + contentDescription = getString(R.string.AccessibilityId_disappear_after_send_option) ) ) ) diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/RadioOptionAdapter.kt b/app/src/main/java/org/thoughtcrime/securesms/preferences/RadioOptionAdapter.kt index 9bb2f5880b..51919526b5 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/RadioOptionAdapter.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/preferences/RadioOptionAdapter.kt @@ -49,6 +49,7 @@ class RadioOptionAdapter( fun bind(option: RadioOption, isSelected: Boolean, toggleSelection: (RadioOption) -> Unit) { val alpha = if (option.enabled) 1f else 0.5f binding.root.isEnabled = option.enabled + binding.root.contentDescription = option.contentDescription binding.titleTextView.alpha = alpha binding.subtitleTextView.alpha = alpha binding.selectButton.alpha = alpha @@ -69,5 +70,6 @@ data class RadioOption( val value: String, val title: String, val subtitle: String? = null, - val enabled: Boolean = true + val enabled: Boolean = true, + val contentDescription: String = "" ) diff --git a/app/src/main/res/layout/activity_expiration_settings.xml b/app/src/main/res/layout/activity_expiration_settings.xml index 62ac02c677..2e26bae1e1 100644 --- a/app/src/main/res/layout/activity_expiration_settings.xml +++ b/app/src/main/res/layout/activity_expiration_settings.xml @@ -73,6 +73,7 @@ android:id="@+id/layout_timer" android:layout_width="match_parent" android:layout_height="wrap_content" + android:contentDescription="@string/AccessibilityId_disappearing_messages_timer" android:layout_marginHorizontal="@dimen/small_spacing" android:background="@drawable/preference_single" android:paddingHorizontal="@dimen/large_spacing" @@ -108,6 +109,7 @@ style="@style/Widget.Session.Button.Common.ProminentOutline" android:layout_width="196dp" android:layout_height="@dimen/medium_button_height" + android:contentDescription="@string/AccessibilityId_set_button" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginTop="@dimen/medium_spacing" diff --git a/app/src/main/res/layout/view_control_message.xml b/app/src/main/res/layout/view_control_message.xml index 3fc5c6af35..b3266eb215 100644 --- a/app/src/main/res/layout/view_control_message.xml +++ b/app/src/main/res/layout/view_control_message.xml @@ -33,6 +33,7 @@ android:id="@+id/textView" android:layout_width="match_parent" android:layout_height="wrap_content" + android:contentDescription="@string/AccessibilityId_configuration_message" android:gravity="center" android:textColor="?android:textColorPrimary" android:textSize="@dimen/very_small_font_size" diff --git a/app/src/main/res/layout/view_conversation_action_bar.xml b/app/src/main/res/layout/view_conversation_action_bar.xml index a53e1e0cb5..c14a366a2d 100644 --- a/app/src/main/res/layout/view_conversation_action_bar.xml +++ b/app/src/main/res/layout/view_conversation_action_bar.xml @@ -22,6 +22,7 @@ android:id="@+id/conversationTitleView" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:contentDescription="@string/AccessibilityId_conversation_header_name" tools:text="@tools:sample/full_names" android:textColor="?android:textColorPrimary" android:textStyle="bold" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 836565653e..5ce7867da3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -9,6 +9,17 @@ Save Note to Self Version %s + + + Disappear after read option + Disappear after send option + Disappearing messages timer + Set button + Time option + Disable disappearing messages (Off option) + Configuration message + Disappearing messages type and time + Conversation header name New message