Repository: element-hq/element-x-android (language: kotlin)

Issue:
[Task] Show a hint that QR code login is only available when the account provider supports.
Please see and discuss the details in the meta issue.



Discussion hints:

Pull request: QrCode intro screen: add subtitle and fix button wording #3632
<!-- Please read [CONTRIBUTING.md](https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md) before submitting your pull request -->
 
## Content

<!-- Describe shortly what has been changed -->
Add subtitle and fix button wording.

## Motivation and context

<!-- Provide link to the corresponding issue if applicable or explain the context -->
Closes #3632 

## Screenshots / GIFs

<!--
We have screenshot tests in the project, so attaching screenshots to a PR is not mandatory, as far as there
is a Composable Preview covering the changes. In this case, the change will appear in the file diff.
Note that all the UI composables should be covered by a Composable Preview.

Providing a video of the change is still very useful for the reviewer and for the history of the project.

You can use a table like this to show screenshots comparison.
Uncomment this markdown table below and edit the last line `|||`:
|copy screenshot of before here|copy screenshot of after here|

|Before|After|
|-|-|
|||
 -->
See recorded one

## Tests

<!-- Explain how you tested your development -->

- Check that screenshot is updated and match the design at https://www.figma.com/design/pDlJZGBsri47FNTXMnEdXB/Compound-Android-Templates?node-id=41-10347&t=sOWqqbMWIr3wJpMn-4

## Tested devices

- [ ] Physical
- [x] Emulator
- OS version(s):

## Checklist

<!-- Depending on the Pull Request content, it can be acceptable if some of the following checkboxes stay unchecked. -->

- [ ] Changes have been tested on an Android device or Android emulator with API 23
- [ ] UI change has been tested on both light and dark themes
- [ ] Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
- [ ] Pull request is based on the develop branch
- [ ] Pull request title will be used in the release note, it clearly define what will change for the user
- [ ] Pull request includes screenshots or videos if containing UI changes
- [ ] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
- [ ] You've made a self review of your PR


Test command: ./gradlew :features:login:impl:testDebugUnitTest --tests "io.element.android.features.login.impl.screens.qrcode.intro.QrCodeIntroViewTest"

Fix patch:
diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/qrcode/intro/QrCodeIntroView.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/qrcode/intro/QrCodeIntroView.kt
index a128884e408..0a2892d661a 100644
--- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/qrcode/intro/QrCodeIntroView.kt
+++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/qrcode/intro/QrCodeIntroView.kt
@@ -30,7 +30,6 @@ import io.element.android.libraries.designsystem.theme.components.Button
 import io.element.android.libraries.designsystem.theme.components.Icon
 import io.element.android.libraries.designsystem.utils.annotatedTextWithBold
 import io.element.android.libraries.permissions.api.PermissionsView
-import io.element.android.libraries.ui.strings.CommonStrings
 import kotlinx.collections.immutable.persistentListOf
 
 @Composable
@@ -51,6 +50,7 @@ fun QrCodeIntroView(
         onBackClick = onBackClick,
         iconStyle = BigIcon.Style.Default(CompoundIcons.Computer()),
         title = stringResource(id = R.string.screen_qr_code_login_initial_state_title, state.desktopAppName),
+        subTitle = stringResource(id = R.string.screen_qr_code_login_initial_state_subtitle),
         content = { Content(state = state) },
         buttons = { Buttons(state = state) }
     )
