[Strings] Use strings from localazy.
This commit is contained in:
parent
0af5ee0741
commit
998178b70f
33 changed files with 216 additions and 182 deletions
|
|
@ -29,6 +29,7 @@ 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.sp
|
||||
import io.element.android.features.createroom.impl.R
|
||||
import io.element.android.features.selectusers.api.SelectUsersView
|
||||
import io.element.android.libraries.designsystem.components.button.BackButton
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||
|
|
@ -85,7 +86,7 @@ fun AddPeopleViewTopBar(
|
|||
modifier = modifier,
|
||||
title = {
|
||||
Text(
|
||||
text = stringResource(id = StringR.string.add_people),
|
||||
text = stringResource(id = R.string.screen_create_room_add_people_title),
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ 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.sp
|
||||
import io.element.android.features.createroom.impl.R
|
||||
import io.element.android.features.selectusers.api.SelectUsersView
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
|
|
@ -94,7 +95,7 @@ fun CreateRoomRootViewTopBar(
|
|||
modifier = modifier,
|
||||
title = {
|
||||
Text(
|
||||
text = stringResource(id = StringR.string.start_chat),
|
||||
text = stringResource(id = StringR.string.action_start_chat),
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
)
|
||||
|
|
@ -116,12 +117,12 @@ fun CreateRoomActionButtonsList(
|
|||
Column(modifier = modifier) {
|
||||
CreateRoomActionButton(
|
||||
iconRes = DrawableR.drawable.ic_groups,
|
||||
text = stringResource(id = StringR.string.new_room),
|
||||
text = stringResource(id = R.string.screen_create_room_action_create_room),
|
||||
onClick = onNewRoomClicked,
|
||||
)
|
||||
CreateRoomActionButton(
|
||||
iconRes = DrawableR.drawable.ic_share,
|
||||
text = stringResource(id = StringR.string.invite_people_menu),
|
||||
text = stringResource(id = R.string.screen_create_room_action_invite_people),
|
||||
onClick = onInvitePeopleClicked,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ package io.element.android.features.login.impl.changeserver
|
|||
import androidx.annotation.StringRes
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import io.element.android.features.login.impl.R
|
||||
import io.element.android.libraries.matrix.api.auth.AuthenticationException
|
||||
import io.element.android.libraries.ui.strings.R
|
||||
|
||||
sealed class ChangeServerError : Throwable() {
|
||||
data class InlineErrorMessage(@StringRes val messageId: Int) : ChangeServerError() {
|
||||
|
|
@ -32,7 +32,7 @@ sealed class ChangeServerError : Throwable() {
|
|||
companion object {
|
||||
fun from(error: Throwable): ChangeServerError = when (error) {
|
||||
is AuthenticationException.SlidingSyncNotAvailable -> SlidingSyncAlert
|
||||
else -> InlineErrorMessage(R.string.server_selection_invalid_homeserver_error)
|
||||
else -> InlineErrorMessage(R.string.screen_change_server_error_invalid_homeserver)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
package io.element.android.features.login.impl.changeserver
|
||||
|
||||
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
||||
import io.element.android.libraries.ui.strings.R
|
||||
import io.element.android.features.login.impl.R
|
||||
import io.element.android.libraries.architecture.Async
|
||||
|
||||
open class ChangeServerStateProvider : PreviewParameterProvider<ChangeServerState> {
|
||||
|
|
@ -28,7 +28,7 @@ open class ChangeServerStateProvider : PreviewParameterProvider<ChangeServerStat
|
|||
aChangeServerState().copy(homeserver = "matrix.org", changeServerAction = Async.Loading()),
|
||||
aChangeServerState().copy(
|
||||
homeserver = "invalid.org",
|
||||
changeServerAction = Async.Failure(ChangeServerError.InlineErrorMessage(R.string.server_selection_invalid_homeserver_error))
|
||||
changeServerAction = Async.Failure(ChangeServerError.InlineErrorMessage(R.string.screen_change_server_error_invalid_homeserver))
|
||||
),
|
||||
aChangeServerState().copy(homeserver = "invalid.org", changeServerAction = Async.Failure(ChangeServerError.SlidingSyncAlert)),
|
||||
aChangeServerState().copy(homeserver = "matrix.org", changeServerAction = Async.Success(Unit)),
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ fun ChangeServerView(
|
|||
}
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Text(
|
||||
text = stringResource(id = StringR.string.ftue_auth_choose_server_title),
|
||||
text = stringResource(id = R.string.screen_change_server_title),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.align(Alignment.CenterHorizontally),
|
||||
|
|
@ -162,7 +162,7 @@ fun ChangeServerView(
|
|||
)
|
||||
Spacer(Modifier.height(8.dp))
|
||||
Text(
|
||||
text = stringResource(id = StringR.string.ex_choose_server_subtitle),
|
||||
text = stringResource(id = R.string.screen_change_server_subtitle),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp),
|
||||
|
|
@ -172,7 +172,7 @@ fun ChangeServerView(
|
|||
)
|
||||
Spacer(Modifier.height(24.dp))
|
||||
Text(
|
||||
stringResource(StringR.string.hs_url),
|
||||
stringResource(R.string.screen_change_server_form_header),
|
||||
style = ElementTextStyles.Regular.formHeader,
|
||||
modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||
)
|
||||
|
|
@ -202,7 +202,7 @@ fun ChangeServerView(
|
|||
IconButton(onClick = {
|
||||
eventSink(ChangeServerEvents.SetServer(""))
|
||||
}, enabled = interactionEnabled) {
|
||||
Icon(imageVector = Icons.Filled.Close, contentDescription = stringResource(StringR.string.a11y_clear))
|
||||
Icon(imageVector = Icons.Filled.Close, contentDescription = stringResource(StringR.string.action_clear))
|
||||
}
|
||||
}
|
||||
} else null,
|
||||
|
|
@ -211,14 +211,13 @@ fun ChangeServerView(
|
|||
if (invalidHomeserverError != null) {
|
||||
Text(invalidHomeserverError.message(), color = MaterialTheme.colorScheme.error)
|
||||
} else {
|
||||
val footerMessage = stringResource(StringR.string.server_selection_server_footer)
|
||||
val footerMessage = stringResource(R.string.screen_change_server_form_notice, "")
|
||||
val footerAction = stringResource(StringR.string.action_learn_more)
|
||||
val footerText = buildAnnotatedString {
|
||||
val defaultColor = MaterialTheme.colorScheme.tertiary
|
||||
withStyle(ParagraphStyle(textAlign = TextAlign.Start)) {
|
||||
withStyle(SpanStyle(color = defaultColor)) {
|
||||
append(footerMessage)
|
||||
append(" ")
|
||||
}
|
||||
val start = length
|
||||
withStyle(SpanStyle(color = LinkColor)) {
|
||||
|
|
@ -252,7 +251,7 @@ fun ChangeServerView(
|
|||
.fillMaxWidth()
|
||||
.testTag(TestTags.changeServerContinue)
|
||||
) {
|
||||
Text(text = stringResource(id = StringR.string.login_continue), style = ElementTextStyles.Button)
|
||||
Text(text = stringResource(id = R.string.screen_change_server_submit), style = ElementTextStyles.Button)
|
||||
}
|
||||
if (state.changeServerAction is Async.Success) {
|
||||
onChangeServerSuccess()
|
||||
|
|
@ -284,8 +283,8 @@ internal fun SlidingSyncNotSupportedDialog(onLearnMoreClicked: () -> Unit, onDis
|
|||
onSubmitClicked = onLearnMoreClicked,
|
||||
onCancelClicked = onDismiss,
|
||||
emphasizeSubmitButton = true,
|
||||
title = stringResource(StringR.string.server_selection_sliding_sync_alert_title),
|
||||
content = stringResource(StringR.string.server_selection_sliding_sync_alert_message),
|
||||
title = stringResource(StringR.string.dialog_title_error),
|
||||
content = stringResource(R.string.screen_change_server_error_no_sliding_sync_message),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package io.element.android.features.login.impl.error
|
||||
|
||||
import io.element.android.features.login.impl.R
|
||||
import io.element.android.libraries.matrix.api.auth.AuthErrorCode
|
||||
import io.element.android.libraries.matrix.api.auth.AuthenticationException
|
||||
import io.element.android.libraries.matrix.api.auth.errorCode
|
||||
|
|
@ -24,10 +25,10 @@ import io.element.android.libraries.ui.strings.R.string as StringR
|
|||
fun loginError(
|
||||
throwable: Throwable
|
||||
): Int {
|
||||
val authException = throwable as? AuthenticationException ?: return StringR.unknown_error
|
||||
val authException = throwable as? AuthenticationException ?: return StringR.error_unknown
|
||||
return when (authException.errorCode) {
|
||||
AuthErrorCode.FORBIDDEN -> StringR.auth_invalid_login_param
|
||||
AuthErrorCode.USER_DEACTIVATED -> StringR.auth_invalid_login_deactivated_account
|
||||
AuthErrorCode.UNKNOWN -> StringR.unknown_error
|
||||
AuthErrorCode.FORBIDDEN -> R.string.screen_login_error_invalid_credentials
|
||||
AuthErrorCode.USER_DEACTIVATED -> R.string.screen_login_error_deactivated_account
|
||||
AuthErrorCode.UNKNOWN -> StringR.error_unknown
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ import androidx.compose.ui.text.style.TextAlign
|
|||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||
import androidx.compose.ui.unit.dp
|
||||
import io.element.android.features.login.impl.R
|
||||
import io.element.android.features.login.impl.error.loginError
|
||||
import io.element.android.libraries.designsystem.ElementTextStyles
|
||||
import io.element.android.libraries.designsystem.components.dialogs.ErrorDialog
|
||||
|
|
@ -121,7 +122,7 @@ fun LoginRootView(
|
|||
Spacer(Modifier.height(16.dp))
|
||||
// Title
|
||||
Text(
|
||||
text = stringResource(id = StringR.string.ftue_auth_welcome_back_title),
|
||||
text = stringResource(id = R.string.screen_login_title),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth(),
|
||||
style = ElementTextStyles.Bold.title1,
|
||||
|
|
@ -172,7 +173,7 @@ internal fun ChangeServerSection(
|
|||
Column(modifier) {
|
||||
Text(
|
||||
modifier = Modifier.padding(start = 16.dp, bottom = 8.dp),
|
||||
text = stringResource(id = StringR.string.ftue_auth_sign_in_choose_server_header),
|
||||
text = stringResource(id = R.string.screen_login_server_header),
|
||||
style = ElementTextStyles.Regular.formHeader,
|
||||
)
|
||||
Row(
|
||||
|
|
@ -233,7 +234,7 @@ internal fun LoginForm(
|
|||
|
||||
Column(modifier) {
|
||||
Text(
|
||||
text = stringResource(StringR.string.login_form_title),
|
||||
text = stringResource(R.string.screen_login_form_header),
|
||||
modifier = Modifier.padding(start = 16.dp),
|
||||
style = ElementTextStyles.Regular.formHeader
|
||||
)
|
||||
|
|
@ -247,7 +248,7 @@ internal fun LoginForm(
|
|||
.onTabOrEnterKeyFocusNext(focusManager)
|
||||
.testTag(TestTags.loginEmailUsername),
|
||||
label = {
|
||||
Text(text = stringResource(StringR.string.ex_login_username_hint))
|
||||
Text(text = stringResource(R.string.screen_login_username_hint))
|
||||
},
|
||||
onValueChange = {
|
||||
loginFieldState = it
|
||||
|
|
@ -267,7 +268,7 @@ internal fun LoginForm(
|
|||
IconButton(onClick = {
|
||||
loginFieldState = ""
|
||||
}) {
|
||||
Icon(imageVector = Icons.Filled.Close, contentDescription = stringResource(StringR.string.a11y_clear))
|
||||
Icon(imageVector = Icons.Filled.Close, contentDescription = stringResource(StringR.string.action_clear))
|
||||
}
|
||||
}
|
||||
} else null,
|
||||
|
|
@ -291,14 +292,14 @@ internal fun LoginForm(
|
|||
eventSink(LoginRootEvents.SetPassword(it))
|
||||
},
|
||||
label = {
|
||||
Text(text = stringResource(StringR.string.login_signup_password_hint))
|
||||
Text(text = stringResource(R.string.screen_login_password_hint))
|
||||
},
|
||||
visualTransformation = if (passwordVisible) VisualTransformation.None else PasswordVisualTransformation(),
|
||||
trailingIcon = {
|
||||
val image =
|
||||
if (passwordVisible) Icons.Filled.Visibility else Icons.Filled.VisibilityOff
|
||||
val description =
|
||||
if (passwordVisible) stringResource(StringR.string.login_hide_password) else stringResource(StringR.string.login_show_password)
|
||||
if (passwordVisible) stringResource(StringR.string.a11y_hide_password) else stringResource(StringR.string.a11y_show_password)
|
||||
|
||||
IconButton(onClick = { passwordVisible = !passwordVisible }) {
|
||||
Icon(imageVector = image, description)
|
||||
|
|
@ -324,7 +325,7 @@ internal fun LoginForm(
|
|||
.fillMaxWidth()
|
||||
.testTag(TestTags.loginContinue)
|
||||
) {
|
||||
Text(text = stringResource(StringR.string.login_continue), style = ElementTextStyles.Button)
|
||||
Text(text = stringResource(R.string.screen_login_submit), style = ElementTextStyles.Button)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,9 +17,10 @@
|
|||
package io.element.android.features.login.impl.error
|
||||
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import io.element.android.features.login.impl.R
|
||||
import io.element.android.libraries.matrix.api.auth.AuthenticationException
|
||||
import io.element.android.libraries.ui.strings.R
|
||||
import org.junit.Test
|
||||
import io.element.android.libraries.ui.strings.R as StringR
|
||||
|
||||
class ErrorFormatterTests {
|
||||
|
||||
|
|
@ -27,31 +28,31 @@ class ErrorFormatterTests {
|
|||
@Test
|
||||
fun `loginError - invalid unknown error returns unknown error message`() {
|
||||
val error = Throwable("Some unknown error")
|
||||
assertThat(loginError(error)).isEqualTo(R.string.unknown_error)
|
||||
assertThat(loginError(error)).isEqualTo(StringR.string.error_unknown)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `loginError - invalid auth error returns unknown error message`() {
|
||||
val error = AuthenticationException.SlidingSyncNotAvailable("Some message. Also contains M_FORBIDDEN, but won't be parsed")
|
||||
assertThat(loginError(error)).isEqualTo(R.string.unknown_error)
|
||||
assertThat(loginError(error)).isEqualTo(StringR.string.error_unknown)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `loginError - unknown error returns unknown error message`() {
|
||||
val error = AuthenticationException.Generic("M_UNKNOWN")
|
||||
assertThat(loginError(error)).isEqualTo(R.string.unknown_error)
|
||||
assertThat(loginError(error)).isEqualTo(StringR.string.error_unknown)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `loginError - forbidden error returns incorrect credentials message`() {
|
||||
val error = AuthenticationException.Generic("M_FORBIDDEN")
|
||||
assertThat(loginError(error)).isEqualTo(R.string.auth_invalid_login_param)
|
||||
assertThat(loginError(error)).isEqualTo(R.string.screen_login_error_invalid_credentials)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `loginError - user_deactivated error returns deactivated account message`() {
|
||||
val error = AuthenticationException.Generic("M_USER_DEACTIVATED")
|
||||
assertThat(loginError(error)).isEqualTo(R.string.auth_invalid_login_deactivated_account)
|
||||
assertThat(loginError(error)).isEqualTo(R.string.screen_login_error_deactivated_account)
|
||||
}
|
||||
|
||||
// endregion loginError
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ fun LogoutPreferenceView(
|
|||
// Log out confirmation dialog
|
||||
if (openDialog.value) {
|
||||
ConfirmationDialog(
|
||||
title = stringResource(id = StringR.string.action_sign_out),
|
||||
content = stringResource(id = StringR.string.action_sign_out_confirmation_simple),
|
||||
submitText = stringResource(id = StringR.string.action_sign_out),
|
||||
title = stringResource(id = R.string.screen_signout_confirmation_dialog_title),
|
||||
content = stringResource(id = R.string.screen_signout_confirmation_dialog_content),
|
||||
submitText = stringResource(id = R.string.screen_signout_confirmation_dialog_submit),
|
||||
onCancelClicked = {
|
||||
openDialog.value = false
|
||||
},
|
||||
|
|
@ -73,7 +73,7 @@ fun LogoutPreferenceView(
|
|||
}
|
||||
|
||||
if (state.logoutAction is Async.Loading) {
|
||||
ProgressDialog(text = "Login out...")
|
||||
ProgressDialog(text = stringResource(id = R.string.screen_signout_in_progress_dialog_content))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -81,9 +81,9 @@ fun LogoutPreferenceView(
|
|||
fun LogoutPreferenceContent(
|
||||
onClick: () -> Unit = {},
|
||||
) {
|
||||
PreferenceCategory(title = stringResource(id = StringR.string.settings_general_title)) {
|
||||
PreferenceCategory(title = stringResource(id = StringR.string.settings_title_general)) {
|
||||
PreferenceText(
|
||||
title = stringResource(id = StringR.string.action_sign_out),
|
||||
title = stringResource(id = R.string.screen_signout_preference_item),
|
||||
icon = Icons.Default.Logout,
|
||||
onClick = onClick
|
||||
)
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ dependencies {
|
|||
implementation(projects.libraries.matrixui)
|
||||
implementation(projects.libraries.designsystem)
|
||||
implementation(projects.libraries.textcomposer)
|
||||
implementation(projects.libraries.uiStrings)
|
||||
implementation(projects.libraries.dateformatter.api)
|
||||
implementation(libs.coil.compose)
|
||||
implementation(libs.datetime)
|
||||
|
|
|
|||
|
|
@ -20,20 +20,23 @@ import androidx.compose.material.icons.Icons
|
|||
import androidx.compose.material.icons.filled.Warning
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import io.element.android.features.messages.impl.timeline.model.event.TimelineItemEncryptedContent
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
import io.element.android.libraries.matrix.api.timeline.item.event.UnableToDecryptContent
|
||||
|
||||
import io.element.android.libraries.ui.strings.R as StringR
|
||||
|
||||
@Composable
|
||||
fun TimelineItemEncryptedView(
|
||||
content: TimelineItemEncryptedContent,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
TimelineItemInformativeView(
|
||||
text = "Decryption error",
|
||||
iconDescription = "Warning",
|
||||
text = stringResource(id = StringR.string.common_decryption_error),
|
||||
iconDescription = stringResource(id = StringR.string.dialog_title_warning),
|
||||
icon = Icons.Default.Warning,
|
||||
modifier = modifier
|
||||
)
|
||||
|
|
|
|||
|
|
@ -20,19 +20,22 @@ import androidx.compose.material.icons.Icons
|
|||
import androidx.compose.material.icons.filled.Delete
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import io.element.android.features.messages.impl.timeline.model.event.TimelineItemRedactedContent
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
|
||||
import io.element.android.libraries.ui.strings.R as StringR
|
||||
|
||||
@Composable
|
||||
fun TimelineItemRedactedView(
|
||||
content: TimelineItemRedactedContent,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
TimelineItemInformativeView(
|
||||
text = "This message has been deleted",
|
||||
iconDescription = "Delete",
|
||||
text = stringResource(id = StringR.string.common_message_removed),
|
||||
iconDescription = stringResource(id = StringR.string.common_message_removed),
|
||||
icon = Icons.Default.Delete,
|
||||
modifier = modifier
|
||||
)
|
||||
|
|
|
|||
|
|
@ -20,19 +20,22 @@ import androidx.compose.material.icons.Icons
|
|||
import androidx.compose.material.icons.filled.Info
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import io.element.android.features.messages.impl.timeline.model.event.TimelineItemUnknownContent
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
|
||||
import io.element.android.libraries.ui.strings.R as StringR
|
||||
|
||||
@Composable
|
||||
fun TimelineItemUnknownView(
|
||||
content: TimelineItemUnknownContent,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
TimelineItemInformativeView(
|
||||
text = "Event not handled by EAX",
|
||||
iconDescription = "Info",
|
||||
text = stringResource(id = StringR.string.common_unsupported_event),
|
||||
iconDescription = stringResource(id = StringR.string.dialog_title_warning),
|
||||
icon = Icons.Default.Info,
|
||||
modifier = modifier
|
||||
)
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ fun OnBoardingScreen(
|
|||
.testTag(TestTags.onBoardingSignIn)
|
||||
.padding(top = 16.dp)
|
||||
) {
|
||||
Text(text = stringResource(id = StringR.string.login_splash_submit))
|
||||
Text(text = stringResource(id = R.string.login_splash_submit))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
package io.element.android.features.onboarding.impl
|
||||
|
||||
import androidx.annotation.DrawableRes
|
||||
import io.element.android.libraries.ui.strings.R as StringR
|
||||
|
||||
class SplashCarouselDataFactory {
|
||||
fun create(): SplashCarouselData {
|
||||
|
|
@ -32,8 +31,8 @@ class SplashCarouselDataFactory {
|
|||
return SplashCarouselData(
|
||||
listOf(
|
||||
SplashCarouselData.Item(
|
||||
StringR.string.ftue_auth_carousel_secure_title,
|
||||
StringR.string.ftue_auth_carousel_secure_body,
|
||||
R.string.ftue_auth_carousel_secure_title,
|
||||
R.string.ftue_auth_carousel_secure_body,
|
||||
hero(
|
||||
R.drawable.ic_splash_conversations,
|
||||
R.drawable.ic_splash_conversations_dark
|
||||
|
|
@ -41,20 +40,20 @@ class SplashCarouselDataFactory {
|
|||
background(R.drawable.bg_carousel_page_1)
|
||||
),
|
||||
SplashCarouselData.Item(
|
||||
StringR.string.ftue_auth_carousel_control_title,
|
||||
StringR.string.ftue_auth_carousel_control_body,
|
||||
R.string.ftue_auth_carousel_control_title,
|
||||
R.string.ftue_auth_carousel_control_body,
|
||||
hero(R.drawable.ic_splash_control, R.drawable.ic_splash_control_dark),
|
||||
background(R.drawable.bg_carousel_page_2)
|
||||
),
|
||||
SplashCarouselData.Item(
|
||||
StringR.string.ftue_auth_carousel_encrypted_title,
|
||||
StringR.string.ftue_auth_carousel_encrypted_body,
|
||||
R.string.ftue_auth_carousel_encrypted_title,
|
||||
R.string.ftue_auth_carousel_encrypted_body,
|
||||
hero(R.drawable.ic_splash_secure, R.drawable.ic_splash_secure_dark),
|
||||
background(R.drawable.bg_carousel_page_3)
|
||||
),
|
||||
SplashCarouselData.Item(
|
||||
collaborationTitle(),
|
||||
StringR.string.ftue_auth_carousel_workplace_body,
|
||||
R.string.ftue_auth_carousel_workplace_body,
|
||||
hero(
|
||||
R.drawable.ic_splash_collaboration,
|
||||
R.drawable.ic_splash_collaboration_dark
|
||||
|
|
@ -68,7 +67,7 @@ class SplashCarouselDataFactory {
|
|||
private fun collaborationTitle(): Int {
|
||||
return when {
|
||||
true -> R.string.cut_the_slack_from_teams
|
||||
else -> StringR.string.ftue_auth_carousel_workplace_title
|
||||
else -> R.string.ftue_auth_carousel_workplace_title
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,22 @@
|
|||
-->
|
||||
|
||||
<resources>
|
||||
<!-- File to remove once the screen will be updated -->
|
||||
|
||||
<string name="cut_the_slack_from_teams" translatable="false">Cut the slack from teams.</string>
|
||||
|
||||
<string name="login_splash_submit">Get started</string>
|
||||
|
||||
<string name="ftue_auth_carousel_secure_title">Own your conversations.</string>
|
||||
<string name="ftue_auth_carousel_control_title">You\'re in control.</string>
|
||||
<string name="ftue_auth_carousel_encrypted_title">Secure messaging.</string>
|
||||
<string name="ftue_auth_carousel_workplace_title">Messaging for your team.</string>
|
||||
|
||||
<string name="ftue_auth_carousel_secure_body">Secure and independent communication that gives you the same level of privacy as a face-to-face conversation in your own home.</string>
|
||||
<string name="ftue_auth_carousel_control_body">Choose where your conversations are kept, giving you control and independence. Connected via Matrix.</string>
|
||||
<string name="ftue_auth_carousel_encrypted_body">End-to-end encrypted and no phone number required. No ads or datamining.</string>
|
||||
|
||||
<string name="ftue_auth_carousel_workplace_body">Element is also great for the workplace. It’s trusted by the world’s most secure organisations.</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ fun PreferencesRootView(
|
|||
PreferenceView(
|
||||
modifier = modifier,
|
||||
onBackPressed = onBackPressed,
|
||||
title = stringResource(id = StringR.string.settings)
|
||||
title = stringResource(id = StringR.string.common_settings)
|
||||
) {
|
||||
UserPreferences(state.myUser)
|
||||
RageshakePreferencesView(
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package io.element.android.features.rageshake.api.crash
|
|||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import io.element.android.features.rageshake.api.R
|
||||
import io.element.android.libraries.designsystem.components.dialogs.ConfirmationDialog
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||
|
|
@ -55,10 +56,10 @@ fun CrashDetectionContent(
|
|||
onDismiss: () -> Unit = { },
|
||||
) {
|
||||
ConfirmationDialog(
|
||||
title = stringResource(id = StringR.string.send_bug_report),
|
||||
content = stringResource(id = StringR.string.send_bug_report_app_crashed),
|
||||
submitText = stringResource(id = StringR.string.yes),
|
||||
cancelText = stringResource(id = StringR.string.no),
|
||||
title = stringResource(id = StringR.string.action_report_bug),
|
||||
content = stringResource(id = R.string.crash_detection_dialog_content, /* TODO App name */ "Element"),
|
||||
submitText = stringResource(id = StringR.string.action_yes),
|
||||
cancelText = stringResource(id = StringR.string.action_no),
|
||||
onCancelClicked = onNoClicked,
|
||||
onSubmitClicked = onYesClicked,
|
||||
onDismiss = onDismiss,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import androidx.compose.ui.platform.LocalView
|
|||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import io.element.android.features.rageshake.api.R
|
||||
import io.element.android.features.rageshake.api.screenshot.ImageResult
|
||||
import io.element.android.features.rageshake.api.screenshot.screenshot
|
||||
import io.element.android.libraries.androidutils.hardware.vibrate
|
||||
|
|
@ -87,11 +88,11 @@ fun RageshakeDialogContent(
|
|||
onYesClicked: () -> Unit = { },
|
||||
) {
|
||||
ConfirmationDialog(
|
||||
title = stringResource(id = StringR.string.send_bug_report),
|
||||
content = stringResource(id = StringR.string.send_bug_report_alert_message),
|
||||
title = stringResource(id = StringR.string.action_report_bug),
|
||||
content = stringResource(id = R.string.rageshake_detection_dialog_content),
|
||||
thirdButtonText = stringResource(id = StringR.string.action_disable),
|
||||
submitText = stringResource(id = StringR.string.yes),
|
||||
cancelText = stringResource(id = StringR.string.no),
|
||||
submitText = stringResource(id = StringR.string.action_yes),
|
||||
cancelText = stringResource(id = StringR.string.action_no),
|
||||
onCancelClicked = onNoClicked,
|
||||
onThirdButtonClicked = onDisableClicked,
|
||||
onSubmitClicked = onYesClicked,
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ fun RageshakePreferencesView(
|
|||
}
|
||||
|
||||
Column(modifier = modifier) {
|
||||
PreferenceCategory(title = stringResource(id = StringR.string.send_bug_report)) {
|
||||
PreferenceCategory(title = stringResource(id = StringR.string.action_report_bug)) {
|
||||
PreferenceText(
|
||||
title = stringResource(id = StringR.string.send_bug_report),
|
||||
title = stringResource(id = StringR.string.action_report_bug),
|
||||
icon = Icons.Default.BugReport,
|
||||
onClick = onOpenRageshake
|
||||
)
|
||||
|
|
@ -57,7 +57,7 @@ fun RageshakePreferencesView(
|
|||
PreferenceCategory(title = stringResource(id = StringR.string.settings_rageshake)) {
|
||||
if (state.isSupported) {
|
||||
PreferenceSwitch(
|
||||
title = stringResource(id = StringR.string.send_bug_report_rage_shake),
|
||||
title = stringResource(id = StringR.string.preference_rageshake),
|
||||
isChecked = state.isEnabled,
|
||||
onCheckedChange = ::onEnabledChanged
|
||||
)
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ import androidx.compose.ui.unit.dp
|
|||
import androidx.compose.ui.unit.sp
|
||||
import coil.compose.AsyncImage
|
||||
import coil.request.ImageRequest
|
||||
import io.element.android.features.rageshake.impl.R
|
||||
import io.element.android.libraries.architecture.Async
|
||||
import io.element.android.libraries.designsystem.components.LabelledCheckbox
|
||||
import io.element.android.libraries.designsystem.components.dialogs.ErrorDialog
|
||||
|
|
@ -92,7 +93,7 @@ fun BugReportView(
|
|||
val isFormEnabled = state.sending !is Async.Loading
|
||||
// Title
|
||||
Text(
|
||||
text = stringResource(id = StringR.string.send_bug_report),
|
||||
text = stringResource(id = StringR.string.action_report_bug),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 16.dp),
|
||||
|
|
@ -103,7 +104,7 @@ fun BugReportView(
|
|||
)
|
||||
// Form
|
||||
Text(
|
||||
text = stringResource(id = StringR.string.send_bug_report_description),
|
||||
text = stringResource(id = R.string.screen_bug_report_editor_description),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp, vertical = 16.dp),
|
||||
|
|
@ -123,10 +124,10 @@ fun BugReportView(
|
|||
.padding(top = 16.dp),
|
||||
enabled = isFormEnabled,
|
||||
label = {
|
||||
Text(text = stringResource(id = StringR.string.send_bug_report_placeholder))
|
||||
Text(text = stringResource(id = R.string.screen_bug_report_editor_placeholder))
|
||||
},
|
||||
supportingText = {
|
||||
Text(text = stringResource(id = StringR.string.send_bug_report_description_in_english))
|
||||
Text(text = stringResource(id = R.string.screen_bug_report_editor_supporting))
|
||||
},
|
||||
onValueChange = {
|
||||
descriptionFieldState = it
|
||||
|
|
@ -143,28 +144,28 @@ fun BugReportView(
|
|||
checked = state.formState.sendLogs,
|
||||
onCheckedChange = { eventSink(BugReportEvents.SetSendLog(it)) },
|
||||
enabled = isFormEnabled,
|
||||
text = stringResource(id = StringR.string.send_bug_report_include_logs)
|
||||
text = stringResource(id = R.string.screen_bug_report_include_logs)
|
||||
)
|
||||
if (state.hasCrashLogs) {
|
||||
LabelledCheckbox(
|
||||
checked = state.formState.sendCrashLogs,
|
||||
onCheckedChange = { eventSink(BugReportEvents.SetSendCrashLog(it)) },
|
||||
enabled = isFormEnabled,
|
||||
text = stringResource(id = StringR.string.send_bug_report_include_crash_logs)
|
||||
text = stringResource(id = R.string.screen_bug_report_include_crash_logs)
|
||||
)
|
||||
}
|
||||
LabelledCheckbox(
|
||||
checked = state.formState.canContact,
|
||||
onCheckedChange = { eventSink(BugReportEvents.SetCanContact(it)) },
|
||||
enabled = isFormEnabled,
|
||||
text = stringResource(id = StringR.string.you_may_contact_me)
|
||||
text = stringResource(id = R.string.screen_bug_report_contact_me)
|
||||
)
|
||||
if (state.screenshotUri != null) {
|
||||
LabelledCheckbox(
|
||||
checked = state.formState.sendScreenshot,
|
||||
onCheckedChange = { eventSink(BugReportEvents.SetSendScreenshot(it)) },
|
||||
enabled = isFormEnabled,
|
||||
text = stringResource(id = StringR.string.send_bug_report_include_screenshot)
|
||||
text = stringResource(id = R.string.screen_bug_report_include_screenshot)
|
||||
)
|
||||
if (state.formState.sendScreenshot) {
|
||||
Box(
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class DefaultRoomLastMessageFormatter @Inject constructor(
|
|||
return when (val content = event.content) {
|
||||
is MessageContent -> processMessageContents(content, senderDisplayName, isDmRoom)
|
||||
RedactedContent -> {
|
||||
val message = context.getString(StringR.string.event_redacted)
|
||||
val message = context.getString(StringR.string.common_message_removed)
|
||||
if (!isDmRoom) {
|
||||
prefix(message, senderDisplayName)
|
||||
} else {
|
||||
|
|
@ -77,7 +77,7 @@ class DefaultRoomLastMessageFormatter @Inject constructor(
|
|||
content.body
|
||||
}
|
||||
is UnableToDecryptContent -> {
|
||||
val message = context.getString(StringR.string.encryption_information_decryption_error)
|
||||
val message = context.getString(StringR.string.common_decryption_error)
|
||||
if (!isDmRoom) {
|
||||
prefix(message, senderDisplayName)
|
||||
} else {
|
||||
|
|
@ -94,7 +94,7 @@ class DefaultRoomLastMessageFormatter @Inject constructor(
|
|||
processRoomStateChange(content, senderDisplayName, isOutgoing)
|
||||
}
|
||||
is FailedToParseMessageLikeContent, is FailedToParseStateContent, is UnknownContent -> {
|
||||
prefixIfNeeded(context.getString(StringR.string.room_timeline_item_unsupported), senderDisplayName, isDmRoom)
|
||||
prefixIfNeeded(context.getString(StringR.string.common_unsupported_event), senderDisplayName, isDmRoom)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -111,19 +111,19 @@ class DefaultRoomLastMessageFormatter @Inject constructor(
|
|||
messageType.body
|
||||
}
|
||||
is VideoMessageType -> {
|
||||
context.getString(StringR.string.sent_a_video)
|
||||
context.getString(StringR.string.common_video)
|
||||
}
|
||||
is ImageMessageType -> {
|
||||
context.getString(StringR.string.sent_an_image)
|
||||
context.getString(StringR.string.common_image)
|
||||
}
|
||||
is FileMessageType -> {
|
||||
context.getString(StringR.string.sent_a_file)
|
||||
context.getString(StringR.string.common_file)
|
||||
}
|
||||
is AudioMessageType -> {
|
||||
context.getString(StringR.string.sent_an_audio_file)
|
||||
context.getString(StringR.string.common_audio)
|
||||
}
|
||||
UnknownMessageType -> {
|
||||
context.getString(StringR.string.unknown_message_content_type_error)
|
||||
context.getString(StringR.string.common_unsupported_event)
|
||||
}
|
||||
is NoticeMessageType -> {
|
||||
messageType.body
|
||||
|
|
@ -137,73 +137,73 @@ class DefaultRoomLastMessageFormatter @Inject constructor(
|
|||
val memberIsYou = userId == matrixClient.sessionId
|
||||
return when (val change = membershipContent.change) {
|
||||
MembershipChange.JOINED -> if (memberIsYou) {
|
||||
context.getString(StringR.string.notice_room_join_by_you)
|
||||
context.getString(R.string.state_event_room_join_by_you)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_join, userId.value)
|
||||
context.getString(R.string.state_event_room_join, userId.value)
|
||||
}
|
||||
MembershipChange.LEFT -> if (memberIsYou) {
|
||||
context.getString(StringR.string.notice_room_leave_by_you)
|
||||
context.getString(R.string.state_event_room_leave_by_you)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_leave, userId.value)
|
||||
context.getString(R.string.state_event_room_leave, userId.value)
|
||||
}
|
||||
MembershipChange.BANNED, MembershipChange.KICKED_AND_BANNED -> if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_room_ban_by_you, userId.value)
|
||||
context.getString(R.string.state_event_room_ban_by_you, userId.value)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_ban, senderDisplayName, userId.value)
|
||||
context.getString(R.string.state_event_room_ban, senderDisplayName, userId.value)
|
||||
}
|
||||
MembershipChange.UNBANNED -> if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_room_unban_by_you, userId.value)
|
||||
context.getString(R.string.state_event_room_unban_by_you, userId.value)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_unban, senderDisplayName, userId.value)
|
||||
context.getString(R.string.state_event_room_unban, senderDisplayName, userId.value)
|
||||
}
|
||||
MembershipChange.KICKED -> if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_room_remove_by_you, userId.value)
|
||||
context.getString(R.string.state_event_room_remove_by_you, userId.value)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_remove, senderDisplayName, userId.value)
|
||||
context.getString(R.string.state_event_room_remove, senderDisplayName, userId.value)
|
||||
}
|
||||
MembershipChange.INVITED -> if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_room_invite_by_you, userId.value)
|
||||
context.getString(R.string.state_event_room_invite_by_you, userId.value)
|
||||
} else if (memberIsYou) {
|
||||
context.getString(StringR.string.notice_room_invite_you, senderDisplayName)
|
||||
context.getString(R.string.state_event_room_invite_you, senderDisplayName)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_invite, senderDisplayName, userId.value)
|
||||
context.getString(R.string.state_event_room_invite, senderDisplayName, userId.value)
|
||||
}
|
||||
MembershipChange.INVITATION_ACCEPTED -> if (memberIsYou) {
|
||||
context.getString(StringR.string.notice_room_invite_accepted_by_you)
|
||||
context.getString(R.string.state_event_room_invite_accepted_by_you)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_invite_accepted, userId.value)
|
||||
context.getString(R.string.state_event_room_invite_accepted, userId.value)
|
||||
}
|
||||
MembershipChange.INVITATION_REJECTED -> if (memberIsYou) {
|
||||
context.getString(StringR.string.notice_room_reject_by_you)
|
||||
context.getString(R.string.state_event_room_reject_by_you)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_reject, userId.value)
|
||||
context.getString(R.string.state_event_room_reject, userId.value)
|
||||
}
|
||||
MembershipChange.INVITATION_REVOKED -> if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_room_third_party_revoked_invite_by_you, userId.value)
|
||||
context.getString(R.string.state_event_room_third_party_revoked_invite_by_you, userId.value)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_third_party_revoked_invite, senderDisplayName, userId.value)
|
||||
context.getString(R.string.state_event_room_third_party_revoked_invite, senderDisplayName, userId.value)
|
||||
}
|
||||
MembershipChange.KNOCKED -> if (memberIsYou) {
|
||||
context.getString(StringR.string.notice_room_knock_by_you)
|
||||
context.getString(R.string.state_event_room_knock_by_you)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_knock, userId.value)
|
||||
context.getString(R.string.state_event_room_knock, userId.value)
|
||||
}
|
||||
MembershipChange.KNOCK_ACCEPTED -> if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_room_knock_accepted_by_you, userId.value)
|
||||
context.getString(R.string.state_event_room_knock_accepted_by_you, userId.value)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_knock_accepted, senderDisplayName, userId.value)
|
||||
context.getString(R.string.state_event_room_knock_accepted, senderDisplayName, userId.value)
|
||||
}
|
||||
MembershipChange.KNOCK_RETRACTED -> if (memberIsYou) {
|
||||
context.getString(StringR.string.notice_room_knock_retracted_by_you)
|
||||
context.getString(R.string.state_event_room_knock_retracted_by_you)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_knock_retracted, userId.value)
|
||||
context.getString(R.string.state_event_room_knock_retracted, userId.value)
|
||||
}
|
||||
MembershipChange.KNOCK_DENIED -> if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_room_knock_denied_by_you, userId.value)
|
||||
context.getString(R.string.state_event_room_knock_denied_by_you, userId.value)
|
||||
} else if (memberIsYou) {
|
||||
context.getString(StringR.string.notice_room_knock_denied_you, senderDisplayName)
|
||||
context.getString(R.string.state_event_room_knock_denied_you, senderDisplayName)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_knock_denied, senderDisplayName, userId.value)
|
||||
context.getString(R.string.state_event_room_knock_denied, senderDisplayName, userId.value)
|
||||
}
|
||||
else -> {
|
||||
Timber.v("Filtering timeline item for room membership: $membershipContent")
|
||||
|
|
@ -217,27 +217,27 @@ class DefaultRoomLastMessageFormatter @Inject constructor(
|
|||
is OtherState.RoomAvatar -> {
|
||||
val hasAvatarUrl = content.url != null
|
||||
when {
|
||||
senderIsYou && hasAvatarUrl -> context.getString(StringR.string.notice_room_avatar_changed_by_you)
|
||||
senderIsYou && !hasAvatarUrl -> context.getString(StringR.string.notice_room_avatar_removed_by_you)
|
||||
!senderIsYou && hasAvatarUrl -> context.getString(StringR.string.notice_room_avatar_changed, senderDisplayName)
|
||||
else -> context.getString(StringR.string.notice_room_avatar_removed, senderDisplayName)
|
||||
senderIsYou && hasAvatarUrl -> context.getString(R.string.state_event_room_avatar_changed_by_you)
|
||||
senderIsYou && !hasAvatarUrl -> context.getString(R.string.state_event_room_avatar_removed_by_you)
|
||||
!senderIsYou && hasAvatarUrl -> context.getString(R.string.state_event_room_avatar_changed, senderDisplayName)
|
||||
else -> context.getString(R.string.state_event_room_avatar_removed, senderDisplayName)
|
||||
}
|
||||
}
|
||||
is OtherState.RoomCreate -> {
|
||||
if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_room_created_by_you)
|
||||
context.getString(R.string.state_event_room_created_by_you)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_created, senderDisplayName)
|
||||
context.getString(R.string.state_event_room_created, senderDisplayName)
|
||||
}
|
||||
}
|
||||
is OtherState.RoomEncryption -> context.getString(StringR.string.encryption_enabled)
|
||||
is OtherState.RoomEncryption -> context.getString(StringR.string.common_encryption_enabled)
|
||||
is OtherState.RoomName -> {
|
||||
val hasRoomName = content.name != null
|
||||
when {
|
||||
senderIsYou && hasRoomName -> context.getString(StringR.string.notice_room_name_changed_by_you, content.name)
|
||||
senderIsYou && !hasRoomName -> context.getString(StringR.string.notice_room_name_removed_by_you)
|
||||
!senderIsYou && hasRoomName -> context.getString(StringR.string.notice_room_name_changed, senderDisplayName, content.name)
|
||||
else -> context.getString(StringR.string.notice_room_name_removed, senderDisplayName)
|
||||
senderIsYou && hasRoomName -> context.getString(R.string.state_event_room_name_changed_by_you, content.name)
|
||||
senderIsYou && !hasRoomName -> context.getString(R.string.state_event_room_name_removed_by_you)
|
||||
!senderIsYou && hasRoomName -> context.getString(R.string.state_event_room_name_changed, senderDisplayName, content.name)
|
||||
else -> context.getString(R.string.state_event_room_name_removed, senderDisplayName)
|
||||
}
|
||||
}
|
||||
is OtherState.RoomThirdPartyInvite -> {
|
||||
|
|
@ -246,18 +246,18 @@ class DefaultRoomLastMessageFormatter @Inject constructor(
|
|||
return null
|
||||
}
|
||||
if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_room_third_party_invite_by_you, content.displayName)
|
||||
context.getString(R.string.state_event_room_third_party_invite_by_you, content.displayName)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_room_third_party_invite, senderDisplayName, content.displayName)
|
||||
context.getString(R.string.state_event_room_third_party_invite, senderDisplayName, content.displayName)
|
||||
}
|
||||
}
|
||||
is OtherState.RoomTopic -> {
|
||||
val hasRoomTopic = content.topic != null
|
||||
when {
|
||||
senderIsYou && hasRoomTopic -> context.getString(StringR.string.notice_room_topic_changed_by_you, content.topic)
|
||||
senderIsYou && !hasRoomTopic -> context.getString(StringR.string.notice_room_topic_removed_by_you)
|
||||
!senderIsYou && hasRoomTopic -> context.getString(StringR.string.notice_room_topic_changed, senderDisplayName, content.topic)
|
||||
else -> context.getString(StringR.string.notice_room_topic_removed, senderDisplayName)
|
||||
senderIsYou && hasRoomTopic -> context.getString(R.string.state_event_room_topic_changed_by_you, content.topic)
|
||||
senderIsYou && !hasRoomTopic -> context.getString(R.string.state_event_room_topic_removed_by_you)
|
||||
!senderIsYou && hasRoomTopic -> context.getString(R.string.state_event_room_topic_changed, senderDisplayName, content.topic)
|
||||
else -> context.getString(R.string.state_event_room_topic_removed, senderDisplayName)
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
|
|
@ -277,35 +277,35 @@ class DefaultRoomLastMessageFormatter @Inject constructor(
|
|||
return when {
|
||||
avatarChanged && displayNameChanged -> {
|
||||
val message = processProfileChangeContent(profileChangeContent.copy(avatarUrl = null, prevAvatarUrl = null), senderDisplayName, senderIsYou)
|
||||
val avatarChangedToo = context.getString(StringR.string.notice_avatar_changed_too)
|
||||
val avatarChangedToo = context.getString(R.string.state_event_avatar_changed_too)
|
||||
"$message\n$avatarChangedToo"
|
||||
}
|
||||
displayNameChanged -> {
|
||||
if (displayName != null && prevDisplayName != null) {
|
||||
if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_display_name_changed_from_by_you, prevDisplayName, displayName)
|
||||
context.getString(R.string.state_event_display_name_changed_from_by_you, prevDisplayName, displayName)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_display_name_changed_from, senderDisplayName, prevDisplayName, displayName)
|
||||
context.getString(R.string.state_event_display_name_changed_from, senderDisplayName, prevDisplayName, displayName)
|
||||
}
|
||||
} else if (displayName != null) {
|
||||
if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_display_name_set_by_you, displayName)
|
||||
context.getString(R.string.state_event_display_name_set_by_you, displayName)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_display_name_set, senderDisplayName, displayName)
|
||||
context.getString(R.string.state_event_display_name_set, senderDisplayName, displayName)
|
||||
}
|
||||
} else {
|
||||
if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_display_name_removed_by_you, prevDisplayName)
|
||||
context.getString(R.string.state_event_display_name_removed_by_you, prevDisplayName)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_display_name_removed, senderDisplayName, prevDisplayName)
|
||||
context.getString(R.string.state_event_display_name_removed, senderDisplayName, prevDisplayName)
|
||||
}
|
||||
}
|
||||
}
|
||||
avatarChanged -> {
|
||||
if (senderIsYou) {
|
||||
context.getString(StringR.string.notice_avatar_url_changed_by_you)
|
||||
context.getString(R.string.state_event_avatar_url_changed_by_you)
|
||||
} else {
|
||||
context.getString(StringR.string.notice_avatar_url_changed, senderDisplayName)
|
||||
context.getString(R.string.state_event_avatar_url_changed, senderDisplayName)
|
||||
}
|
||||
}
|
||||
else -> null
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ fun RoomListContent(
|
|||
}
|
||||
|
||||
val snackbarHostState = remember { SnackbarHostState() }
|
||||
val verificationCompleteMessage = stringResource(StringR.string.verification_conclusion_ok_self_notice_title)
|
||||
val verificationCompleteMessage = stringResource(StringR.string.common_verification_complete)
|
||||
LaunchedEffect(state.presentVerificationSuccessfulMessage) {
|
||||
if (state.presentVerificationSuccessfulMessage) {
|
||||
snackbarHostState.showSnackbar(
|
||||
|
|
@ -187,7 +187,7 @@ fun RoomListContent(
|
|||
containerColor = MaterialTheme.colorScheme.primary,
|
||||
onClick = onCreateRoomClicked
|
||||
) {
|
||||
Icon(resourceId = DrawableR.drawable.ic_edit_square, contentDescription = stringResource(id = StringR.string.a11y_create_message))
|
||||
Icon(resourceId = DrawableR.drawable.ic_edit_square, contentDescription = stringResource(id = R.string.screen_roomlist_a11y_create_message))
|
||||
}
|
||||
},
|
||||
snackbarHost = {
|
||||
|
|
@ -219,7 +219,7 @@ internal fun RequestVerificationHeader(
|
|||
) {
|
||||
Row {
|
||||
Text(
|
||||
stringResource(StringR.string.session_verification_banner_title),
|
||||
stringResource(R.string.session_verification_banner_title),
|
||||
modifier = Modifier.weight(1f),
|
||||
style = ElementTextStyles.Bold.body,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
|
|
@ -232,14 +232,14 @@ internal fun RequestVerificationHeader(
|
|||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(stringResource(StringR.string.session_verification_banner_message), style = ElementTextStyles.Regular.bodyMD)
|
||||
Text(stringResource(R.string.session_verification_banner_message), style = ElementTextStyles.Regular.bodyMD)
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
Button(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
contentPadding = PaddingValues(horizontal = 20.dp, vertical = 7.dp),
|
||||
onClick = onVerifyClicked,
|
||||
) {
|
||||
Text(stringResource(StringR.string.session_verification_start), style = ElementTextStyles.Button)
|
||||
Text(stringResource(StringR.string.action_continue), style = ElementTextStyles.Button)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ import androidx.compose.ui.text.TextStyle
|
|||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.sp
|
||||
import io.element.android.features.roomlist.impl.R
|
||||
import io.element.android.libraries.designsystem.components.avatar.Avatar
|
||||
import io.element.android.libraries.designsystem.components.avatar.AvatarData
|
||||
import io.element.android.libraries.designsystem.components.form.textFieldState
|
||||
|
|
@ -136,7 +137,7 @@ fun SearchRoomListTopBar(
|
|||
},
|
||||
placeholder = {
|
||||
Text(
|
||||
text = "Search",
|
||||
text = stringResource(id = StringR.string.action_search),
|
||||
color = MaterialTheme.colorScheme.onBackground.copy(alpha = ContentAlpha.medium)
|
||||
)
|
||||
},
|
||||
|
|
@ -207,7 +208,7 @@ private fun DefaultRoomListTopBar(
|
|||
title = {
|
||||
Text(
|
||||
fontWeight = FontWeight.Bold,
|
||||
text = stringResource(id = StringR.string.all_chats)
|
||||
text = stringResource(id = R.string.screen_roomlist_main_space_title)
|
||||
)
|
||||
},
|
||||
navigationIcon = {
|
||||
|
|
|
|||
|
|
@ -182,13 +182,13 @@ class DefaultRoomLastMessageFormatterTests {
|
|||
// Verify results of DM mode
|
||||
for ((type, result) in resultsInDm) {
|
||||
val expectedResult = when (type) {
|
||||
is VideoMessageType -> "Video."
|
||||
is VideoMessageType -> "Video"
|
||||
is AudioMessageType -> "Audio"
|
||||
is ImageMessageType -> "Image."
|
||||
is ImageMessageType -> "Image"
|
||||
is FileMessageType -> "File"
|
||||
is EmoteMessageType -> "- $senderName ${type.body}"
|
||||
is TextMessageType, is NoticeMessageType -> body
|
||||
UnknownMessageType -> "Event type not handled by EAX"
|
||||
UnknownMessageType -> "Unsupported event"
|
||||
}
|
||||
Truth.assertWithMessage("$type was not properly handled").that(result).isEqualTo(expectedResult)
|
||||
}
|
||||
|
|
@ -197,13 +197,13 @@ class DefaultRoomLastMessageFormatterTests {
|
|||
for ((type, result) in resultsInRoom) {
|
||||
val string = result.toString()
|
||||
val expectedResult = when (type) {
|
||||
is VideoMessageType -> "$senderName: Video."
|
||||
is VideoMessageType -> "$senderName: Video"
|
||||
is AudioMessageType -> "$senderName: Audio"
|
||||
is ImageMessageType -> "$senderName: Image."
|
||||
is ImageMessageType -> "$senderName: Image"
|
||||
is FileMessageType -> "$senderName: File"
|
||||
is EmoteMessageType -> "- $senderName ${type.body}"
|
||||
is TextMessageType, is NoticeMessageType -> "$senderName: $body"
|
||||
UnknownMessageType -> "$senderName: Event type not handled by EAX"
|
||||
UnknownMessageType -> "$senderName: Unsupported event"
|
||||
}
|
||||
val shouldCreateAnnotatedString = when (type) {
|
||||
is VideoMessageType -> true
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ fun SearchUserBar(
|
|||
active: Boolean,
|
||||
isMultiSelectionEnabled: Boolean,
|
||||
modifier: Modifier = Modifier,
|
||||
placeHolderTitle: String = stringResource(StringR.string.search_for_someone),
|
||||
placeHolderTitle: String = stringResource(StringR.string.common_search_for_someone),
|
||||
onActiveChanged: (Boolean) -> Unit = {},
|
||||
onTextChanged: (String) -> Unit = {},
|
||||
onUserSelected: (MatrixUser) -> Unit = {},
|
||||
|
|
@ -154,7 +154,7 @@ fun SearchUserBar(
|
|||
active && query.isNotEmpty() -> {
|
||||
{
|
||||
IconButton(onClick = { onTextChanged("") }) {
|
||||
Icon(Icons.Default.Close, stringResource(StringR.string.a11y_clear))
|
||||
Icon(Icons.Default.Close, stringResource(StringR.string.action_clear))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -162,7 +162,7 @@ fun SearchUserBar(
|
|||
{
|
||||
Icon(
|
||||
imageVector = Icons.Default.Search,
|
||||
contentDescription = stringResource(StringR.string.search),
|
||||
contentDescription = stringResource(StringR.string.action_search),
|
||||
modifier = Modifier.alpha(0.4f), // FIXME align on Design system theme (removing alpha should be fine)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,16 +111,16 @@ internal fun HeaderContent(verificationFlowStep: FlowStep, modifier: Modifier =
|
|||
FlowStep.Ready, is FlowStep.Verifying, FlowStep.Completed -> R.drawable.ic_verification_emoji
|
||||
}
|
||||
val titleTextId = when (verificationFlowStep) {
|
||||
FlowStep.Initial -> StringR.string.verification_title_initial
|
||||
FlowStep.Canceled -> StringR.string.verification_title_canceled
|
||||
FlowStep.AwaitingOtherDeviceResponse -> StringR.string.verification_title_waiting
|
||||
FlowStep.Ready, is FlowStep.Verifying, FlowStep.Completed -> StringR.string.verification_title_verifying
|
||||
FlowStep.Initial -> R.string.screen_session_verification_open_existing_session_title
|
||||
FlowStep.Canceled -> R.string.screen_session_verification_cancelled_title
|
||||
FlowStep.AwaitingOtherDeviceResponse -> R.string.screen_session_verification_waiting_to_accept_title
|
||||
FlowStep.Ready, is FlowStep.Verifying, FlowStep.Completed -> R.string.screen_session_verification_compare_emojis_title
|
||||
}
|
||||
val subtitleTextId = when (verificationFlowStep) {
|
||||
FlowStep.Initial -> StringR.string.verification_subtitle_initial
|
||||
FlowStep.Canceled -> StringR.string.verification_subtitle_canceled
|
||||
FlowStep.AwaitingOtherDeviceResponse -> StringR.string.verification_subtitle_waiting
|
||||
FlowStep.Ready, is FlowStep.Verifying, FlowStep.Completed -> StringR.string.verification_subtitle_verifying
|
||||
FlowStep.Initial -> R.string.screen_session_verification_open_existing_session_subtitle
|
||||
FlowStep.Canceled -> R.string.screen_session_verification_cancelled_subtitle
|
||||
FlowStep.AwaitingOtherDeviceResponse -> R.string.screen_session_verification_waiting_to_accept_subtitle
|
||||
FlowStep.Ready, is FlowStep.Verifying, FlowStep.Completed -> R.string.screen_session_verification_compare_emojis_subtitle
|
||||
}
|
||||
|
||||
Column(modifier) {
|
||||
|
|
@ -216,22 +216,22 @@ internal fun BottomMenu(screenState: VerifySelfSessionState, goBack: () -> Unit)
|
|||
|
||||
val isVerifying = (verificationViewState as? FlowStep.Verifying)?.state is Async.Loading<Unit>
|
||||
val positiveButtonTitle = when (verificationViewState) {
|
||||
FlowStep.Initial -> StringR.string.verification_positive_button_initial
|
||||
FlowStep.Canceled -> StringR.string.verification_positive_button_canceled
|
||||
FlowStep.Initial -> R.string.screen_session_verification_positive_button_initial
|
||||
FlowStep.Canceled -> R.string.screen_session_verification_positive_button_canceled
|
||||
is FlowStep.Verifying -> {
|
||||
if (isVerifying) {
|
||||
StringR.string.verification_positive_button_verifying_ongoing
|
||||
R.string.screen_session_verification_positive_button_verifying_ongoing
|
||||
} else {
|
||||
StringR.string.verification_positive_button_verifying_start
|
||||
R.string.screen_session_verification_they_match
|
||||
}
|
||||
}
|
||||
FlowStep.Ready -> StringR.string.verification_positive_button_ready
|
||||
FlowStep.Ready -> R.string.screen_session_verification_positive_button_ready
|
||||
else -> null
|
||||
}
|
||||
val negativeButtonTitle = when (verificationViewState) {
|
||||
FlowStep.Initial -> StringR.string.verification_negative_button_initial
|
||||
FlowStep.Canceled -> StringR.string.verification_negative_button_canceled
|
||||
is FlowStep.Verifying -> StringR.string.verification_negative_button_verifying
|
||||
FlowStep.Initial -> StringR.string.action_cancel
|
||||
FlowStep.Canceled -> StringR.string.action_cancel
|
||||
is FlowStep.Verifying -> R.string.screen_session_verification_they_dont_match
|
||||
else -> null
|
||||
}
|
||||
val negativeButtonEnabled = !isVerifying
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ fun BackButton(
|
|||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
imageVector: ImageVector = Icons.Default.ArrowBack,
|
||||
contentDescription: String = stringResource(StringR.string.a11y_back),
|
||||
contentDescription: String = stringResource(StringR.string.action_back),
|
||||
enabled: Boolean = true
|
||||
) {
|
||||
IconButton(
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ fun ConfirmationDialog(
|
|||
onSubmitClicked: () -> Unit,
|
||||
onDismiss: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
submitText: String = stringResource(id = StringR.string.ok),
|
||||
submitText: String = stringResource(id = StringR.string.action_ok),
|
||||
cancelText: String = stringResource(id = StringR.string.action_cancel),
|
||||
thirdButtonText: String? = null,
|
||||
emphasizeSubmitButton: Boolean = false,
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ fun ErrorDialog(
|
|||
|
||||
object ErrorDialogDefaults {
|
||||
val title: String @Composable get() = stringResource(id = StringR.string.dialog_title_error)
|
||||
val submitText: String @Composable get() = stringResource(id = StringR.string.ok)
|
||||
val submitText: String @Composable get() = stringResource(id = StringR.string.action_ok)
|
||||
}
|
||||
|
||||
@Preview
|
||||
|
|
|
|||
|
|
@ -249,28 +249,28 @@ class RichTextComposerLayout @JvmOverloads constructor(
|
|||
private fun setupRichTextMenu() {
|
||||
addRichTextMenuItem(
|
||||
R.drawable.ic_composer_bold,
|
||||
StringR.string.rich_text_editor_format_bold,
|
||||
R.string.rich_text_editor_format_bold,
|
||||
ComposerAction.BOLD
|
||||
) {
|
||||
views.richTextComposerEditText.toggleInlineFormat(InlineFormat.Bold)
|
||||
}
|
||||
addRichTextMenuItem(
|
||||
R.drawable.ic_composer_italic,
|
||||
StringR.string.rich_text_editor_format_italic,
|
||||
R.string.rich_text_editor_format_italic,
|
||||
ComposerAction.ITALIC
|
||||
) {
|
||||
views.richTextComposerEditText.toggleInlineFormat(InlineFormat.Italic)
|
||||
}
|
||||
addRichTextMenuItem(
|
||||
R.drawable.ic_composer_underlined,
|
||||
StringR.string.rich_text_editor_format_underline,
|
||||
R.string.rich_text_editor_format_underline,
|
||||
ComposerAction.UNDERLINE
|
||||
) {
|
||||
views.richTextComposerEditText.toggleInlineFormat(InlineFormat.Underline)
|
||||
}
|
||||
addRichTextMenuItem(
|
||||
R.drawable.ic_composer_strikethrough,
|
||||
StringR.string.rich_text_editor_format_strikethrough,
|
||||
R.string.rich_text_editor_format_strikethrough,
|
||||
ComposerAction.STRIKE_THROUGH
|
||||
) {
|
||||
views.richTextComposerEditText.toggleInlineFormat(InlineFormat.StrikeThrough)
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ private fun MessageComposerView.setup(isDarkMode: Boolean, composerMode: Message
|
|||
}
|
||||
editText.setTextColor(editTextColor)
|
||||
editText.setHintTextColor(editTextColor)
|
||||
editText.setHint(StringR.string.room_message_placeholder)
|
||||
editText.setHint(R.string.rich_text_editor_composer_placeholder)
|
||||
emojiButton?.isVisible = true
|
||||
sendButton.isVisible = true
|
||||
editText.maxLines = MessageComposerView.MAX_LINES_WHEN_COLLAPSED
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
android:layout_height="60dp"
|
||||
android:layout_margin="@dimen/composer_attachment_margin"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/option_send_files"
|
||||
android:contentDescription="@string/a11y_send_files"
|
||||
android:src="@drawable/ic_rich_composer_add"
|
||||
android:paddingStart="4dp"
|
||||
app:layout_constraintVertical_bias="1"
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
android:layout_height="0dp"
|
||||
app:layout_constraintHeight_default="wrap"
|
||||
android:gravity="top"
|
||||
android:hint="@string/room_message_placeholder"
|
||||
android:hint="@string/rich_text_editor_composer_placeholder"
|
||||
android:nextFocusLeft="@id/richTextComposerEditText"
|
||||
android:nextFocusUp="@id/richTextComposerEditText"
|
||||
android:layout_marginStart="12dp"
|
||||
|
|
@ -162,7 +162,7 @@
|
|||
android:layout_height="0dp"
|
||||
app:layout_constraintHeight_default="wrap"
|
||||
android:visibility="gone"
|
||||
android:hint="@string/room_message_placeholder"
|
||||
android:hint="@string/rich_text_editor_composer_placeholder"
|
||||
android:nextFocusLeft="@id/plainTextComposerEditText"
|
||||
android:nextFocusUp="@id/plainTextComposerEditText"
|
||||
android:layout_marginStart="12dp"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue