diff --git a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinState.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinState.kt
index 914e12ca96..5bb632f04e 100644
--- a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinState.kt
+++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinState.kt
@@ -26,6 +26,7 @@ data class CreatePinState(
val createPinFailure: CreatePinFailure?,
val eventSink: (CreatePinEvents) -> Unit
) {
+ val pinSize = choosePinEntry.size
val activePinEntry = if (isConfirmationStep) {
confirmPinEntry
} else {
diff --git a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinView.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinView.kt
index 915bd2b4b0..dc9956abaa 100644
--- a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinView.kt
+++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/CreatePinView.kt
@@ -22,6 +22,7 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxWidth
@@ -33,13 +34,17 @@ import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Lock
import androidx.compose.material3.ExperimentalMaterial3Api
+import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.TextFieldValue
+import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.unit.dp
+import io.element.android.features.lockscreen.impl.R
import io.element.android.features.lockscreen.impl.create.model.PinDigit
import io.element.android.features.lockscreen.impl.create.model.PinEntry
import io.element.android.features.lockscreen.impl.create.validation.CreatePinFailure
@@ -76,7 +81,7 @@ fun CreatePinView(
modifier = Modifier
.padding(padding)
.consumeWindowInsets(padding),
- header = { CreatePinHeader(state.isConfirmationStep) },
+ header = { CreatePinHeader(state.isConfirmationStep, state.pinSize) },
content = { CreatePinContent(state) }
)
}
@@ -86,14 +91,31 @@ fun CreatePinView(
@Composable
private fun CreatePinHeader(
isValidationStep: Boolean,
+ pinSize: Int,
modifier: Modifier = Modifier,
) {
- IconTitleSubtitleMolecule(
+ Column(
modifier = modifier,
- title = if (isValidationStep) "Confirm PIN" else "Choose 4 digit PIN",
- subTitle = "Lock Element to add extra security to your chats.\n\nChoose something memorable. If you forget this PIN, you will be logged out of the app",
- iconImageVector = Icons.Default.Lock,
- )
+ horizontalAlignment = Alignment.CenterHorizontally,
+ ) {
+ IconTitleSubtitleMolecule(
+ modifier = Modifier.padding(top = 60.dp, bottom = 12.dp),
+ title = if (isValidationStep) {
+ stringResource(id = R.string.screen_app_lock_setup_confirm_pin)
+ } else {
+ stringResource(id = R.string.screen_app_lock_setup_choose_pin, pinSize)
+ },
+ subTitle = stringResource(id = R.string.screen_app_lock_setup_pin_context),
+ iconImageVector = Icons.Filled.Lock,
+ )
+ Text(
+ text = stringResource(id = R.string.screen_app_lock_setup_pin_context_warning),
+ modifier = Modifier.padding(8.dp),
+ textAlign = TextAlign.Center,
+ style = ElementTheme.typography.fontBodyMdRegular,
+ color = MaterialTheme.colorScheme.secondary,
+ )
+ }
}
@Composable
@@ -125,16 +147,16 @@ private fun CreatePinContent(
@Composable
private fun CreatePinFailure.content(): String {
return when (this) {
- CreatePinFailure.PinBlacklisted -> "You cannot choose this as your PIN code for security reasons"
- CreatePinFailure.PinsDontMatch -> "Please enter the same PIN twice"
+ CreatePinFailure.PinBlacklisted -> stringResource(id = R.string.screen_app_lock_setup_pin_blacklisted_dialog_content)
+ CreatePinFailure.PinsDontMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_content)
}
}
@Composable
private fun CreatePinFailure.title(): String {
return when (this) {
- CreatePinFailure.PinBlacklisted -> "Choose a different PIN"
- CreatePinFailure.PinsDontMatch -> "PINs don't match"
+ CreatePinFailure.PinBlacklisted -> stringResource(id = R.string.screen_app_lock_setup_pin_blacklisted_dialog_title)
+ CreatePinFailure.PinsDontMatch -> stringResource(id = R.string.screen_app_lock_setup_pin_mismatch_dialog_title)
}
}
diff --git a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/model/PinEntry.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/model/PinEntry.kt
index 2228110156..a97315f2e8 100644
--- a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/model/PinEntry.kt
+++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/create/model/PinEntry.kt
@@ -32,7 +32,7 @@ data class PinEntry(
}
}
- private val size = digits.size
+ val size = digits.size
/**
* Fill the first digits with the given text.
diff --git a/features/lockscreen/impl/src/main/res/values/localazy.xml b/features/lockscreen/impl/src/main/res/values/localazy.xml
new file mode 100644
index 0000000000..fb5c2be73c
--- /dev/null
+++ b/features/lockscreen/impl/src/main/res/values/localazy.xml
@@ -0,0 +1,24 @@
+
+
+
+ - "Wrong PIN. You have %1$d more chance"
+ - "Wrong PIN. You have %1$d more chances"
+
+ "Forgot PIN?"
+ "Change PIN code"
+ "Allow biometric unlock"
+ "Remove PIN"
+ "Are you sure you want to remove PIN?"
+ "Remove PIN?"
+ "Choose %1$d digit PIN"
+ "Confirm PIN"
+ "You cannot choose this as your PIN code for security reasons"
+ "Choose a different PIN"
+ "Lock Element to add extra security to your chats."
+ "Choose something memorable. If you forget this PIN, you will be logged out of the app."
+ "Please enter the same PIN twice"
+ "PINs don\'t match"
+ "You’ll need to re-login and create a new PIN to proceed"
+ "You are being signed out"
+ "You have 3 attempts to unlock"
+
diff --git a/features/logout/api/src/main/res/values/localazy.xml b/features/logout/api/src/main/res/values/localazy.xml
index 9ea4bb77fd..5a5c9c64ca 100644
--- a/features/logout/api/src/main/res/values/localazy.xml
+++ b/features/logout/api/src/main/res/values/localazy.xml
@@ -1,8 +1,12 @@
+ "Please wait for this to complete before signing out."
+ "Your keys are still being backed up"
"Are you sure you want to sign out?"
"Sign out"
"Signing out…"
+ "You are about to sign out of your last session. If you sign out now, you might lose access to your encrypted messages."
+ "Have you saved your recovery key?"
"Sign out"
"Sign out"
diff --git a/libraries/ui-strings/src/main/res/values/localazy.xml b/libraries/ui-strings/src/main/res/values/localazy.xml
index b9a6460bec..c7bd2f2ca9 100644
--- a/libraries/ui-strings/src/main/res/values/localazy.xml
+++ b/libraries/ui-strings/src/main/res/values/localazy.xml
@@ -5,6 +5,7 @@
"Mentions only"
"Muted"
"Pause"
+ "PIN field"
"Play"
"Poll"
"Ended poll"
@@ -69,6 +70,8 @@
"Share"
"Share link"
"Sign in again"
+ "Sign out"
+ "Sign out anyway"
"Skip"
"Start"
"Start chat"
@@ -84,6 +87,7 @@
"Analytics"
"Audio"
"Bubbles"
+ "Chat backup"
"Copyright"
"Creating room…"
"Left room"
@@ -93,6 +97,7 @@
"Editing"
"* %1$s %2$s"
"Encryption enabled"
+ "Enter your PIN"
"Error"
"Everyone"
"File"
@@ -122,6 +127,7 @@
"Privacy policy"
"Reaction"
"Reactions"
+ "Recovery key"
"Refreshing…"
"Replying to %1$s"
"Report a bug"
@@ -129,9 +135,9 @@
"Rich text editor"
"Room name"
"e.g. your project name"
+ "Screen lock"
"Search for someone"
"Search results"
- "Secure backup"
"Security"
"Sending…"
"Server not supported"
@@ -151,6 +157,7 @@
"Unable to decrypt"
"Invites couldn\'t be sent to one or more users."
"Unable to send invite(s)"
+ "Unlock"
"Unmute"
"Unsupported event"
"Username"
@@ -177,6 +184,7 @@
"%1$s could not access your location. Please try again later."
"%1$s does not have permission to access your location. You can enable access in Settings."
"%1$s does not have permission to access your location. Enable access below."
+ "%1$s does not have permission to access your microphone. Enable access to record a voice message."
"Some messages have not been sent"
"Sorry, an error occurred"
"🔐️ Join me on %1$s"
@@ -185,6 +193,10 @@
"Are you sure that you want to leave this room? This room is not public and you won\'t be able to rejoin without an invite."
"Are you sure that you want to leave the room?"
"%1$s Android"
+
+ - "%1$d digit entered"
+ - "%1$d digits entered"
+
- "%1$d member"
- "%1$d members"
@@ -199,7 +211,26 @@
"This is the beginning of %1$s."
"This is the beginning of this conversation."
"New"
+ "Custom Element Call base URL"
+ "Set a custom base URL for Element Call."
+ "Invalid URL, please make sure you include the protocol (http/https) and the correct address."
"Share analytics data"
+ "Turn off backup"
+ "Turn on backup"
+ "Backup ensures that you don\'t lose your message history. %1$s."
+ "Backup"
+ "Change recovery key"
+ "Confirm recovery key"
+ "Your chat backup is currently out of sync."
+ "Set up recovery"
+ "Get access to your encrypted messages if you lose all your devices or are signed out of %1$s everywhere."
+ "Turn off"
+ "You will lose your encrypted messages if you are signed out of all devices."
+ "Are you sure you want to turn off backup?"
+ "Turning off backup will remove your current encryption key backup and turn off other security features. In this case, you will:"
+ "Not have encrypted message history on new devices"
+ "Lose access to your encrypted messages if you are signed out of %1$s everywhere"
+ "Are you sure you want to turn off backup?"
"Failed selecting media, please try again."
"Failed processing media to upload, please try again."
"Failed uploading media, please try again."
@@ -228,6 +259,27 @@ If you proceed, some of your settings may change."
"system settings"
"System notifications turned off"
"Notifications"
+ "Get a new recovery key if you\'ve lost your existing one. After changing your recovery key, your old one will no longer work."
+ "Generate a new recovery key"
+ "Make sure you can store your recovery key somewhere safe"
+ "Recovery key changed"
+ "Change recovery key?"
+ "Enter your recovery key to confirm access to your chat backup."
+ "Enter the 48 character code."
+ "Enter…"
+ "Recovery key confirmed"
+ "Confirm your recovery key"
+ "Save recovery key"
+ "Write down your recovery key somewhere safe or save it in a password manager."
+ "Tap to copy recovery key"
+ "Save your recovery key"
+ "You will not be able to access your new recovery key after this step."
+ "Have you saved your recovery key?"
+ "Your chat backup is protected by a recovery key. If you need a new recovery key after setup you can recreate by selecting ‘Change recovery key’."
+ "Generate your recovery key"
+ "Make sure you can store your recovery key somewhere safe"
+ "Recovery setup successful"
+ "Set up recovery"
"Check if you want to hide all current and future messages from this user"
"Share location"
"Share my location"
diff --git a/tools/localazy/config.json b/tools/localazy/config.json
index 7e07d269c0..fd35feb36e 100644
--- a/tools/localazy/config.json
+++ b/tools/localazy/config.json
@@ -153,6 +153,12 @@
"includeRegex": [
"call_.*"
]
+ },
+ {
+ "name": ":features:lockscreen:impl",
+ "includeRegex": [
+ "screen_app_lock_.*"
+ ]
}
]
}