mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 03:06:14 +00:00
Update UI and wording of the SignedOut screen
This commit is contained in:
-3
@@ -17,7 +17,6 @@ import dev.zacsweers.metro.Assisted
|
||||
import dev.zacsweers.metro.AssistedFactory
|
||||
import dev.zacsweers.metro.AssistedInject
|
||||
import io.element.android.libraries.architecture.Presenter
|
||||
import io.element.android.libraries.core.meta.BuildMeta
|
||||
import io.element.android.libraries.matrix.api.core.SessionId
|
||||
import io.element.android.libraries.matrix.api.user.MatrixUser
|
||||
import io.element.android.libraries.sessionstorage.api.SessionData
|
||||
@@ -30,7 +29,6 @@ import kotlinx.coroutines.launch
|
||||
class SignedOutPresenter(
|
||||
@Assisted private val sessionId: SessionId,
|
||||
private val sessionStore: SessionStore,
|
||||
private val buildMeta: BuildMeta,
|
||||
) : Presenter<SignedOutState> {
|
||||
@AssistedFactory
|
||||
fun interface Factory {
|
||||
@@ -56,7 +54,6 @@ class SignedOutPresenter(
|
||||
}
|
||||
|
||||
return SignedOutState(
|
||||
appName = buildMeta.applicationName,
|
||||
signedOutMatrixUser = signedOutSession,
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
|
||||
-1
@@ -11,7 +11,6 @@ package io.element.android.features.signedout.impl
|
||||
import io.element.android.libraries.matrix.api.user.MatrixUser
|
||||
|
||||
data class SignedOutState(
|
||||
val appName: String,
|
||||
val signedOutMatrixUser: MatrixUser,
|
||||
val eventSink: (SignedOutEvent) -> Unit,
|
||||
)
|
||||
|
||||
-1
@@ -24,7 +24,6 @@ internal fun aSignedOutState(
|
||||
signedOutSession: MatrixUser = aMatrixUser(id = "@alice:server.org", displayName = "Alice"),
|
||||
eventSink: (SignedOutEvent) -> Unit = {},
|
||||
) = SignedOutState(
|
||||
appName = "AppName",
|
||||
signedOutMatrixUser = signedOutSession,
|
||||
eventSink = eventSink,
|
||||
)
|
||||
|
||||
+5
-5
@@ -41,7 +41,7 @@ import io.element.android.libraries.ui.strings.CommonStrings
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
|
||||
/**
|
||||
* Ref: https://www.figma.com/design/kEAcfun9iSpszeUDvdKZ6b/ER-351--Multi-account-in-EX?node-id=795-6095
|
||||
* Ref: https://www.figma.com/design/kEAcfun9iSpszeUDvdKZ6b/ER-351--Multi-account-in-EX?node-id=856-6104
|
||||
*/
|
||||
@Composable
|
||||
fun SignedOutView(
|
||||
@@ -69,9 +69,9 @@ private fun SignedOutHeader(state: SignedOutState) {
|
||||
IconTitleSubtitleMolecule(
|
||||
modifier = Modifier.padding(top = 60.dp, bottom = 12.dp),
|
||||
title = stringResource(id = R.string.screen_signed_out_title),
|
||||
subTitle = stringResource(id = R.string.screen_signed_out_subtitle, state.appName),
|
||||
subTitle = stringResource(id = R.string.screen_signed_out_subtitle_v2),
|
||||
iconStyle = BigIcon.Style.Default(
|
||||
CompoundIcons.UserProfileSolid(),
|
||||
CompoundIcons.Devices(),
|
||||
usePrimaryTint = true,
|
||||
),
|
||||
)
|
||||
@@ -104,11 +104,11 @@ private fun SignedOutContent(
|
||||
items = persistentListOf(
|
||||
VisualListItemData(
|
||||
message = stringResource(id = R.string.screen_signed_out_reason_1),
|
||||
iconVector = CompoundIcons.Lock(),
|
||||
iconVector = CompoundIcons.UserProfile(),
|
||||
),
|
||||
VisualListItemData(
|
||||
message = stringResource(id = R.string.screen_signed_out_reason_2),
|
||||
iconVector = CompoundIcons.Devices(),
|
||||
iconVector = CompoundIcons.Lock(),
|
||||
),
|
||||
VisualListItemData(
|
||||
message = stringResource(id = R.string.screen_signed_out_reason_3),
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="screen_signed_out_reason_1">"You’ve changed your password on another session"</string>
|
||||
<string name="screen_signed_out_reason_2">"You have deleted the session from another session"</string>
|
||||
<string name="screen_signed_out_reason_3">"Your server’s administrator has invalidated your access"</string>
|
||||
<string name="screen_signed_out_reason_1">"You removed this device from your account"</string>
|
||||
<string name="screen_signed_out_reason_2">"You’ve changed your password on another device"</string>
|
||||
<string name="screen_signed_out_reason_3">"Your server\'s session expired or the administrator has blocked your access"</string>
|
||||
<string name="screen_signed_out_subtitle">"You might have been signed out for one of the reasons listed below. Please sign in again to continue using %s."</string>
|
||||
<string name="screen_signed_out_title">"You’re signed out"</string>
|
||||
<string name="screen_signed_out_subtitle_v2">"This device was removed for one of the reasons listed below. Please sign in again to connect this device to your account."</string>
|
||||
<string name="screen_signed_out_title">"Device removed"</string>
|
||||
</resources>
|
||||
|
||||
-4
@@ -14,9 +14,7 @@ import app.cash.turbine.test
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import io.element.android.libraries.matrix.api.core.SessionId
|
||||
import io.element.android.libraries.matrix.api.user.MatrixUser
|
||||
import io.element.android.libraries.matrix.test.AN_APPLICATION_NAME
|
||||
import io.element.android.libraries.matrix.test.A_SESSION_ID
|
||||
import io.element.android.libraries.matrix.test.core.aBuildMeta
|
||||
import io.element.android.libraries.sessionstorage.api.SessionStore
|
||||
import io.element.android.libraries.sessionstorage.test.InMemorySessionStore
|
||||
import io.element.android.libraries.sessionstorage.test.aSessionData
|
||||
@@ -47,7 +45,6 @@ class SignedOutPresenterTest {
|
||||
presenter.present()
|
||||
}.test {
|
||||
val initialState = awaitItem()
|
||||
assertThat(initialState.appName).isEqualTo(AN_APPLICATION_NAME)
|
||||
assertThat(initialState.signedOutMatrixUser).isEqualTo(MatrixUser(userId = A_SESSION_ID))
|
||||
assertThat(awaitItem().signedOutMatrixUser).isEqualTo(
|
||||
MatrixUser(
|
||||
@@ -96,6 +93,5 @@ internal fun createSignedOutPresenter(
|
||||
return SignedOutPresenter(
|
||||
sessionId = sessionId,
|
||||
sessionStore = sessionStore,
|
||||
buildMeta = aBuildMeta(applicationName = AN_APPLICATION_NAME),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user