@@ -87,7 +87,7 @@ private fun ColumnScope.Buttons(
     state: QrCodeIntroState,
 ) {
     Button(
-        text = stringResource(id = CommonStrings.action_continue),
+        text = stringResource(id = R.string.screen_qr_code_login_initial_state_button_title),
         modifier = Modifier.fillMaxWidth(),
         onClick = {
             state.eventSink.invoke(QrCodeIntroEvents.Continue)
diff --git a/features/login/impl/src/main/res/values/localazy.xml b/features/login/impl/src/main/res/values/localazy.xml
index a46b083d636..be01bd56d5e 100644
--- a/features/login/impl/src/main/res/values/localazy.xml
+++ b/features/login/impl/src/main/res/values/localazy.xml
@@ -60,6 +60,7 @@ Try signing in manually, or scan the QR code with another device."</string>
   <string name="screen_qr_code_login_initial_state_item_3">"Select %1$s"</string>
   <string name="screen_qr_code_login_initial_state_item_3_action">"“Link new device”"</string>
   <string name="screen_qr_code_login_initial_state_item_4">"Scan the QR code with this device"</string>
+  <string name="screen_qr_code_login_initial_state_subtitle">"Only available if your account provider supports it."</string>
   <string name="screen_qr_code_login_initial_state_title">"Open %1$s on another device to get the QR code"</string>
   <string name="screen_qr_code_login_invalid_scan_state_description">"Use the QR code shown on the other device."</string>
   <string name="screen_qr_code_login_invalid_scan_state_retry_button">"Try again"</string>


Test patch:
diff --git a/features/login/impl/src/test/kotlin/io/element/android/features/login/impl/screens/qrcode/intro/QrCodeIntroViewTest.kt b/features/login/impl/src/test/kotlin/io/element/android/features/login/impl/screens/qrcode/intro/QrCodeIntroViewTest.kt
index 11762d502bc..2655624c0e8 100644
--- a/features/login/impl/src/test/kotlin/io/element/android/features/login/impl/screens/qrcode/intro/QrCodeIntroViewTest.kt
+++ b/features/login/impl/src/test/kotlin/io/element/android/features/login/impl/screens/qrcode/intro/QrCodeIntroViewTest.kt
@@ -11,7 +11,7 @@ import androidx.activity.ComponentActivity
 import androidx.compose.ui.test.junit4.AndroidComposeTestRule
 import androidx.compose.ui.test.junit4.createAndroidComposeRule
 import androidx.test.ext.junit.runners.AndroidJUnit4
-import io.element.android.libraries.ui.strings.CommonStrings
+import io.element.android.features.login.impl.R
 import io.element.android.tests.testutils.EnsureNeverCalled
 import io.element.android.tests.testutils.EventsRecorder
 import io.element.android.tests.testutils.clickOn
@@ -61,12 +61,12 @@ class QrCodeIntroViewTest {
     }
 
     @Test
-    fun `on continue button clicked - emits the Continue event`() {
+    fun `on submit button clicked - emits the Continue event`() {
         val eventRecorder = EventsRecorder<QrCodeIntroEvents>()
         rule.setQrCodeIntroView(
             state = aQrCodeIntroState(eventSink = eventRecorder),
         )
-        rule.clickOn(CommonStrings.action_continue)
+        rule.clickOn(R.string.screen_qr_code_login_initial_state_button_title)
         eventRecorder.assertSingle(QrCodeIntroEvents.Continue)
     }
 
diff --git a/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Day_0_en.png b/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Day_0_en.png
index 1517bc5b180..21ab27c511e 100644
--- a/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Day_0_en.png
+++ b/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Day_0_en.png
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:c20777e79d65269c7e330c56bdd591ad771c97fb0fa8b74e18e45ffa8aa3525b
-size 42436
+oid sha256:021982f9575de9946f905c348f3be4cd12e58550fc2ba6f7e86d44f72c35a254
+size 50081
diff --git a/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Day_1_en.png b/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Day_1_en.png
index 5873bdab62e..074ce8fb9ee 100644
--- a/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Day_1_en.png
+++ b/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Day_1_en.png
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:b1a76c6c3e57652e16c3e5fa9168ea24cc16e55806ba972228397146fe0fdbb3
-size 42356
+oid sha256:2f30cfd5af7247c188851213b122e78e51bf38f0b8c94870776c081b4d69f9e0
+size 48509
diff --git a/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Night_0_en.png b/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Night_0_en.png
index bdd1dcc323d..32c359384b5 100644
--- a/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Night_0_en.png
+++ b/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Night_0_en.png
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:fab7adfa1fedf07847a39f374b1a0fb8c41b0a2d2862b9dc35cd26f1a30c8c32
-size 41045
+oid sha256:4b16db86e6aa5ba64d4f4539120d28588ce9e5daf3aef30b275d47f00ec55776
+size 48634
diff --git a/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Night_1_en.png b/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Night_1_en.png
index f8d32fb22a7..de297410b0e 100644
--- a/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Night_1_en.png
+++ b/tests/uitests/src/test/snapshots/images/features.login.impl.screens.qrcode.intro_QrCodeIntroView_Night_1_en.png
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:b7bc76f3dc71082e683707659aad62e63965e0ceee5845d1a540c976513187ae
-size 40079
+oid sha256:ef3187936592091492d4d4d349954000722a8e764d9baa35ea987b49d5bd4b8a
+size 46145