File tree Expand file tree Collapse file tree 6 files changed +16
-11
lines changed
messages/impl/src/main/kotlin/io/element/android/features/messages/impl
roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl
securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/setup
viewfolder/impl/src/main/kotlin/io/element/android/features/viewfolder/impl/file
libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/model Expand file tree Collapse file tree 6 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import androidx.compose.runtime.CompositionLocalProvider
1515import androidx.compose.ui.Modifier
1616import androidx.compose.ui.platform.LocalContext
1717import androidx.compose.ui.platform.LocalView
18+ import androidx.compose.ui.res.stringResource
1819import com.bumble.appyx.core.modality.BuildContext
1920import com.bumble.appyx.core.node.Node
2021import com.bumble.appyx.core.plugin.Plugin
@@ -100,6 +101,7 @@ class PinnedMessagesListNode(
100101 LocalTimelineItemPresenterFactories provides timelineItemPresenterFactories,
101102 ) {
102103 val context = LocalContext .current
104+ val toastMessage = stringResource(CommonStrings .common_copied_to_clipboard)
103105 val view = LocalView .current
104106 val state = presenter.present()
105107 PinnedMessagesListView (
@@ -113,8 +115,8 @@ class PinnedMessagesListNode(
113115 HapticFeedbackConstants .LONG_PRESS
114116 )
115117 context.copyToClipboard(
116- it.url,
117- context.getString( CommonStrings .common_copied_to_clipboard)
118+ text = it.url,
119+ toastMessage = toastMessage,
118120 )
119121 },
120122 modifier = modifier
Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ fun TimelineView(
123123 }
124124
125125 val context = LocalContext .current
126+ val toastMessage = stringResource(CommonStrings .common_copied_to_clipboard)
126127 val view = LocalView .current
127128 // Disable reverse layout when TalkBack is enabled to avoid incorrect ordering issues seen in the current Compose UI version
128129 val useReverseLayout = ! isTalkbackActive()
@@ -136,8 +137,8 @@ fun TimelineView(
136137 HapticFeedbackConstants .LONG_PRESS
137138 )
138139 context.copyToClipboard(
139- link.url,
140- context.getString( CommonStrings .common_copied_to_clipboard)
140+ text = link.url,
141+ toastMessage = toastMessage,
141142 )
142143 }
143144
Original file line number Diff line number Diff line change @@ -721,6 +721,7 @@ private fun DebugInfoSection(
721721) {
722722 val context = LocalContext .current
723723 PreferenceCategory (showTopDivider = true ) {
724+ val toastMessage = stringResource(CommonStrings .common_copied_to_clipboard)
724725 ListItem (
725726 headlineContent = {
726727 Text (" Internal room ID" )
@@ -736,8 +737,8 @@ private fun DebugInfoSection(
736737 trailingContent = ListItemContent .Icon (IconSource .Vector (CompoundIcons .Copy ())),
737738 onClick = {
738739 context.copyToClipboard(
739- roomId.value,
740- context.getString( CommonStrings .common_copied_to_clipboard)
740+ text = roomId.value,
741+ toastMessage = toastMessage,
741742 )
742743 },
743744 )
Original file line number Diff line number Diff line change @@ -116,11 +116,12 @@ private fun Content(
116116) {
117117 val context = LocalContext .current
118118 val formattedRecoveryKey = state.recoveryKeyViewState.formattedRecoveryKey
119+ val toastMessage = stringResource(R .string.screen_recovery_key_copied_to_clipboard)
119120 val clickLambda = if (formattedRecoveryKey != null ) {
120121 {
121122 context.copyToClipboard(
122- formattedRecoveryKey,
123- context.getString( R .string.screen_recovery_key_copied_to_clipboard)
123+ text = formattedRecoveryKey,
124+ toastMessage = toastMessage,
124125 )
125126 state.eventSink.invoke(SecureBackupSetupEvents .RecoveryKeyHasBeenSaved )
126127 }
Original file line number Diff line number Diff line change @@ -73,13 +73,14 @@ private fun LineRow(
7373 colorationMode : ColorationMode ,
7474) {
7575 val context = LocalContext .current
76+ val toastMessage = stringResource(CommonStrings .common_line_copied_to_clipboard)
7677 Row (
7778 modifier = Modifier
7879 .fillMaxWidth()
7980 .clickable(onClick = {
8081 context.copyToClipboard(
8182 text = line,
82- toastMessage = context.getString( CommonStrings .common_line_copied_to_clipboard) ,
83+ toastMessage = toastMessage ,
8384 )
8485 })
8586 ) {
Original file line number Diff line number Diff line change 99package io.element.android.libraries.matrix.ui.model
1010
1111import androidx.compose.runtime.Composable
12- import androidx.compose.ui.platform.LocalContext
1312import androidx.compose.ui.res.stringResource
1413import androidx.compose.ui.text.AnnotatedString
1514import androidx.compose.ui.text.SpanStyle
@@ -30,7 +29,7 @@ data class InviteSender(
3029 @Composable
3130 fun annotatedString (): AnnotatedString {
3231 return stringResource(R .string.screen_invites_invited_you, displayName, userId.value).let { text ->
33- val senderNameStart = LocalContext .current.getString (R .string.screen_invites_invited_you).indexOf(" %1\ $ s" )
32+ val senderNameStart = stringResource (R .string.screen_invites_invited_you).indexOf($$ " %1$s " )
3433 AnnotatedString (
3534 text = text,
3635 spanStyles = listOf (
You can’t perform that action at this time.
0 commit comments