AccessibilityId WIP - up to AccessibilityId_reveal_recovery_phrase_button

This commit is contained in:
alansley 2024-08-06 15:51:53 +10:00
parent a8d72dfcc0
commit 399796bac3
16 changed files with 45 additions and 45 deletions

View File

@ -91,7 +91,7 @@ internal fun StartConversationScreen(
Spacer(modifier = Modifier.height(LocalDimensions.current.smallSpacing))
QrImage(
string = accountId,
Modifier.contentDescription(R.string.AccessibilityId_qr_code),
Modifier.contentDescription(R.string.AccessibilityId_qrCode),
icon = R.drawable.session
)
}

View File

@ -84,12 +84,12 @@ internal fun LandingScreen(
buttons = listOf(
DialogButtonModel(
text = GetString(R.string.onboardingTos),
contentDescription = GetString(R.string.AccessibilityId_terms_of_service_button),
contentDescription = GetString(R.string.AccessibilityId_onboardingTos),
onClick = openTerms
),
DialogButtonModel(
text = GetString(R.string.onboardingPrivacy),
contentDescription = GetString(R.string.AccessibilityId_privacy_policy_button),
contentDescription = GetString(R.string.AccessibilityId_onboardingPrivacy),
onClick = openPrivacyPolicy
)
)
@ -158,7 +158,7 @@ internal fun LandingScreen(
modifier = Modifier
.fillMaxWidth()
.align(Alignment.CenterHorizontally)
.contentDescription(R.string.AccessibilityId_create_account_button),
.contentDescription(R.string.AccessibilityId_onboardingAccountCreate),
onClick = createAccount
)
Spacer(modifier = Modifier.height(LocalDimensions.current.smallSpacing))
@ -167,7 +167,7 @@ internal fun LandingScreen(
modifier = Modifier
.fillMaxWidth()
.align(Alignment.CenterHorizontally)
.contentDescription(R.string.AccessibilityId_restore_account_button),
.contentDescription(R.string.AccessibilityId_onboardingAccountExists),
onClick = loadAccount
)
BorderlessHtmlButton(
@ -175,7 +175,7 @@ internal fun LandingScreen(
modifier = Modifier
.fillMaxWidth()
.align(Alignment.CenterHorizontally)
.contentDescription(R.string.AccessibilityId_open_url),
.contentDescription(R.string.AccessibilityId_urlOpenBrowser),
onClick = { isUrlDialogVisible = true }
)
Spacer(modifier = Modifier.height(LocalDimensions.current.xxsSpacing))

View File

@ -100,7 +100,7 @@ private fun RecoveryPassword(state: State, onChange: (String) -> Unit = {}, onCo
SessionOutlinedTextField(
text = state.recoveryPhrase,
modifier = Modifier.fillMaxWidth(),
contentDescription = stringResource(R.string.AccessibilityId_recovery_phrase_input),
contentDescription = stringResource(R.string.AccessibilityId_recoveryPhrase),
placeholder = stringResource(R.string.recoveryPasswordEnter),
onChange = onChange,
onContinue = onContinue,

View File

@ -20,7 +20,7 @@ internal fun LoadingScreen(progress: Float) {
Spacer(modifier = Modifier.weight(1f))
ProgressArc(
progress,
modifier = Modifier.contentDescription(R.string.AccessibilityId_loading_animation)
modifier = Modifier.contentDescription(R.string.AccessibilityId_loadAccountProgressMessage)
)
Text(
stringResource(R.string.waitOneMoment),

View File

@ -72,7 +72,7 @@ internal fun MessageNotificationsScreen(
NotificationRadioButton(
R.string.notificationsFastMode,
R.string.notificationsFastModeDescriptionAndroid,
modifier = Modifier.contentDescription(R.string.AccessibilityId_fast_mode_notifications_button),
modifier = Modifier.contentDescription(R.string.AccessibilityId_notificationsFastMode),
tag = R.string.recommended,
checked = state.pushEnabled,
onClick = { setEnabled(true) }
@ -86,7 +86,7 @@ internal fun MessageNotificationsScreen(
NotificationRadioButton(
R.string.notificationsSlowMode,
R.string.notificationsSlowModeDescription,
modifier = Modifier.contentDescription(R.string.AccessibilityId_slow_mode_notifications_button),
modifier = Modifier.contentDescription(R.string.AccessibilityId_notificationsSlowMode),
checked = state.pushDisabled,
onClick = { setEnabled(false) }
)

View File

@ -101,7 +101,7 @@ fun QrPage(string: String) {
string = string,
modifier = Modifier
.padding(top = LocalDimensions.current.mediumSpacing, bottom = LocalDimensions.current.xsSpacing)
.contentDescription(R.string.AccessibilityId_qr_code),
.contentDescription(R.string.AccessibilityId_qrCode),
icon = R.drawable.session
)

View File

@ -171,7 +171,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.settings_general, menu)
if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
menu.findItem(R.id.action_qr_code)?.contentDescription = resources.getString(R.string.AccessibilityId_view_qr_code)
menu.findItem(R.id.action_qr_code)?.contentDescription = resources.getString(R.string.AccessibilityId_qrView)
}
return true
}
@ -523,7 +523,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
LargeItemButton(
R.string.sessionRecoveryPassword,
R.drawable.ic_shield_outline,
Modifier.contentDescription(R.string.AccessibilityId_recovery_password_menu_item)
Modifier.contentDescription(R.string.AccessibilityId_sessionRecoveryPasswordMenuItem)
) { show<RecoveryPasswordActivity>() }
Divider()
}

View File

@ -50,7 +50,7 @@ internal fun RecoveryPasswordScreen(
Column(
verticalArrangement = Arrangement.spacedBy(LocalDimensions.current.smallSpacing),
modifier = Modifier
.contentDescription(R.string.AccessibilityId_recovery_password)
.contentDescription(R.string.AccessibilityId_sessionRecoveryPassword)
.verticalScroll(rememberScrollState())
.padding(bottom = LocalDimensions.current.smallSpacing)
) {
@ -99,7 +99,7 @@ private fun RecoveryPasswordCell(
seed,
modifier = Modifier
.padding(vertical = LocalDimensions.current.spacing)
.contentDescription(R.string.AccessibilityId_qr_code),
.contentDescription(R.string.AccessibilityId_qrCode),
contentPadding = 10.dp,
icon = R.drawable.session_shield
)
@ -136,7 +136,7 @@ private fun RecoveryPassword(mnemonic: String) {
Text(
mnemonic,
modifier = Modifier
.contentDescription(R.string.AccessibilityId_recovery_password_container)
.contentDescription(R.string.AccessibilityId_sessionRecoveryPasswordContainer)
.padding(vertical = LocalDimensions.current.spacing)
.border()
.padding(LocalDimensions.current.spacing),
@ -168,7 +168,7 @@ private fun HideRecoveryPasswordCell(onHide: () -> Unit = {}) {
modifier = Modifier
.wrapContentWidth()
.align(Alignment.CenterVertically)
.contentDescription(R.string.AccessibilityId_hide_recovery_password_button),
.contentDescription(R.string.AccessibilityId_recoveryPasswordHideRecoveryPassword),
color = LocalColors.current.danger,
onClick = onHide
)

View File

@ -46,7 +46,7 @@ class RecoveryPasswordActivity : BaseActionBarActivity() {
cancelButton()
dangerButton(
R.string.yes,
contentDescription = R.string.AccessibilityId_confirm_button
contentDescription = R.string.AccessibilityId_recoveryPasswordHidePermanentlyConfirm
) {
viewModel.permanentlyHidePassword()
finish()

View File

@ -175,12 +175,12 @@ fun PreviewXCloseDialog(){
buttons = listOf(
DialogButtonModel(
text = GetString(R.string.onboardingTos),
contentDescription = GetString(R.string.AccessibilityId_terms_of_service_button),
contentDescription = GetString(R.string.AccessibilityId_onboardingTos),
onClick = {}
),
DialogButtonModel(
text = GetString(R.string.onboardingPrivacy),
contentDescription = GetString(R.string.AccessibilityId_privacy_policy_button),
contentDescription = GetString(R.string.AccessibilityId_onboardingPrivacy),
onClick = {}
)
),

View File

@ -177,7 +177,7 @@ fun OutlineCopyButton(
val interactionSource = remember { MutableInteractionSource() }
Button(
modifier = modifier.contentDescription(R.string.AccessibilityId_copy_button),
modifier = modifier.contentDescription(R.string.AccessibilityId_copy),
interactionSource = interactionSource,
style = style,
type = ButtonType.Outline(color),

View File

@ -134,7 +134,7 @@ fun SessionOutlinedTextField(
Text(
it,
modifier = Modifier.fillMaxWidth()
.contentDescription(R.string.AccessibilityId_error_message),
.contentDescription(R.string.AccessibilityId_theError),
textAlign = TextAlign.Center,
style = LocalType.current.base.bold(),
color = LocalColors.current.danger

View File

@ -33,7 +33,7 @@
android:layout_height="64dp"
android:layout_marginHorizontal="@dimen/large_spacing"
android:layout_marginTop="@dimen/large_spacing"
android:contentDescription="@string/AccessibilityId_account_id_input"
android:contentDescription="@string/AccessibilityId_accountIdOrOnsEnter"
android:gravity="center_vertical"
android:hint="@string/accountIdOrOnsEnter"
android:imeOptions="actionDone"

View File

@ -6,5 +6,5 @@
android:title="@string/accountIdCopy"
android:id="@+id/menu_copy_account_id"
android:icon="@drawable/ic_content_copy_white_24dp"
android:contentDescription="@string/AccessibilityId_copy_account_id" />
android:contentDescription="@string/AccessibilityId_accountIdCopy" />
</menu>

View File

@ -6,7 +6,7 @@
<item
android:id="@+id/action_qr_code"
android:title=""
android:contentDescription="@string/AccessibilityId_view_qr_code"
android:contentDescription="@string/AccessibilityId_qrView"
android:icon="@drawable/ic_qr_code_24"
app:showAsAction="always" />

View File

@ -4,26 +4,26 @@
<!-- NOTE: Only non-translated Accessibility IDs for automated testing exist in this file. -->
<!-- Onboarding related -->
<string name="AccessibilityId_account_id_input">Account id input box</string>
<string name="AccessibilityId_confirm_button">Confirm button</string>
<string name="AccessibilityId_copy_account_id">Copy Account ID</string>
<string name="AccessibilityId_copy_button">Copy button</string>
<string name="AccessibilityId_error_message">Error message</string>
<string name="AccessibilityId_hide_recovery_password_button">Hide recovery password button</string>
<string name="AccessibilityId_qr_code">QR code</string>
<string name="AccessibilityId_recovery_password">Recovery password</string>
<string name="AccessibilityId_recovery_password_container">Recovery password container</string>
<string name="AccessibilityId_recovery_password_menu_item">Recovery password menu item</string>
<string name="AccessibilityId_view_qr_code">View QR code</string>
<string name="AccessibilityId_fast_mode_notifications_button">Fast mode notifications button</string>
<string name="AccessibilityId_slow_mode_notifications_button">Slow mode notifications button</string>
<string name="AccessibilityId_loading_animation">Loading animation</string>
<string name="AccessibilityId_create_account_button">Create account button</string>
<string name="AccessibilityId_restore_account_button">Restore your session button</string>
<string name="AccessibilityId_open_url">Open URL</string>
<string name="AccessibilityId_terms_of_service_button">Terms of service button</string>
<string name="AccessibilityId_privacy_policy_button">Privacy policy button</string>
<string name="AccessibilityId_recovery_phrase_input">Recovery phrase input</string>
<string name="AccessibilityId_accountIdOrOnsEnter">Account id input box</string>
<string name="AccessibilityId_recoveryPasswordHidePermanentlyConfirm">Confirm button</string>
<string name="AccessibilityId_accountIdCopy">Copy Account ID</string>
<string name="AccessibilityId_copy">Copy button</string>
<string name="AccessibilityId_theError">Error message</string>
<string name="AccessibilityId_recoveryPasswordHideRecoveryPassword">Hide recovery password button</string>
<string name="AccessibilityId_qrCode">QR code</string>
<string name="AccessibilityId_sessionRecoveryPassword">Recovery password</string>
<string name="AccessibilityId_sessionRecoveryPasswordContainer">Recovery password container</string>
<string name="AccessibilityId_sessionRecoveryPasswordMenuItem">Recovery password menu item</string>
<string name="AccessibilityId_qrView">View QR code</string>
<string name="AccessibilityId_notificationsFastMode">Fast mode notifications button</string>
<string name="AccessibilityId_notificationsSlowMode">Slow mode notifications button</string>
<string name="AccessibilityId_loadAccountProgressMessage">Loading animation</string>
<string name="AccessibilityId_onboardingAccountCreate">Create account button</string>
<string name="AccessibilityId_onboardingAccountExists">Restore your session button</string>
<string name="AccessibilityId_urlOpenBrowser">Open URL</string>
<string name="AccessibilityId_onboardingTos">Terms of service button</string>
<string name="AccessibilityId_onboardingPrivacy">Privacy policy button</string>
<string name="AccessibilityId_recoveryPhrase">Recovery phrase input</string>
<string name="AccessibilityId_reveal_recovery_phrase_button">Reveal recovery phrase button</string>
<string name="AccessibilityId_help_desk_link">Help desk link</string>
<string name="AccessibilityId_invite_friend_button">Invite friend button</string>