Skip to content

Commit 175431f

Browse files
committed
Fix BigIcon preview.
1 parent 1a8d8a7 commit 175431f

File tree

1 file changed

+17
-6
lines changed
  • libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components

1 file changed

+17
-6
lines changed

libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/BigIcon.kt

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ package io.element.android.libraries.designsystem.components
1010
import androidx.compose.foundation.background
1111
import androidx.compose.foundation.layout.Arrangement
1212
import androidx.compose.foundation.layout.Box
13-
import androidx.compose.foundation.layout.Row
13+
import androidx.compose.foundation.layout.fillMaxSize
1414
import androidx.compose.foundation.layout.padding
1515
import androidx.compose.foundation.layout.size
16+
import androidx.compose.foundation.lazy.grid.GridCells
17+
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
18+
import androidx.compose.foundation.lazy.grid.items
1619
import androidx.compose.foundation.shape.RoundedCornerShape
1720
import androidx.compose.material.icons.Icons
1821
import androidx.compose.material.icons.filled.CatchingPokemon
@@ -142,11 +145,19 @@ object BigIcon {
142145

143146
@PreviewsDayNight
144147
@Composable
145-
internal fun BigIconPreview() {
146-
ElementPreview {
147-
Row(horizontalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.padding(10.dp)) {
148-
val provider = BigIconStyleProvider()
149-
for (style in provider.values) {
148+
internal fun BigIconPreview() = ElementPreview {
149+
LazyVerticalGrid(
150+
modifier = Modifier
151+
.fillMaxSize()
152+
.padding(10.dp),
153+
columns = GridCells.Adaptive(minSize = 64.dp),
154+
horizontalArrangement = Arrangement.spacedBy(10.dp),
155+
verticalArrangement = Arrangement.spacedBy(10.dp),
156+
) {
157+
items(BigIconStyleProvider().values.toList()) { style ->
158+
Box(
159+
contentAlignment = Alignment.Center
160+
) {
150161
BigIcon(style = style)
151162
}
152163
}

0 commit comments

Comments
 (0)