@@ -59,6 +59,7 @@ import java.time.ZoneId
5959import java.time.format.DateTimeFormatter
6060
6161const val SPACE_16 = 16
62+ const val SPACE_0 = 0
6263const val CORNER_RADIUS = 16
6364val ELEVATION = 2 .dp
6465const val MAX_HEIGHT = 100
@@ -131,7 +132,7 @@ fun PinnedMessageView(
131132 incomingBubbleColor,
132133 RoundedCornerShape (CORNER_RADIUS .dp)
133134 )
134- .padding(SPACE_16 .dp)
135+ .padding(SPACE_16 .dp, SPACE_0 .dp, SPACE_0 .dp, SPACE_16 .dp )
135136 .heightIn(max = MAX_HEIGHT .dp)
136137 .clickable(
137138 interactionSource = interactionSource,
@@ -164,23 +165,24 @@ fun PinnedMessageView(
164165 Column (
165166 modifier = Modifier
166167 .verticalScroll(scrollState)
167- .padding(end = 40 .dp)
168+ .padding(top = SPACE_16 .dp, end = 40 .dp)
168169 ) {
169170 Text (
170171 text = pinnedHeadline,
171- color = MaterialTheme . colorScheme.onSurfaceVariant,
172+ color = colorScheme.onSurfaceVariant,
172173 style = MaterialTheme .typography.labelMedium
173174 )
174175 Spacer (modifier = Modifier .height(4 .dp))
175176 Text (
176177 text = message.text,
177- color = MaterialTheme . colorScheme.onSurface
178+ color = colorScheme.onSurface
178179 )
179180 }
180181
181182 Box (
182183 modifier = Modifier
183184 .align(Alignment .TopEnd )
185+ .padding(top = 2 .dp)
184186 ) {
185187 IconButton (onClick = { expanded = true }) {
186188 Icon (
@@ -238,12 +240,6 @@ fun PinnedMessageView(
238240 }
239241}
240242
241- @Preview(name = " Dark Mode" , uiMode = android.content.res.Configuration .UI_MODE_NIGHT_YES )
242- @Composable
243- fun PinnedMessagePreviewDark () {
244- PinnedMessagePreview ()
245- }
246-
247243@Preview(name = " Long Content" )
248244@Composable
249245fun PinnedMessageLongContentPreview () {
@@ -255,6 +251,16 @@ fun PinnedMessageLongContentPreview() {
255251 )
256252}
257253
254+ @Preview(
255+ name = " Dark Mode / R-t-L" ,
256+ uiMode = android.content.res.Configuration .UI_MODE_NIGHT_YES ,
257+ locale = " ar"
258+ )
259+ @Composable
260+ fun PinnedMessagePreviewDarkRtl () {
261+ PinnedMessagePreview ()
262+ }
263+
258264@Suppress(" MagicNumber" )
259265@Preview(name = " Light Mode" )
260266@Composable
0 commit comments