From 445df094115750c41b283281b31209040acdb25f Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 9 Jun 2023 18:19:00 +0200 Subject: [PATCH] Always use `import io.element.android.libraries.ui.strings.R as StringR` --- .../android/features/login/impl/error/ErrorFormatter.kt | 6 +++--- .../searchaccountprovider/SearchAccountProviderView.kt | 3 ++- .../roomdetails/impl/invite/RoomInviteMembersView.kt | 2 +- .../libraries/eventformatter/impl/StateContentFormatter.kt | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/error/ErrorFormatter.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/error/ErrorFormatter.kt index 86820645ae..ec2dc95386 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/error/ErrorFormatter.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/error/ErrorFormatter.kt @@ -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.AuthenticationException 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 fun loginError( throwable: Throwable ): Int { - val authException = throwable as? AuthenticationException ?: return StringR.error_unknown + val authException = throwable as? AuthenticationException ?: return StringR.string.error_unknown return when (authException.errorCode) { AuthErrorCode.FORBIDDEN -> R.string.screen_login_error_invalid_credentials AuthErrorCode.USER_DEACTIVATED -> R.string.screen_login_error_deactivated_account - AuthErrorCode.UNKNOWN -> StringR.error_unknown + AuthErrorCode.UNKNOWN -> StringR.string.error_unknown } } diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/searchaccountprovider/SearchAccountProviderView.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/searchaccountprovider/SearchAccountProviderView.kt index f61bc1caf8..26928446d3 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/searchaccountprovider/SearchAccountProviderView.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/searchaccountprovider/SearchAccountProviderView.kt @@ -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.testtags.TestTags 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 @@ -135,7 +136,7 @@ fun SearchAccountProviderView( }) { Icon( imageVector = Icons.Filled.Close, - contentDescription = stringResource(io.element.android.libraries.ui.strings.R.string.action_clear) + contentDescription = stringResource(StringR.string.action_clear) ) } } diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/invite/RoomInviteMembersView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/invite/RoomInviteMembersView.kt index ced5e79bbe..867d2f433d 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/invite/RoomInviteMembersView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/invite/RoomInviteMembersView.kt @@ -147,7 +147,7 @@ private fun RoomInviteMembersSearchBar( selectedUsers: ImmutableList, active: Boolean, 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 = {}, onTextChanged: (String) -> Unit = {}, onUserToggled: (MatrixUser) -> Unit = {}, diff --git a/libraries/eventformatter/impl/src/main/kotlin/io/element/android/libraries/eventformatter/impl/StateContentFormatter.kt b/libraries/eventformatter/impl/src/main/kotlin/io/element/android/libraries/eventformatter/impl/StateContentFormatter.kt index 169ec55a9d..ccf9c2976a 100644 --- a/libraries/eventformatter/impl/src/main/kotlin/io/element/android/libraries/eventformatter/impl/StateContentFormatter.kt +++ b/libraries/eventformatter/impl/src/main/kotlin/io/element/android/libraries/eventformatter/impl/StateContentFormatter.kt @@ -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 timber.log.Timber import javax.inject.Inject +import io.element.android.libraries.ui.strings.R as StringR class StateContentFormatter @Inject constructor( private val sp: StringProvider, @@ -49,7 +50,7 @@ class StateContentFormatter @Inject constructor( 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 -> { val hasRoomName = content.name != null when {