Browse Source

Use correct string for "invite friends..." action

feature/julioromano/geocoding_api
Chris Smith 1 year ago
parent
commit
2aba6a7f71
  1. 3
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenter.kt
  2. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootState.kt
  3. 1
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootStateProvider.kt
  4. 4
      features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootView.kt

3
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootPresenter.kt

@ -28,6 +28,7 @@ import io.element.android.features.createroom.impl.userlist.UserListPresenterArg @@ -28,6 +28,7 @@ import io.element.android.features.createroom.impl.userlist.UserListPresenterArg
import io.element.android.libraries.architecture.Async
import io.element.android.libraries.architecture.Presenter
import io.element.android.libraries.architecture.execute
import io.element.android.libraries.core.meta.BuildMeta
import io.element.android.libraries.matrix.api.MatrixClient
import io.element.android.libraries.matrix.api.core.RoomId
import io.element.android.libraries.matrix.api.user.MatrixUser
@ -41,6 +42,7 @@ class CreateRoomRootPresenter @Inject constructor( @@ -41,6 +42,7 @@ class CreateRoomRootPresenter @Inject constructor(
private val userRepository: UserRepository,
private val userListDataStore: UserListDataStore,
private val matrixClient: MatrixClient,
private val buildMeta: BuildMeta,
) : Presenter<CreateRoomRootState> {
private val presenter by lazy {
@ -79,6 +81,7 @@ class CreateRoomRootPresenter @Inject constructor( @@ -79,6 +81,7 @@ class CreateRoomRootPresenter @Inject constructor(
}
return CreateRoomRootState(
applicationName = buildMeta.applicationName,
userListState = userListState,
startDmAction = startDmAction.value,
eventSink = ::handleEvents,

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootState.kt

@ -21,6 +21,7 @@ import io.element.android.libraries.architecture.Async @@ -21,6 +21,7 @@ import io.element.android.libraries.architecture.Async
import io.element.android.libraries.matrix.api.core.RoomId
data class CreateRoomRootState(
val applicationName: String,
val userListState: UserListState,
val startDmAction: Async<RoomId>,
val eventSink: (CreateRoomRootEvents) -> Unit,

1
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootStateProvider.kt

@ -55,6 +55,7 @@ open class CreateRoomRootStateProvider : PreviewParameterProvider<CreateRoomRoot @@ -55,6 +55,7 @@ open class CreateRoomRootStateProvider : PreviewParameterProvider<CreateRoomRoot
fun aCreateRoomRootState() = CreateRoomRootState(
eventSink = {},
applicationName = "Element X Preview",
startDmAction = Async.Uninitialized,
userListState = aUserListState(),
)

4
features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootView.kt

@ -97,6 +97,7 @@ fun CreateRoomRootView( @@ -97,6 +97,7 @@ fun CreateRoomRootView(
if (!state.userListState.isSearchActive) {
CreateRoomActionButtonsList(
state = state,
onNewRoomClicked = onNewRoomClicked,
onInvitePeopleClicked = onInviteFriendsClicked,
)
@ -155,6 +156,7 @@ fun CreateRoomRootViewTopBar( @@ -155,6 +156,7 @@ fun CreateRoomRootViewTopBar(
@Composable
fun CreateRoomActionButtonsList(
state: CreateRoomRootState,
modifier: Modifier = Modifier,
onNewRoomClicked: () -> Unit = {},
onInvitePeopleClicked: () -> Unit = {},
@ -167,7 +169,7 @@ fun CreateRoomActionButtonsList( @@ -167,7 +169,7 @@ fun CreateRoomActionButtonsList(
)
CreateRoomActionButton(
iconRes = DrawableR.drawable.ic_share,
text = stringResource(id = R.string.screen_create_room_action_invite_people),
text = stringResource(id = StringR.string.action_invite_friends_to_app, state.applicationName),
onClick = onInvitePeopleClicked,
)
}

Loading…
Cancel
Save