Android: reorganize menu - add Share screen, collapse Session/Thinking into Settings
- Added Share screen option (TODO: implement) - Session and Thinking now under collapsible 'Settings' submenu - Cleaner top-level menu: Camera/Photos/Files, Share screen, Settings, Refresh
This commit is contained in:
parent
3e57ca5d72
commit
bf4bd9604c
@ -35,7 +35,9 @@ import androidx.compose.material.icons.filled.Mic
|
||||
import androidx.compose.material.icons.filled.Refresh
|
||||
import androidx.compose.material.icons.filled.Send
|
||||
import androidx.compose.material.icons.filled.Settings
|
||||
import androidx.compose.material.icons.automirrored.filled.ScreenShare
|
||||
import androidx.compose.material.icons.filled.Stop
|
||||
import androidx.compose.material.icons.filled.Tune
|
||||
import androidx.compose.material3.DropdownMenu
|
||||
import androidx.compose.material3.DropdownMenuItem
|
||||
import androidx.compose.material3.FilledTonalIconButton
|
||||
@ -80,6 +82,7 @@ fun ChatComposer(
|
||||
onOpenCamera: () -> Unit = {},
|
||||
onPickImages: () -> Unit,
|
||||
onPickFiles: () -> Unit = {},
|
||||
onShareScreen: () -> Unit = {},
|
||||
onRemoveAttachment: (id: String) -> Unit,
|
||||
onSetThinkingLevel: (level: String) -> Unit,
|
||||
onSelectSession: (sessionKey: String) -> Unit,
|
||||
@ -190,30 +193,55 @@ fun ChatComposer(
|
||||
color = Color.White.copy(alpha = 0.15f),
|
||||
)
|
||||
|
||||
// Session selector
|
||||
// Share screen
|
||||
DropdownMenuItem(
|
||||
text = { Text("Session", color = Color.White) },
|
||||
text = { Text("Share screen", color = Color.White) },
|
||||
onClick = {
|
||||
showMenu = false
|
||||
showSessionMenu = true
|
||||
onShareScreen()
|
||||
},
|
||||
leadingIcon = { Icon(Icons.Default.Settings, contentDescription = null, tint = Color.White.copy(alpha = 0.8f)) },
|
||||
trailingIcon = { Text(currentSessionLabel, color = Color.White.copy(alpha = 0.6f), style = MaterialTheme.typography.bodySmall) },
|
||||
leadingIcon = { Icon(Icons.AutoMirrored.Filled.ScreenShare, contentDescription = null, tint = Color.White.copy(alpha = 0.8f)) },
|
||||
)
|
||||
|
||||
// Thinking level
|
||||
// Settings (Session & Thinking)
|
||||
var showSettingsSubmenu by remember { mutableStateOf(false) }
|
||||
DropdownMenuItem(
|
||||
text = { Text("Thinking", color = Color.White) },
|
||||
text = { Text("Settings", color = Color.White) },
|
||||
onClick = {
|
||||
showMenu = false
|
||||
showThinkingMenu = true
|
||||
showSettingsSubmenu = !showSettingsSubmenu
|
||||
},
|
||||
leadingIcon = {
|
||||
Text("🧠", style = MaterialTheme.typography.bodyLarge)
|
||||
leadingIcon = { Icon(Icons.Default.Tune, contentDescription = null, tint = Color.White.copy(alpha = 0.8f)) },
|
||||
trailingIcon = {
|
||||
Text(
|
||||
if (showSettingsSubmenu) "▲" else "▼",
|
||||
color = Color.White.copy(alpha = 0.5f),
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
},
|
||||
trailingIcon = { Text(thinkingLabel(thinkingLevel), color = Color.White.copy(alpha = 0.6f), style = MaterialTheme.typography.bodySmall) },
|
||||
)
|
||||
|
||||
if (showSettingsSubmenu) {
|
||||
// Session selector (indented)
|
||||
DropdownMenuItem(
|
||||
text = { Text(" Session", color = Color.White.copy(alpha = 0.9f)) },
|
||||
onClick = {
|
||||
showMenu = false
|
||||
showSessionMenu = true
|
||||
},
|
||||
trailingIcon = { Text(currentSessionLabel, color = Color.White.copy(alpha = 0.5f), style = MaterialTheme.typography.labelSmall) },
|
||||
)
|
||||
|
||||
// Thinking level (indented)
|
||||
DropdownMenuItem(
|
||||
text = { Text(" Thinking", color = Color.White.copy(alpha = 0.9f)) },
|
||||
onClick = {
|
||||
showMenu = false
|
||||
showThinkingMenu = true
|
||||
},
|
||||
trailingIcon = { Text(thinkingLabel(thinkingLevel), color = Color.White.copy(alpha = 0.5f), style = MaterialTheme.typography.labelSmall) },
|
||||
)
|
||||
}
|
||||
|
||||
HorizontalDivider(
|
||||
modifier = Modifier.padding(vertical = 8.dp),
|
||||
color = Color.White.copy(alpha = 0.15f),
|
||||
|
||||
@ -155,6 +155,7 @@ fun ChatSheetContent(viewModel: MainViewModel) {
|
||||
onOpenCamera = { openCamera() },
|
||||
onPickImages = { pickImages.launch("image/*") },
|
||||
onPickFiles = { pickFiles.launch(arrayOf("*/*")) },
|
||||
onShareScreen = { /* TODO: Trigger screen share - sends request to agent */ },
|
||||
onRemoveAttachment = { id -> attachments.removeAll { it.id == id } },
|
||||
onSetThinkingLevel = { level -> viewModel.setChatThinkingLevel(level) },
|
||||
onSelectSession = { key -> viewModel.switchChatSession(key) },
|
||||
|
||||
Loading…
Reference in New Issue
Block a user