14
14
* limitations under the License.
15
15
*/
16
16
17
- @file:OptIn(ExperimentalFoundationApi ::class )
18
-
19
17
package io.element.android.features.messages.impl.pinned.banner
20
18
21
- import androidx.compose.foundation.ExperimentalFoundationApi
22
19
import androidx.compose.foundation.background
23
20
import androidx.compose.foundation.clickable
24
21
import androidx.compose.foundation.layout.Arrangement.spacedBy
@@ -44,6 +41,7 @@ import androidx.compose.ui.draw.drawBehind
44
41
import androidx.compose.ui.draw.shadow
45
42
import androidx.compose.ui.geometry.Offset
46
43
import androidx.compose.ui.graphics.Color
44
+ import androidx.compose.ui.res.stringResource
47
45
import androidx.compose.ui.text.style.TextOverflow
48
46
import androidx.compose.ui.tooling.preview.PreviewParameter
49
47
import androidx.compose.ui.unit.dp
@@ -57,6 +55,7 @@ import io.element.android.libraries.designsystem.theme.components.TextButton
57
55
import io.element.android.libraries.designsystem.theme.pinnedMessageBannerBorder
58
56
import io.element.android.libraries.designsystem.theme.pinnedMessageBannerIndicator
59
57
import io.element.android.libraries.designsystem.utils.annotatedTextWithBold
58
+ import io.element.android.libraries.ui.strings.CommonStrings
60
59
61
60
@Composable
62
61
fun PinnedMessagesBannerView (
@@ -110,7 +109,7 @@ fun PinnedMessagesBannerView(
110
109
message = " This is a pinned message" ,
111
110
modifier = Modifier .weight(1f )
112
111
)
113
- TextButton (text = " View all " , onClick = { /* TODO*/ })
112
+ TextButton (text = stringResource(id = CommonStrings .screen_room_pinned_banner_view_all_button_title) , onClick = { /* TODO*/ })
114
113
}
115
114
}
116
115
@@ -168,13 +167,13 @@ private fun PinnedMessageItem(
168
167
message : String ,
169
168
modifier : Modifier = Modifier ,
170
169
) {
171
- val countMessage = " ${ index + 1 } of $ totalCount"
172
- val fullMessage = " $countMessage Pinned messages "
170
+ val countMessage = stringResource(id = CommonStrings .screen_room_pinned_banner_indicator, index + 1 , totalCount)
171
+ val fullCountMessage = stringResource(id = CommonStrings .screen_room_pinned_banner_indicator_description, countMessage)
173
172
Column (modifier = modifier) {
174
173
if (totalCount > 1 ) {
175
174
Text (
176
175
text = annotatedTextWithBold(
177
- text = fullMessage ,
176
+ text = fullCountMessage ,
178
177
boldText = countMessage,
179
178
),
180
179
style = ElementTheme .typography.fontBodySmMedium,
0 commit comments