|
8 | 8 | package io.element.android.libraries.designsystem.theme.components |
9 | 9 |
|
10 | 10 | import androidx.annotation.DrawableRes |
| 11 | +import androidx.compose.foundation.layout.Arrangement |
| 12 | +import androidx.compose.foundation.layout.PaddingValues |
| 13 | +import androidx.compose.foundation.layout.fillMaxWidth |
| 14 | +import androidx.compose.foundation.lazy.grid.GridCells |
| 15 | +import androidx.compose.foundation.lazy.grid.LazyVerticalGrid |
11 | 16 | import androidx.compose.material3.LocalContentColor |
12 | 17 | import androidx.compose.runtime.Composable |
13 | 18 | import androidx.compose.ui.Modifier |
14 | 19 | import androidx.compose.ui.graphics.Color |
15 | 20 | import androidx.compose.ui.graphics.ImageBitmap |
16 | 21 | import androidx.compose.ui.graphics.painter.Painter |
17 | 22 | import androidx.compose.ui.graphics.vector.ImageVector |
| 23 | +import androidx.compose.ui.res.painterResource |
18 | 24 | import androidx.compose.ui.res.vectorResource |
19 | 25 | import androidx.compose.ui.tooling.preview.Preview |
| 26 | +import androidx.compose.ui.unit.dp |
20 | 27 | import io.element.android.compound.tokens.generated.CompoundIcons |
| 28 | +import io.element.android.libraries.designsystem.preview.ElementPreview |
21 | 29 | import io.element.android.libraries.designsystem.preview.ElementThemedPreview |
22 | 30 | import io.element.android.libraries.designsystem.preview.PreviewGroup |
23 | 31 |
|
@@ -134,3 +142,24 @@ fun Icon( |
134 | 142 | internal fun IconImageVectorPreview() = ElementThemedPreview { |
135 | 143 | Icon(imageVector = CompoundIcons.Close(), contentDescription = null) |
136 | 144 | } |
| 145 | + |
| 146 | +@Preview(group = PreviewGroup.Icons) |
| 147 | +@Composable |
| 148 | +internal fun AllIconsPreview() = ElementPreview { |
| 149 | + LazyVerticalGrid( |
| 150 | + modifier = Modifier.fillMaxWidth(), |
| 151 | + columns = GridCells.Adaptive(32.dp), |
| 152 | + contentPadding = PaddingValues(2.dp), |
| 153 | + verticalArrangement = Arrangement.spacedBy(2.dp), |
| 154 | + horizontalArrangement = Arrangement.spacedBy(2.dp) |
| 155 | + ) { |
| 156 | + CompoundIcons.allResIds.forEach { icon -> |
| 157 | + item { |
| 158 | + Icon( |
| 159 | + painter = painterResource(icon), |
| 160 | + contentDescription = null, |
| 161 | + ) |
| 162 | + } |
| 163 | + } |
| 164 | + } |
| 165 | +} |
0 commit comments