小调整

This commit is contained in:
beyond committed 2026-09-05 20:50:19 +08:00
1 parent a0e06eeed7
commit ff2724a302
2 files changed
+11 -12

No files matched your search

@@ -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<List<IconItem>>(emptyList()) }
var query by remember { mutableStateOf(TextFieldValue("")) }
var isLoading by remember { mutableStateOf(false) }
var isLoading by remember { mutableStateOf(true) }
var error by remember { mutableStateOf<String?>(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(
@@ -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()
}
}
}