Always use import io.element.android.libraries.ui.strings.R as StringR
This commit is contained in:
parent
8d50acaff4
commit
19e090f6dc
4 changed files with 8 additions and 6 deletions
|
|
@ -21,16 +21,16 @@ 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.AuthErrorCode
|
||||||
import io.element.android.libraries.matrix.api.auth.AuthenticationException
|
import io.element.android.libraries.matrix.api.auth.AuthenticationException
|
||||||
import io.element.android.libraries.matrix.api.auth.errorCode
|
import io.element.android.libraries.matrix.api.auth.errorCode
|
||||||
import io.element.android.libraries.ui.strings.R.string as StringR
|
import io.element.android.libraries.ui.strings.R as StringR
|
||||||
|
|
||||||
@StringRes
|
@StringRes
|
||||||
fun loginError(
|
fun loginError(
|
||||||
throwable: Throwable
|
throwable: Throwable
|
||||||
): Int {
|
): Int {
|
||||||
val authException = throwable as? AuthenticationException ?: return StringR.error_unknown
|
val authException = throwable as? AuthenticationException ?: return StringR.string.error_unknown
|
||||||
return when (authException.errorCode) {
|
return when (authException.errorCode) {
|
||||||
AuthErrorCode.FORBIDDEN -> R.string.screen_login_error_invalid_credentials
|
AuthErrorCode.FORBIDDEN -> R.string.screen_login_error_invalid_credentials
|
||||||
AuthErrorCode.USER_DEACTIVATED -> R.string.screen_login_error_deactivated_account
|
AuthErrorCode.USER_DEACTIVATED -> R.string.screen_login_error_deactivated_account
|
||||||
AuthErrorCode.UNKNOWN -> StringR.error_unknown
|
AuthErrorCode.UNKNOWN -> StringR.string.error_unknown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ import io.element.android.libraries.designsystem.theme.components.OutlinedTextFi
|
||||||
import io.element.android.libraries.designsystem.theme.components.Text
|
import io.element.android.libraries.designsystem.theme.components.Text
|
||||||
import io.element.android.libraries.testtags.TestTags
|
import io.element.android.libraries.testtags.TestTags
|
||||||
import io.element.android.libraries.testtags.testTag
|
import io.element.android.libraries.testtags.testTag
|
||||||
|
import io.element.android.libraries.ui.strings.R as StringR
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* https://www.figma.com/file/o9p34zmiuEpZRyvZXJZAYL/FTUE?type=design&node-id=611-61435
|
* https://www.figma.com/file/o9p34zmiuEpZRyvZXJZAYL/FTUE?type=design&node-id=611-61435
|
||||||
|
|
@ -135,7 +136,7 @@ fun SearchAccountProviderView(
|
||||||
}) {
|
}) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Filled.Close,
|
imageVector = Icons.Filled.Close,
|
||||||
contentDescription = stringResource(io.element.android.libraries.ui.strings.R.string.action_clear)
|
contentDescription = stringResource(StringR.string.action_clear)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ private fun RoomInviteMembersSearchBar(
|
||||||
selectedUsers: ImmutableList<MatrixUser>,
|
selectedUsers: ImmutableList<MatrixUser>,
|
||||||
active: Boolean,
|
active: Boolean,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
placeHolderTitle: String = stringResource(io.element.android.libraries.ui.strings.R.string.common_search_for_someone),
|
placeHolderTitle: String = stringResource(StringR.string.common_search_for_someone),
|
||||||
onActiveChanged: (Boolean) -> Unit = {},
|
onActiveChanged: (Boolean) -> Unit = {},
|
||||||
onTextChanged: (String) -> Unit = {},
|
onTextChanged: (String) -> Unit = {},
|
||||||
onUserToggled: (MatrixUser) -> Unit = {},
|
onUserToggled: (MatrixUser) -> Unit = {},
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import io.element.android.libraries.matrix.api.timeline.item.event.StateContent
|
||||||
import io.element.android.services.toolbox.api.strings.StringProvider
|
import io.element.android.services.toolbox.api.strings.StringProvider
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
import io.element.android.libraries.ui.strings.R as StringR
|
||||||
|
|
||||||
class StateContentFormatter @Inject constructor(
|
class StateContentFormatter @Inject constructor(
|
||||||
private val sp: StringProvider,
|
private val sp: StringProvider,
|
||||||
|
|
@ -49,7 +50,7 @@ class StateContentFormatter @Inject constructor(
|
||||||
sp.getString(R.string.state_event_room_created, senderDisplayName)
|
sp.getString(R.string.state_event_room_created, senderDisplayName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is OtherState.RoomEncryption -> sp.getString(io.element.android.libraries.ui.strings.R.string.common_encryption_enabled)
|
is OtherState.RoomEncryption -> sp.getString(StringR.string.common_encryption_enabled)
|
||||||
is OtherState.RoomName -> {
|
is OtherState.RoomName -> {
|
||||||
val hasRoomName = content.name != null
|
val hasRoomName = content.name != null
|
||||||
when {
|
when {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue