Use material icons in chat app bar
This commit is contained in:
1 parent
15e57ad1f9
commit
4bee45c8e0
4 files changed
+24
-8
No files matched your search
@@ -53,6 +53,7 @@ kotlin {
|
||||
implementation(libs.compose.runtime)
|
||||
implementation(libs.compose.foundation)
|
||||
implementation(libs.compose.material3)
|
||||
implementation(libs.compose.material.iconsExtended)
|
||||
implementation(libs.compose.ui)
|
||||
implementation(libs.compose.components.resources)
|
||||
implementation(libs.compose.uiToolingPreview)
|
||||
|
||||
@@ -3,14 +3,18 @@ package cn.xiaobai.openclawapp
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.AttachFile
|
||||
import androidx.compose.material.icons.filled.Refresh
|
||||
import androidx.compose.material3.CenterAlignedTopAppBar
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.NavigationBar
|
||||
import androidx.compose.material3.NavigationBarItem
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -149,15 +153,21 @@ private fun OpenClawRoot(appState: OpenClawAppState) {
|
||||
)
|
||||
},
|
||||
navigationIcon = {
|
||||
TextButton(onClick = appState::closeChat) {
|
||||
Text("←")
|
||||
IconButton(onClick = appState::closeChat) {
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
||||
contentDescription = "返回",
|
||||
)
|
||||
}
|
||||
},
|
||||
actions = {
|
||||
TextButton(onClick = { pickAttachment() }) {
|
||||
Text("+")
|
||||
IconButton(onClick = { pickAttachment() }) {
|
||||
Icon(
|
||||
imageVector = Icons.Filled.AttachFile,
|
||||
contentDescription = "附件",
|
||||
)
|
||||
}
|
||||
TextButton(onClick = {
|
||||
IconButton(onClick = {
|
||||
activeSession?.id?.let { sessionId ->
|
||||
coroutineScope.launch {
|
||||
appState.clearSyncError()
|
||||
@@ -165,7 +175,10 @@ private fun OpenClawRoot(appState: OpenClawAppState) {
|
||||
}
|
||||
}
|
||||
}) {
|
||||
Text(if (appState.repository.streamStatusFor(route.sessionId) == "failed") "⟳" else "↻")
|
||||
Icon(
|
||||
imageVector = Icons.Filled.Refresh,
|
||||
contentDescription = if (appState.repository.streamStatusFor(route.sessionId) == "failed") "重连" else "刷新",
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
@@ -452,3 +452,4 @@ Android/iOS App
|
||||
- 2026-03-07:信息架构继续做减法:底部导航先从三栏收成两栏(会话 / 设置),把原状态页的核心诊断信息并进设置页的“诊断信息”分组,避免低频诊断页长期占一个一级入口。
|
||||
- 2026-03-07:继续给聊天页降噪:正常在线时顶部状态条不再常驻,只在同步 / 发送 / 恢复 / 断流等需要用户感知时才显示;状态文案改成更短的移动端提示,同时去掉用户消息“已发送”和附件“已完成”这类长期占位但信息价值不高的状态露出。
|
||||
- 2026-03-07:会话页顶栏操作再收成图标化按钮:返回 / 附件 / 刷新不再显示整词文本,而是先用轻量符号按钮(← / + / ↻/⟳)表达,减少顶栏横向拥挤;后续如果需要,再统一切成正式 Material Icons 资源。
|
||||
- 2026-03-07:把会话页顶栏的占位符号按钮升级为正式 Material Icons:返回改为 `ArrowBack`,附件改为 `AttachFile`,刷新/重连改为 `Refresh`,让导航头从临时占位过渡到更像成品的视觉语义。
|
||||
@@ -32,6 +32,7 @@ androidx-lifecycle-runtimeCompose = { module = "org.jetbrains.androidx.lifecycle
|
||||
compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "composeMultiplatform" }
|
||||
compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "composeMultiplatform" }
|
||||
compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "material3" }
|
||||
compose-material-iconsExtended = { module = "org.jetbrains.compose.material:material-icons-extended", version.ref = "composeMultiplatform" }
|
||||
compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "composeMultiplatform" }
|
||||
compose-components-resources = { module = "org.jetbrains.compose.components:components-resources", version.ref = "composeMultiplatform" }
|
||||
compose-uiToolingPreview = { module = "org.jetbrains.compose.ui:ui-tooling-preview", version.ref = "composeMultiplatform" }
|
||||
|
||||
Reference in new issue
Block a user