小优化
This commit is contained in:
1 parent
c88eb1868a
commit
a0e06eeed7
1 file changed
+26
-19
@@ -989,26 +989,33 @@ private fun ManageIconLibraryDialog(
|
||||
// Icon preview
|
||||
if (library.icons.isNotEmpty()) {
|
||||
Text(stringResource(Res.string.icon_lib_preview), fontSize = 13.sp, color = GlassTokens.subtext, fontWeight = FontWeight.Medium)
|
||||
LazyVerticalGrid(
|
||||
columns = GridCells.Fixed(5),
|
||||
modifier = Modifier.heightIn(min = 80.dp, max = 160.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(6.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(6.dp),
|
||||
Box(
|
||||
Modifier.fillMaxWidth()
|
||||
.heightIn(min = 80.dp, max = 160.dp)
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.border(0.6.dp, GlassTokens.glassBorder, RoundedCornerShape(16.dp))
|
||||
.padding(8.dp),
|
||||
) {
|
||||
items(library.icons) { icon ->
|
||||
Box(
|
||||
modifier = Modifier.aspectRatio(1f)
|
||||
.clip(RoundedCornerShape(8.dp))
|
||||
.border(0.6.dp, GlassTokens.glassBorder, RoundedCornerShape(8.dp))
|
||||
.padding(2.dp),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
LumaAsyncImage(
|
||||
model = ImageRequest.Builder(LocalContext.current).data(icon.url).crossfade(true).build(),
|
||||
contentDescription = icon.name,
|
||||
contentScale = ContentScale.Crop,
|
||||
modifier = Modifier.fillMaxSize().clip(RoundedCornerShape(6.dp)),
|
||||
)
|
||||
LazyVerticalGrid(
|
||||
columns = GridCells.Fixed(5),
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
horizontalArrangement = Arrangement.spacedBy(6.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(6.dp),
|
||||
) {
|
||||
items(library.icons) { icon ->
|
||||
Box(
|
||||
modifier = Modifier.aspectRatio(1f)
|
||||
.clip(RoundedCornerShape(12.dp))
|
||||
.border(0.6.dp, GlassTokens.glassBorder, RoundedCornerShape(12.dp)),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
LumaAsyncImage(
|
||||
model = ImageRequest.Builder(LocalContext.current).data(icon.url).crossfade(true).build(),
|
||||
contentDescription = icon.name,
|
||||
contentScale = ContentScale.Crop,
|
||||
modifier = Modifier.fillMaxSize().padding(4.dp).clip(RoundedCornerShape(10.dp)),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user