From ff2724a302d9ccfefc8991b0736441095c4e4aea Mon Sep 17 00:00:00 2001
From: beyond
Date: Sat, 5 Sep 2026 20:50:19 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../example/myapplication/screens/LibraryScreen.kt | 13 +++++--------
.../myapplication/ui/design/LumaComponents.kt | 10 ++++++----
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/app/src/main/kotlin/com/example/myapplication/screens/LibraryScreen.kt b/app/src/main/kotlin/com/example/myapplication/screens/LibraryScreen.kt
index f26e886..54aa8ed 100644
--- a/app/src/main/kotlin/com/example/myapplication/screens/LibraryScreen.kt
+++ b/app/src/main/kotlin/com/example/myapplication/screens/LibraryScreen.kt
@@ -188,7 +188,7 @@ private fun ServerCard(server: EmbyServer, tint: Color, nowMillis: Long, onClick
padding = PaddingValues(0.dp),
highlight = false,
) {
- Column(modifier = Modifier.fillMaxWidth().background(pressBg).padding(horizontal = 12.dp, vertical = 8.dp)) {
+ Column(modifier = Modifier.fillMaxWidth().background(pressBg).padding(horizontal = 12.dp, vertical = 12.dp)) {
Row(verticalAlignment = Alignment.CenterVertically) {
if (server.iconUrl.isNotBlank()) {
LumaAsyncImage(model = ImageRequest.Builder(LocalContext.current).data(server.iconUrl).crossfade(true).build(), contentDescription = null, modifier = Modifier.size(36.dp).clip(RoundedCornerShape(10.dp)), contentScale = ContentScale.Crop)
@@ -445,12 +445,8 @@ fun LibraryScreen(
},
height = 200.dp,
autoPlaceAroundAnchor = true,
+ anchorGap = 1.dp,
bottomInset = 86.dp,
- containerColor = if (GlassTokens.isDark) {
- Color(0xFF141A22).copy(alpha = 0.88f)
- } else {
- Color(0xFFE5EBF2).copy(alpha = 0.90f)
- },
) {
GlassPopupItem(
text = stringResource(Res.string.server_edit),
@@ -1256,7 +1252,7 @@ private fun IconPickerDialog(
) {
var allIcons by remember { mutableStateOf>(emptyList()) }
var query by remember { mutableStateOf(TextFieldValue("")) }
- var isLoading by remember { mutableStateOf(false) }
+ var isLoading by remember { mutableStateOf(true) }
var error by remember { mutableStateOf(null) }
val scope = rememberCoroutineScope()
val filteredIcons = remember(allIcons, query) {
@@ -1304,7 +1300,7 @@ private fun IconPickerDialog(
.lumaGlass(
radius = 14.dp,
level = LumaGlassLevel.Regular,
- tint = GlassTokens.glassFill,
+ tint = Color.Transparent,
borderColor = GlassTokens.glassBorder,
shadowElevation = 0.dp,
highlight = false,
@@ -1429,6 +1425,7 @@ private fun IconPickerDialog(
contentDescription = icon.name,
modifier = Modifier.fillMaxSize().padding(4.dp).clip(RoundedCornerShape(10.dp)),
contentScale = ContentScale.Crop,
+ showLoadingPlaceholder = false,
)
if (isSelected) {
Box(
diff --git a/app/src/main/kotlin/com/example/myapplication/ui/design/LumaComponents.kt b/app/src/main/kotlin/com/example/myapplication/ui/design/LumaComponents.kt
index 3419e00..a717261 100644
--- a/app/src/main/kotlin/com/example/myapplication/ui/design/LumaComponents.kt
+++ b/app/src/main/kotlin/com/example/myapplication/ui/design/LumaComponents.kt
@@ -81,8 +81,10 @@ fun LumaAsyncImage(
contentDescription: String?,
modifier: Modifier = Modifier,
contentScale: ContentScale = ContentScale.Crop,
+ showLoadingPlaceholder: Boolean = true,
) {
val fallback = ColorPainter(LumaColors.backgroundElevated)
+ val loadingPlaceholder = if (showLoadingPlaceholder) fallback else ColorPainter(Color.Transparent)
val imageKey = (model as? ImageRequest)?.data ?: model
var imageState by remember(imageKey) {
mutableStateOf(if (model == null) LumaImageState.Error else LumaImageState.Loading)
@@ -93,16 +95,16 @@ fun LumaAsyncImage(
contentDescription = contentDescription,
contentScale = contentScale,
modifier = Modifier.fillMaxSize(),
- placeholder = fallback,
- error = fallback,
+ placeholder = loadingPlaceholder,
+ error = loadingPlaceholder,
onLoading = { imageState = LumaImageState.Loading },
onSuccess = { imageState = LumaImageState.Success },
onError = { imageState = LumaImageState.Error },
)
when (imageState) {
- LumaImageState.Loading -> LumaImageLoadingPlaceholder()
+ LumaImageState.Loading -> if (showLoadingPlaceholder) LumaImageLoadingPlaceholder()
LumaImageState.Success -> Unit
- LumaImageState.Error -> LumaImageErrorPlaceholder()
+ LumaImageState.Error -> if (showLoadingPlaceholder) LumaImageErrorPlaceholder()
}
}
}