From 07dc93cd07882d8b42c233c8888069ba22ad025e Mon Sep 17 00:00:00 2001 From: BoatingCloud <1759888028@qq.com> Date: Fri, 28 Aug 2026 11:38:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E5=8F=A3=E7=8E=BB=E7=92=83=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E4=B8=8E=E7=95=8C=E9=9D=A2=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../myapplication/screens/HomeScreen.kt | 29 ------------------- .../example/myapplication/ui/LiquidGlass.kt | 11 ++++--- memory/2026-08-28.md | 6 ++++ memory/MEMORY.md | 1 + memory/lessons.md | 1 + memory/projects.md | 1 + 6 files changed, 16 insertions(+), 33 deletions(-) diff --git a/app/src/main/kotlin/com/example/myapplication/screens/HomeScreen.kt b/app/src/main/kotlin/com/example/myapplication/screens/HomeScreen.kt index c0f134b..d9e74c6 100644 --- a/app/src/main/kotlin/com/example/myapplication/screens/HomeScreen.kt +++ b/app/src/main/kotlin/com/example/myapplication/screens/HomeScreen.kt @@ -157,35 +157,6 @@ private fun homeAccentColor(): Color { return if (value == Color.Unspecified) GlassTokens.accent else value } -/* ---- Shared home UI state ---- */ -object HomeUiState { - var selectedLibrary by mutableStateOf(null) - var serverName by mutableStateOf("") - var immersiveSurfaceIsDark by mutableStateOf(false) -} - -/* ---- Top Bar ---- */ -@Composable -fun HomeTopBar(modifier: Modifier = Modifier) { - LiquidGlassTopBar(modifier) { - Row( - Modifier.fillMaxWidth().padding(horizontal = 18.dp, vertical = 12.dp), - verticalAlignment = Alignment.CenterVertically, - ) { - Box( - Modifier.size(38.dp).clip(CircleShape) - .background(Brush.linearGradient(listOf(Color(0xFF6EA8FF), Color(0xFF9B6BFF)))), - contentAlignment = Alignment.Center, - ) { - LumaIconView(LumaIcon.User, contentDescription = null, tint = Color.White, modifier = Modifier.size(22.dp)) - } - Column(Modifier.padding(start = 10.dp)) { - Text(text = stringResource(Res.string.home_media_center), color = GlassTokens.text, fontSize = 16.sp, fontWeight = FontWeight.SemiBold) - } - } - } -} - /* ---- Hero Carousel ---- */ @Composable private fun HeroCarousel( diff --git a/app/src/main/kotlin/com/example/myapplication/ui/LiquidGlass.kt b/app/src/main/kotlin/com/example/myapplication/ui/LiquidGlass.kt index 2d2e222..8fdefdf 100644 --- a/app/src/main/kotlin/com/example/myapplication/ui/LiquidGlass.kt +++ b/app/src/main/kotlin/com/example/myapplication/ui/LiquidGlass.kt @@ -66,6 +66,7 @@ import androidx.compose.ui.graphics.CompositingStrategy import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.geometry.Rect +import androidx.compose.ui.semantics.Role import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.res.stringResource import com.example.myapplication.R as Res @@ -290,7 +291,7 @@ fun SegmentedControl( GlassTokens.glassBorder.copy(alpha = selectedProgress * 0.9f), RoundedCornerShape(16.dp), ) - .clickable { onSelect(index) } + .clickable(role = Role.Button) { onSelect(index) } .padding(horizontal = 10.dp, vertical = 9.dp), contentAlignment = Alignment.Center, ) { @@ -350,9 +351,10 @@ fun GlassSearchField( ), modifier = Modifier.weight(1f).onFocusChanged { focused = it.isFocused }, decorationBox = { inner -> - if (value.isEmpty()) { - Text(text = placeholder, color = GlassTokens.subtext, fontSize = 15.sp) - } else { + Box { + if (value.isEmpty()) { + Text(text = placeholder, color = GlassTokens.subtext, fontSize = 15.sp) + } inner() } }, @@ -364,6 +366,7 @@ fun GlassSearchField( .clickable( indication = null, interactionSource = remember { MutableInteractionSource() }, + role = Role.Button, onClick = { onValueChange("") }, ), contentAlignment = Alignment.Center, diff --git a/memory/2026-08-28.md b/memory/2026-08-28.md index 837187d..a250071 100644 --- a/memory/2026-08-28.md +++ b/memory/2026-08-28.md @@ -27,3 +27,9 @@ 文件变更: ui/design/LumaDesignSystem.kt、ui/LiquidGlass.kt、screens/LibraryScreen.kt。 教训: 清理前以全仓库引用结果确认目标确实未被活动页面使用。 标签: #lumaplayer #liquid-glass #library #cleanup + +[PROJECT:lumaplayer] 最终收口与构建验证 +结论: 修复搜索框空值焦点绘制,补充分段/搜索/资源库操作语义,清理已确认无引用的 Home 与 Library 遗留 UI;Debug、Lint、Unit 和 API35 启动回归通过。 +文件变更: screens/HomeScreen.kt、screens/LibraryScreen.kt、ui/LiquidGlass.kt、ui/design/LumaComponents.kt、ui/design/LumaDesignSystem.kt 及 memory/*。 +教训: 参考素材和本地资料保持未跟踪,不随源码提交。 +标签: #lumaplayer #cleanup #accessibility #build diff --git a/memory/MEMORY.md b/memory/MEMORY.md index 6a11b27..c143afc 100644 --- a/memory/MEMORY.md +++ b/memory/MEMORY.md @@ -13,3 +13,4 @@ - 最新校验:修复降级玻璃高光覆盖内容、首页滚动状态恢复与重复详情/播放器导航;Debug/Lint/Unit 和 API35 模拟器启动回归成功。 - 最新校验:修复玻璃模式切换后的 Backdrop/source 与材质缓存刷新;设置页行组件、分组标题和子页返回栏统一;Debug/Lint/Unit 与 API35 模拟器液态↔毛玻璃切换回归成功。 - 最新收敛:降低统一玻璃边缘高光/白边,清理 `LibraryScreen` 无引用的旧图标库 UI;资源库列表/网格切换回归无崩溃。 +- 最终收口:修复搜索输入框空值焦点绘制、补充分段与资源库操作语义,清理 Home/Library 无引用遗留 UI;源码已完成构建并准备推送。 diff --git a/memory/lessons.md b/memory/lessons.md index 3f9f97b..d95bf5b 100644 --- a/memory/lessons.md +++ b/memory/lessons.md @@ -23,3 +23,4 @@ - 高:用户明确要求真实液态玻璃时,不能继续保留设备/模拟器安全门;当前仅保留 API 31+ 能力判断,底栏原生 Backdrop 必须先绘制容器与选中胶囊,再绘制清晰图标/文字,避免内容被二次采样覆盖。该取舍需在实体机 GPU 上继续验证 RenderThread 稳定性。 - 中:玻璃模式是全局 Compose 状态;涉及 `rememberLayerBackdrop` 或玻璃规格的缓存必须把 `AppTheme.glassMode` 纳入重建边界,否则设置副标题会变但材质不变。 - 低:清理页面遗留实现前必须用全仓库引用检索确认;私有且无调用的旧 UI 可以删除,活动页面保留原数据/弹窗实现。 +- 低:`BasicTextField` 的 `decorationBox` 无论是否为空都必须调用 `inner()`;占位文案应与真实输入内容叠放,否则会破坏焦点和光标绘制。 diff --git a/memory/projects.md b/memory/projects.md index d41efd7..a95e158 100644 --- a/memory/projects.md +++ b/memory/projects.md @@ -41,3 +41,4 @@ - 2026-08-28:按需求取消液态玻璃设备/模拟器安全门,API 31+ 液态模式直接进入 Kyant Backdrop 原生路径;底栏改为玻璃底层、选中胶囊、清晰内容的正确绘制顺序,主图标 40dp、搜索图标 44dp、文字 8sp;补充媒体卡片加载/成功/失败三态和统一按压反馈。`assembleDebug`、`lintDebug`、`testDebugUnitTest` 及 API35 模拟器液态/毛玻璃切换回归成功,未发现 RenderThread 崩溃。 - 2026-08-28:修复玻璃模式切换时 `LayerBackdrop` 与 `GlassSpec` 缓存未刷新问题;新增 `LumaSettingRow`、`LumaPageTopBar`、设置分组标题并补齐公共按钮语义。完整 Debug/Lint/Unit 成功,API35 模拟器切换液态→毛玻璃→液态成功且无 RenderThread 崩溃;参考素材仍未提交。 - 2026-08-28:收敛原生/降级玻璃边缘高光与白边,清理 `LibraryScreen` 中确认无引用的旧图标库 Section/Card/DetailDialog,并为资源库主要操作补充按钮语义;Debug/Lint/Unit 成功,模拟器资源库列表/网格切换无崩溃。 +- 2026-08-28:最终收口修复 `GlassSearchField` 空值时的真实输入框绘制,补充分段控件、搜索清除和资源库操作的按钮语义,删除 Home/Library 已确认无引用的遗留 UI;完整 Debug/Lint/Unit 与 API35 启动回归通过,准备提交推送。