mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-26 01:37:43 +00:00
AccessibilityIds
This commit is contained in:
parent
b5af8de4f9
commit
b8b98f436d
@ -98,6 +98,7 @@ import org.thoughtcrime.securesms.preferences.SettingsActivity
|
|||||||
import org.thoughtcrime.securesms.showMuteDialog
|
import org.thoughtcrime.securesms.showMuteDialog
|
||||||
import org.thoughtcrime.securesms.showSessionDialog
|
import org.thoughtcrime.securesms.showSessionDialog
|
||||||
import org.thoughtcrime.securesms.ui.AppTheme
|
import org.thoughtcrime.securesms.ui.AppTheme
|
||||||
|
import org.thoughtcrime.securesms.ui.GetString
|
||||||
import org.thoughtcrime.securesms.ui.OutlineButton
|
import org.thoughtcrime.securesms.ui.OutlineButton
|
||||||
import org.thoughtcrime.securesms.ui.PreviewTheme
|
import org.thoughtcrime.securesms.ui.PreviewTheme
|
||||||
import org.thoughtcrime.securesms.ui.SessionShieldIcon
|
import org.thoughtcrime.securesms.ui.SessionShieldIcon
|
||||||
@ -371,7 +372,8 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),
|
|||||||
Spacer(Modifier.width(12.dp))
|
Spacer(Modifier.width(12.dp))
|
||||||
OutlineButton(
|
OutlineButton(
|
||||||
stringResource(R.string.continue_2),
|
stringResource(R.string.continue_2),
|
||||||
Modifier.align(Alignment.CenterVertically)
|
Modifier.align(Alignment.CenterVertically),
|
||||||
|
contentDescription = GetString(R.string.AccessibilityId_reveal_recovery_phrase_button)
|
||||||
) { startRecoveryPasswordActivity() }
|
) { startRecoveryPasswordActivity() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -394,7 +396,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),
|
|||||||
tint = Color.Unspecified
|
tint = Color.Unspecified
|
||||||
)
|
)
|
||||||
if (newAccount) Text(stringResource(R.string.onboardingAccountCreated), style = MaterialTheme.typography.h4, textAlign = TextAlign.Center)
|
if (newAccount) Text(stringResource(R.string.onboardingAccountCreated), style = MaterialTheme.typography.h4, textAlign = TextAlign.Center)
|
||||||
if (newAccount) Text(stringResource(R.string.onboardingBubbleWelcomeToSession), color = MaterialTheme.colors.secondary, textAlign = TextAlign.Center)
|
if (newAccount) Text(stringResource(R.string.welcome_to_session), color = MaterialTheme.colors.secondary, textAlign = TextAlign.Center)
|
||||||
|
|
||||||
Divider(modifier = Modifier.padding(vertical = 16.dp))
|
Divider(modifier = Modifier.padding(vertical = 16.dp))
|
||||||
Text(
|
Text(
|
||||||
|
@ -22,6 +22,7 @@ import androidx.compose.ui.platform.ComposeView
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import network.loki.messenger.R
|
import network.loki.messenger.R
|
||||||
@ -34,7 +35,10 @@ import org.thoughtcrime.securesms.showSessionDialog
|
|||||||
import org.thoughtcrime.securesms.ui.AppTheme
|
import org.thoughtcrime.securesms.ui.AppTheme
|
||||||
import org.thoughtcrime.securesms.ui.BorderlessButton
|
import org.thoughtcrime.securesms.ui.BorderlessButton
|
||||||
import org.thoughtcrime.securesms.ui.FilledButton
|
import org.thoughtcrime.securesms.ui.FilledButton
|
||||||
|
import org.thoughtcrime.securesms.ui.GetString
|
||||||
import org.thoughtcrime.securesms.ui.OutlineButton
|
import org.thoughtcrime.securesms.ui.OutlineButton
|
||||||
|
import org.thoughtcrime.securesms.ui.PreviewTheme
|
||||||
|
import org.thoughtcrime.securesms.ui.ThemeResPreviewParameterProvider
|
||||||
import org.thoughtcrime.securesms.ui.classicDarkColors
|
import org.thoughtcrime.securesms.ui.classicDarkColors
|
||||||
import org.thoughtcrime.securesms.ui.contentDescription
|
import org.thoughtcrime.securesms.ui.contentDescription
|
||||||
import org.thoughtcrime.securesms.ui.session_accent
|
import org.thoughtcrime.securesms.ui.session_accent
|
||||||
@ -52,7 +56,7 @@ class LandingActivity : BaseActionBarActivity() {
|
|||||||
setUpActionBarSessionLogo(true)
|
setUpActionBarSessionLogo(true)
|
||||||
|
|
||||||
ComposeView(this)
|
ComposeView(this)
|
||||||
.apply { setContent { LandingScreen() } }
|
.apply { setContent { AppTheme { LandingScreen() } } }
|
||||||
.let(::setContentView)
|
.let(::setContentView)
|
||||||
|
|
||||||
IdentityKeyUtil.generateIdentityKeyPair(this)
|
IdentityKeyUtil.generateIdentityKeyPair(this)
|
||||||
@ -62,9 +66,17 @@ class LandingActivity : BaseActionBarActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Preview
|
@Preview
|
||||||
|
@Composable
|
||||||
|
private fun LandingScreen(
|
||||||
|
@PreviewParameter(ThemeResPreviewParameterProvider::class) themeResId: Int
|
||||||
|
) {
|
||||||
|
PreviewTheme(themeResId) {
|
||||||
|
LandingScreen()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun LandingScreen() {
|
private fun LandingScreen() {
|
||||||
AppTheme {
|
|
||||||
Column(modifier = Modifier.padding(horizontal = 36.dp)) {
|
Column(modifier = Modifier.padding(horizontal = 36.dp)) {
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
Text(stringResource(R.string.onboardingBubblePrivacyInYourPocket), modifier = Modifier.align(Alignment.CenterHorizontally), style = MaterialTheme.typography.h4, textAlign = TextAlign.Center)
|
Text(stringResource(R.string.onboardingBubblePrivacyInYourPocket), modifier = Modifier.align(Alignment.CenterHorizontally), style = MaterialTheme.typography.h4, textAlign = TextAlign.Center)
|
||||||
@ -82,31 +94,43 @@ class LandingActivity : BaseActionBarActivity() {
|
|||||||
text = stringResource(R.string.onboardingAccountCreate),
|
text = stringResource(R.string.onboardingAccountCreate),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.width(262.dp)
|
.width(262.dp)
|
||||||
.align(Alignment.CenterHorizontally)) { startPickDisplayNameActivity() }
|
.align(Alignment.CenterHorizontally),
|
||||||
|
contentDescription = GetString(R.string.AccessibilityId_create_account_button)
|
||||||
|
) { startPickDisplayNameActivity() }
|
||||||
Spacer(modifier = Modifier.height(14.dp))
|
Spacer(modifier = Modifier.height(14.dp))
|
||||||
FilledButton(text = stringResource(R.string.onboardingAccountExists), modifier = Modifier
|
FilledButton(
|
||||||
|
text = stringResource(R.string.onboardingAccountExists),
|
||||||
|
modifier = Modifier
|
||||||
.width(262.dp)
|
.width(262.dp)
|
||||||
.align(Alignment.CenterHorizontally)) { startLinkDeviceActivity() }
|
.align(Alignment.CenterHorizontally),
|
||||||
|
contentDescription = GetString(R.string.AccessibilityId_restore_account_button)
|
||||||
|
) { startLinkDeviceActivity() }
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
BorderlessButton(
|
BorderlessButton(
|
||||||
text = stringResource(R.string.onboardingTosPrivacy),
|
text = stringResource(R.string.onboardingTosPrivacy),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.width(262.dp)
|
.width(262.dp)
|
||||||
.align(Alignment.CenterHorizontally),
|
.align(Alignment.CenterHorizontally),
|
||||||
|
contentDescription = GetString(R.string.AccessibilityId_privacy_policy_link),
|
||||||
fontSize = 11.sp,
|
fontSize = 11.sp,
|
||||||
lineHeight = 13.sp
|
lineHeight = 13.sp
|
||||||
) { openDialog() }
|
) { openDialog() }
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private fun openDialog() {
|
private fun openDialog() {
|
||||||
showSessionDialog {
|
showSessionDialog {
|
||||||
title(R.string.urlOpen)
|
title(R.string.urlOpen)
|
||||||
text(R.string.urlOpenBrowser)
|
text(R.string.urlOpenBrowser)
|
||||||
button(R.string.activity_landing_terms_of_service) { open("https://getsession.org/terms-of-service") }
|
button(
|
||||||
button(R.string.activity_landing_privacy_policy) { open("https://getsession.org/privacy-policy") }
|
R.string.activity_landing_terms_of_service,
|
||||||
|
contentDescriptionRes = R.string.AccessibilityId_terms_of_service_link
|
||||||
|
) { open("https://getsession.org/terms-of-service") }
|
||||||
|
button(
|
||||||
|
R.string.activity_landing_privacy_policy,
|
||||||
|
contentDescriptionRes = R.string.AccessibilityId_privacy_policy_link
|
||||||
|
) { open("https://getsession.org/privacy-policy") }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,8 +160,8 @@ class LandingActivity : BaseActionBarActivity() {
|
|||||||
private fun ChatText(
|
private fun ChatText(
|
||||||
text: String,
|
text: String,
|
||||||
color: Color,
|
color: Color,
|
||||||
textColor: Color = Color.Unspecified,
|
modifier: Modifier = Modifier,
|
||||||
modifier: Modifier = Modifier
|
textColor: Color = Color.Unspecified
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text,
|
text,
|
||||||
|
@ -77,6 +77,7 @@ import org.thoughtcrime.securesms.ui.AppTheme
|
|||||||
import org.thoughtcrime.securesms.ui.OutlineButton
|
import org.thoughtcrime.securesms.ui.OutlineButton
|
||||||
import org.thoughtcrime.securesms.ui.baseBold
|
import org.thoughtcrime.securesms.ui.baseBold
|
||||||
import org.thoughtcrime.securesms.ui.components.SessionTabRow
|
import org.thoughtcrime.securesms.ui.components.SessionTabRow
|
||||||
|
import org.thoughtcrime.securesms.ui.contentDescription
|
||||||
import org.thoughtcrime.securesms.ui.outlinedTextFieldColors
|
import org.thoughtcrime.securesms.ui.outlinedTextFieldColors
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@ -275,6 +276,7 @@ fun RecoveryPassword(state: LinkDeviceState, onChange: (String) -> Unit = {}, on
|
|||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = state.recoveryPhrase,
|
value = state.recoveryPhrase,
|
||||||
onValueChange = { onChange(it) },
|
onValueChange = { onChange(it) },
|
||||||
|
modifier = Modifier.contentDescription(R.string.AccessibilityId_recovery_phrase_input),
|
||||||
placeholder = { Text(stringResource(R.string.recoveryPasswordEnter)) },
|
placeholder = { Text(stringResource(R.string.recoveryPasswordEnter)) },
|
||||||
colors = outlinedTextFieldColors(state.error != null),
|
colors = outlinedTextFieldColors(state.error != null),
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
@ -289,7 +291,12 @@ fun RecoveryPassword(state: LinkDeviceState, onChange: (String) -> Unit = {}, on
|
|||||||
)
|
)
|
||||||
Spacer(Modifier.size(12.dp))
|
Spacer(Modifier.size(12.dp))
|
||||||
state.error?.let {
|
state.error?.let {
|
||||||
Text(it, style = MaterialTheme.typography.baseBold, color = MaterialTheme.colors.error)
|
Text(
|
||||||
|
it,
|
||||||
|
modifier = Modifier.contentDescription(R.string.AccessibilityId_error_message),
|
||||||
|
style = MaterialTheme.typography.baseBold,
|
||||||
|
color = MaterialTheme.colors.error
|
||||||
|
)
|
||||||
}
|
}
|
||||||
Spacer(Modifier.weight(2f))
|
Spacer(Modifier.weight(2f))
|
||||||
OutlineButton(
|
OutlineButton(
|
||||||
|
@ -31,6 +31,7 @@ import org.thoughtcrime.securesms.onboarding.messagenotifications.startPNModeAct
|
|||||||
import org.thoughtcrime.securesms.onboarding.pickname.startPickDisplayNameActivity
|
import org.thoughtcrime.securesms.onboarding.pickname.startPickDisplayNameActivity
|
||||||
import org.thoughtcrime.securesms.ui.AppTheme
|
import org.thoughtcrime.securesms.ui.AppTheme
|
||||||
import org.thoughtcrime.securesms.ui.ProgressArc
|
import org.thoughtcrime.securesms.ui.ProgressArc
|
||||||
|
import org.thoughtcrime.securesms.ui.contentDescription
|
||||||
import org.thoughtcrime.securesms.util.setUpActionBarSessionLogo
|
import org.thoughtcrime.securesms.util.setUpActionBarSessionLogo
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -103,7 +104,7 @@ class LoadingActivity: BaseActionBarActivity() {
|
|||||||
AppTheme {
|
AppTheme {
|
||||||
Column {
|
Column {
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
ProgressArc(animatable.value, modifier = Modifier.align(Alignment.CenterHorizontally))
|
ProgressArc(animatable.value, modifier = Modifier.align(Alignment.CenterHorizontally).contentDescription(R.string.AccessibilityId_loading_animation))
|
||||||
Text(stringResource(R.string.waitOneMoment), modifier = Modifier.align(Alignment.CenterHorizontally), style = MaterialTheme.typography.h6)
|
Text(stringResource(R.string.waitOneMoment), modifier = Modifier.align(Alignment.CenterHorizontally), style = MaterialTheme.typography.h6)
|
||||||
Text(stringResource(R.string.loadAccountProgressMessage), modifier = Modifier.align(Alignment.CenterHorizontally))
|
Text(stringResource(R.string.loadAccountProgressMessage), modifier = Modifier.align(Alignment.CenterHorizontally))
|
||||||
Spacer(modifier = Modifier.weight(2f))
|
Spacer(modifier = Modifier.weight(2f))
|
||||||
|
@ -38,9 +38,11 @@ import org.thoughtcrime.securesms.BaseActionBarActivity
|
|||||||
import org.thoughtcrime.securesms.home.HomeActivity
|
import org.thoughtcrime.securesms.home.HomeActivity
|
||||||
import org.thoughtcrime.securesms.notifications.PushRegistry
|
import org.thoughtcrime.securesms.notifications.PushRegistry
|
||||||
import org.thoughtcrime.securesms.ui.AppTheme
|
import org.thoughtcrime.securesms.ui.AppTheme
|
||||||
|
import org.thoughtcrime.securesms.ui.GetString
|
||||||
import org.thoughtcrime.securesms.ui.OutlineButton
|
import org.thoughtcrime.securesms.ui.OutlineButton
|
||||||
import org.thoughtcrime.securesms.ui.PreviewTheme
|
import org.thoughtcrime.securesms.ui.PreviewTheme
|
||||||
import org.thoughtcrime.securesms.ui.ThemeResPreviewParameterProvider
|
import org.thoughtcrime.securesms.ui.ThemeResPreviewParameterProvider
|
||||||
|
import org.thoughtcrime.securesms.ui.contentDescription
|
||||||
import org.thoughtcrime.securesms.ui.h8
|
import org.thoughtcrime.securesms.ui.h8
|
||||||
import org.thoughtcrime.securesms.ui.h9
|
import org.thoughtcrime.securesms.ui.h9
|
||||||
import org.thoughtcrime.securesms.ui.session_accent
|
import org.thoughtcrime.securesms.ui.session_accent
|
||||||
@ -111,6 +113,7 @@ fun MessageNotificationsScreen(
|
|||||||
R.string.activity_pn_mode_fast_mode,
|
R.string.activity_pn_mode_fast_mode,
|
||||||
R.string.activity_pn_mode_fast_mode_explanation,
|
R.string.activity_pn_mode_fast_mode_explanation,
|
||||||
R.string.activity_pn_mode_recommended_option_tag,
|
R.string.activity_pn_mode_recommended_option_tag,
|
||||||
|
contentDescription = R.string.AccessibilityId_fast_mode_notifications_button,
|
||||||
selected = state.pushEnabled,
|
selected = state.pushEnabled,
|
||||||
onClick = { setEnabled(true) }
|
onClick = { setEnabled(true) }
|
||||||
)
|
)
|
||||||
@ -118,6 +121,7 @@ fun MessageNotificationsScreen(
|
|||||||
NotificationRadioButton(
|
NotificationRadioButton(
|
||||||
R.string.activity_pn_mode_slow_mode,
|
R.string.activity_pn_mode_slow_mode,
|
||||||
R.string.activity_pn_mode_slow_mode_explanation,
|
R.string.activity_pn_mode_slow_mode_explanation,
|
||||||
|
contentDescription = R.string.AccessibilityId_slow_mode_notifications_button,
|
||||||
selected = state.pushDisabled,
|
selected = state.pushDisabled,
|
||||||
onClick = { setEnabled(false) }
|
onClick = { setEnabled(false) }
|
||||||
)
|
)
|
||||||
@ -138,13 +142,14 @@ fun NotificationRadioButton(
|
|||||||
@StringRes title: Int,
|
@StringRes title: Int,
|
||||||
@StringRes explanation: Int,
|
@StringRes explanation: Int,
|
||||||
@StringRes tag: Int? = null,
|
@StringRes tag: Int? = null,
|
||||||
|
@StringRes contentDescription: Int? = null,
|
||||||
selected: Boolean = false,
|
selected: Boolean = false,
|
||||||
onClick: () -> Unit = {}
|
onClick: () -> Unit = {}
|
||||||
) {
|
) {
|
||||||
Row {
|
Row {
|
||||||
OutlinedButton(
|
OutlinedButton(
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f).contentDescription(contentDescription),
|
||||||
colors = ButtonDefaults.outlinedButtonColors(backgroundColor = MaterialTheme.colors.background, contentColor = Color.White),
|
colors = ButtonDefaults.outlinedButtonColors(backgroundColor = MaterialTheme.colors.background, contentColor = Color.White),
|
||||||
border = if (selected) BorderStroke(ButtonDefaults.OutlinedBorderSize, session_accent) else ButtonDefaults.outlinedBorder,
|
border = if (selected) BorderStroke(ButtonDefaults.OutlinedBorderSize, session_accent) else ButtonDefaults.outlinedBorder,
|
||||||
shape = RoundedCornerShape(8.dp)
|
shape = RoundedCornerShape(8.dp)
|
||||||
|
@ -106,7 +106,7 @@ class PickDisplayNameActivity : BaseActionBarActivity() {
|
|||||||
|
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = state.displayName,
|
value = state.displayName,
|
||||||
modifier = Modifier.contentDescription(R.string.displayNameEnter),
|
modifier = Modifier.contentDescription(R.string.AccessibilityId_enter_display_name),
|
||||||
onValueChange = { onChange(it) },
|
onValueChange = { onChange(it) },
|
||||||
placeholder = { Text(stringResource(R.string.displayNameEnter)) },
|
placeholder = { Text(stringResource(R.string.displayNameEnter)) },
|
||||||
colors = outlinedTextFieldColors(state.error != null),
|
colors = outlinedTextFieldColors(state.error != null),
|
||||||
|
@ -51,6 +51,7 @@ import org.thoughtcrime.securesms.BaseActionBarActivity
|
|||||||
import org.thoughtcrime.securesms.showSessionDialog
|
import org.thoughtcrime.securesms.showSessionDialog
|
||||||
import org.thoughtcrime.securesms.ui.AppTheme
|
import org.thoughtcrime.securesms.ui.AppTheme
|
||||||
import org.thoughtcrime.securesms.ui.CellWithPaddingAndMargin
|
import org.thoughtcrime.securesms.ui.CellWithPaddingAndMargin
|
||||||
|
import org.thoughtcrime.securesms.ui.GetString
|
||||||
import org.thoughtcrime.securesms.ui.LaunchedEffectAsync
|
import org.thoughtcrime.securesms.ui.LaunchedEffectAsync
|
||||||
import org.thoughtcrime.securesms.ui.LocalExtraColors
|
import org.thoughtcrime.securesms.ui.LocalExtraColors
|
||||||
import org.thoughtcrime.securesms.ui.OutlineButton
|
import org.thoughtcrime.securesms.ui.OutlineButton
|
||||||
@ -59,6 +60,7 @@ import org.thoughtcrime.securesms.ui.SessionShieldIcon
|
|||||||
import org.thoughtcrime.securesms.ui.ThemeResPreviewParameterProvider
|
import org.thoughtcrime.securesms.ui.ThemeResPreviewParameterProvider
|
||||||
import org.thoughtcrime.securesms.ui.classicDarkColors
|
import org.thoughtcrime.securesms.ui.classicDarkColors
|
||||||
import org.thoughtcrime.securesms.ui.colorDestructive
|
import org.thoughtcrime.securesms.ui.colorDestructive
|
||||||
|
import org.thoughtcrime.securesms.ui.contentDescription
|
||||||
import org.thoughtcrime.securesms.ui.h8
|
import org.thoughtcrime.securesms.ui.h8
|
||||||
import org.thoughtcrime.securesms.ui.small
|
import org.thoughtcrime.securesms.ui.small
|
||||||
import kotlin.time.Duration.Companion.seconds
|
import kotlin.time.Duration.Companion.seconds
|
||||||
@ -92,7 +94,10 @@ class RecoveryPasswordActivity : BaseActionBarActivity() {
|
|||||||
title(R.string.recoveryPasswordHidePermanently)
|
title(R.string.recoveryPasswordHidePermanently)
|
||||||
text(R.string.recoveryPasswordHidePermanentlyDescription2)
|
text(R.string.recoveryPasswordHidePermanentlyDescription2)
|
||||||
cancelButton()
|
cancelButton()
|
||||||
destructiveButton(R.string.yes) {
|
destructiveButton(
|
||||||
|
R.string.yes,
|
||||||
|
contentDescription = R.string.AccessibilityId_confirm_button
|
||||||
|
) {
|
||||||
viewModel.permanentlyHidePassword()
|
viewModel.permanentlyHidePassword()
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
@ -102,7 +107,7 @@ class RecoveryPasswordActivity : BaseActionBarActivity() {
|
|||||||
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
fun PreviewMessageDetails(
|
fun PreviewRecoveryPassword(
|
||||||
@PreviewParameter(ThemeResPreviewParameterProvider::class) themeResId: Int
|
@PreviewParameter(ThemeResPreviewParameterProvider::class) themeResId: Int
|
||||||
) {
|
) {
|
||||||
PreviewTheme(themeResId) {
|
PreviewTheme(themeResId) {
|
||||||
@ -150,6 +155,7 @@ fun RecoveryPasswordCell(seed: String = "", qrBitmap: Bitmap? = null, copySeed:(
|
|||||||
Text(
|
Text(
|
||||||
seed,
|
seed,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
.contentDescription(R.string.AccessibilityId_hide_recovery_password_button)
|
||||||
.padding(vertical = 24.dp)
|
.padding(vertical = 24.dp)
|
||||||
.border(
|
.border(
|
||||||
width = 1.dp,
|
width = 1.dp,
|
||||||
@ -243,6 +249,7 @@ fun HideRecoveryPasswordCell(onHide: () -> Unit = {}) {
|
|||||||
}
|
}
|
||||||
OutlineButton(
|
OutlineButton(
|
||||||
stringResource(R.string.hide),
|
stringResource(R.string.hide),
|
||||||
|
contentDescription = GetString(R.string.AccessibilityId_hide_recovery_password_button),
|
||||||
modifier = Modifier.align(Alignment.CenterVertically),
|
modifier = Modifier.align(Alignment.CenterVertically),
|
||||||
color = colorDestructive
|
color = colorDestructive
|
||||||
) { onHide() }
|
) { onHide() }
|
||||||
|
@ -71,11 +71,12 @@ import kotlin.math.roundToInt
|
|||||||
fun OutlineButton(
|
fun OutlineButton(
|
||||||
text: String,
|
text: String,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
contentDescription: GetString = GetString(text),
|
||||||
color: Color = LocalExtraColors.current.prominentButtonColor,
|
color: Color = LocalExtraColors.current.prominentButtonColor,
|
||||||
onClick: () -> Unit
|
onClick: () -> Unit
|
||||||
) {
|
) {
|
||||||
OutlinedButton(
|
OutlinedButton(
|
||||||
modifier = modifier.contentDescription(GetString(text)),
|
modifier = modifier.contentDescription(contentDescription),
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
border = BorderStroke(1.dp, color),
|
border = BorderStroke(1.dp, color),
|
||||||
shape = RoundedCornerShape(50), // = 50% percent
|
shape = RoundedCornerShape(50), // = 50% percent
|
||||||
@ -99,7 +100,7 @@ fun OutlineButton(
|
|||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
border = BorderStroke(1.dp, color),
|
border = BorderStroke(1.dp, color),
|
||||||
shape = RoundedCornerShape(50), // = 50% percent
|
shape = RoundedCornerShape(percent = 50),
|
||||||
colors = ButtonDefaults.outlinedButtonColors(
|
colors = ButtonDefaults.outlinedButtonColors(
|
||||||
contentColor = color,
|
contentColor = color,
|
||||||
backgroundColor = Color.Unspecified
|
backgroundColor = Color.Unspecified
|
||||||
@ -110,7 +111,11 @@ fun OutlineButton(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun FilledButton(text: String, modifier: Modifier = Modifier, onClick: () -> Unit) {
|
fun FilledButton(
|
||||||
|
text: String,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
|
contentDescription: GetString? = GetString(text),
|
||||||
|
onClick: () -> Unit) {
|
||||||
OutlinedButton(
|
OutlinedButton(
|
||||||
modifier = modifier.size(108.dp, 34.dp),
|
modifier = modifier.size(108.dp, 34.dp),
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
@ -128,12 +133,13 @@ fun FilledButton(text: String, modifier: Modifier = Modifier, onClick: () -> Uni
|
|||||||
fun BorderlessButton(
|
fun BorderlessButton(
|
||||||
text: String,
|
text: String,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
contentDescription: GetString = GetString(text),
|
||||||
fontSize: TextUnit = TextUnit.Unspecified,
|
fontSize: TextUnit = TextUnit.Unspecified,
|
||||||
lineHeight: TextUnit = TextUnit.Unspecified,
|
lineHeight: TextUnit = TextUnit.Unspecified,
|
||||||
onClick: () -> Unit) {
|
onClick: () -> Unit) {
|
||||||
TextButton(
|
TextButton(
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
modifier = modifier,
|
modifier = modifier.contentDescription(contentDescription),
|
||||||
shape = RoundedCornerShape(50), // = 50% percent
|
shape = RoundedCornerShape(50), // = 50% percent
|
||||||
colors = ButtonDefaults.outlinedButtonColors(
|
colors = ButtonDefaults.outlinedButtonColors(
|
||||||
contentColor = MaterialTheme.colors.onBackground,
|
contentColor = MaterialTheme.colors.onBackground,
|
||||||
@ -283,8 +289,10 @@ fun <T> TitledRadioButton(option: RadioOption<T>, onClick: () -> Unit) {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun Modifier.contentDescription(text: GetString?): Modifier {
|
fun Modifier.contentDescription(text: GetString?): Modifier {
|
||||||
|
return text?.let {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
return text?.let { semantics { contentDescription = it(context) } } ?: this
|
semantics { contentDescription = it(context) }
|
||||||
|
} ?: this
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
android:textColor="?android:textColorPrimary"
|
android:textColor="?android:textColorPrimary"
|
||||||
android:fontFamily="@font/space_mono_regular"
|
android:fontFamily="@font/space_mono_regular"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:contentDescription="@string/AccessibilityId_session_id"
|
android:contentDescription="@string/AccessibilityId_account_id"
|
||||||
tools:text="05987d601943c267879be41830888066c6a024cbdc9a548d06813924bf3372ea78" />
|
tools:text="05987d601943c267879be41830888066c6a024cbdc9a548d06813924bf3372ea78" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -379,7 +379,7 @@
|
|||||||
android:paddingHorizontal="@dimen/large_spacing"
|
android:paddingHorizontal="@dimen/large_spacing"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/setting_button_height"
|
android:layout_height="@dimen/setting_button_height"
|
||||||
android:contentDescription="@string/AccessibilityId_recovery_password">
|
android:contentDescription="@string/AccessibilityId_recovery_password_menu_item">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/passwordContainer"
|
android:id="@+id/passwordContainer"
|
||||||
android:layout_width="@dimen/small_profile_picture_size"
|
android:layout_width="@dimen/small_profile_picture_size"
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
<string name="AccessibilityId_link_device">Link Device</string>
|
<string name="AccessibilityId_link_device">Link Device</string>
|
||||||
<!-- Session ID Page-->
|
<!-- Session ID Page-->
|
||||||
<string name="AccessibilityId_session_id">Session ID</string>
|
<string name="AccessibilityId_session_id">Session ID</string>
|
||||||
|
<string name="AccessibilityId_account_id">Account ID</string>
|
||||||
<string name="AccessibilityId_continue">Continue</string>
|
<string name="AccessibilityId_continue">Continue</string>
|
||||||
<!-- Recovery phrase input -->
|
<!-- Recovery phrase input -->
|
||||||
|
|
||||||
@ -132,7 +133,8 @@
|
|||||||
<string name="AccessibilityId_user_settings">User settings</string>
|
<string name="AccessibilityId_user_settings">User settings</string>
|
||||||
<string name="AccessibilityId_username">Username</string>
|
<string name="AccessibilityId_username">Username</string>
|
||||||
<string name="AccessibilityId_privacy">Privacy</string>
|
<string name="AccessibilityId_privacy">Privacy</string>
|
||||||
<string name="AccessibilityId_recovery_password">Show recovery password</string>
|
<string name="AccessibilityId_recovery_password_menu_item">Recovery password</string>
|
||||||
|
<string name="AccessibilityId_recovery_password_menu_item">Recovery password menu item</string>
|
||||||
<string name="AccessibilityId_edit_user_nickname">Edit user nickname</string>
|
<string name="AccessibilityId_edit_user_nickname">Edit user nickname</string>
|
||||||
<string name="AccessibilityId_apply">Apply</string>
|
<string name="AccessibilityId_apply">Apply</string>
|
||||||
<string name="AccessibilityId_cancel">Cancel</string>
|
<string name="AccessibilityId_cancel">Cancel</string>
|
||||||
@ -1058,7 +1060,8 @@
|
|||||||
<string name="auto_deletes_in">Auto-deletes in %1$s</string>
|
<string name="auto_deletes_in">Auto-deletes in %1$s</string>
|
||||||
|
|
||||||
<string name="onboardingBubblePrivacyInYourPocket">Privacy in your pocket.</string>
|
<string name="onboardingBubblePrivacyInYourPocket">Privacy in your pocket.</string>
|
||||||
<string name="onboardingBubbleWelcomeToSession">Welcome to Session</string>
|
<string name="onboardingBubbleWelcomeToSession">Welcome to Session 👋</string>
|
||||||
|
<string name="welcome_to_session">Welcome to Session</string>
|
||||||
<string name="onboardingBubbleSessionIsEngineered">Session is engineered to protect your privacy.</string>
|
<string name="onboardingBubbleSessionIsEngineered">Session is engineered to protect your privacy.</string>
|
||||||
<string name="onboardingBubbleNoPhoneNumber">"You don’t even need a phone number to sign up. "</string>
|
<string name="onboardingBubbleNoPhoneNumber">"You don’t even need a phone number to sign up. "</string>
|
||||||
<string name="onboardingBubbleCreatingAnAccountIsEasy">Creating an account is \ninstant, free, and \nanonymous 👇</string>
|
<string name="onboardingBubbleCreatingAnAccountIsEasy">Creating an account is \ninstant, free, and \nanonymous 👇</string>
|
||||||
@ -1101,4 +1104,16 @@
|
|||||||
<string name="save_your_recovery_password">Save your recovery password</string>
|
<string name="save_your_recovery_password">Save your recovery password</string>
|
||||||
<string name="save_your_recovery_password_to_make_sure_you_don_t_lose_access_to_your_account">Save your recovery password to make sure you don\'t lose access to your account.</string>
|
<string name="save_your_recovery_password_to_make_sure_you_don_t_lose_access_to_your_account">Save your recovery password to make sure you don\'t lose access to your account.</string>
|
||||||
<string name="onboardingAccountCreated">Account Created</string>
|
<string name="onboardingAccountCreated">Account Created</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_reveal_recovery_phrase_button">Reveal recovery phrase button</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_privacy_policy_link">Privacy policy link</string>
|
||||||
|
<string name="AccessibilityId_terms_of_service_link">Terms of service link</string>
|
||||||
|
<string name="AccessibilityId_loading_animation">Loading animation</string>
|
||||||
|
<string name="AccessibilityId_recovery_phrase_input">Recovery phrase input</string>
|
||||||
|
<string name="AccessibilityId_error_message">Error message</string>
|
||||||
|
<string name="AccessibilityId_hide_recovery_password_button">Hide recovery password button</string>
|
||||||
|
<string name="AccessibilityId_confirm_button">Confirm button</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user