Android: integrated chat + smaller orb at bottom
- Reduced orb size from 360dp to 200dp - Moved orb to bottom of screen - Chat messages display above the orb (max 400dp height) - Cleaner assistant UI with chat and PTT in one view
This commit is contained in:
parent
69ba01468c
commit
9c059906fe
@ -24,6 +24,9 @@ import androidx.compose.foundation.layout.Box
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.WindowInsets
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
import androidx.compose.foundation.layout.WindowInsetsSides
|
import androidx.compose.foundation.layout.WindowInsetsSides
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.heightIn
|
||||||
|
import androidx.compose.foundation.layout.navigationBars
|
||||||
import androidx.compose.foundation.layout.only
|
import androidx.compose.foundation.layout.only
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
@ -264,16 +267,45 @@ fun RootScreen(viewModel: MainViewModel) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always show the orb as a PTT button - pulses when active, static when inactive
|
// Chat overlay + PTT orb at bottom
|
||||||
Popup(alignment = Alignment.Center, properties = PopupProperties(focusable = false)) {
|
Popup(alignment = Alignment.BottomCenter, properties = PopupProperties(focusable = false)) {
|
||||||
TalkOrbOverlay(
|
Column(
|
||||||
seamColor = seamColor,
|
modifier = Modifier
|
||||||
statusText = talkStatusText,
|
.fillMaxWidth()
|
||||||
isListening = talkIsListening,
|
.windowInsetsPadding(WindowInsets.navigationBars)
|
||||||
isSpeaking = talkIsSpeaking,
|
.padding(bottom = 24.dp),
|
||||||
isActive = talkEnabled,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
onTap = { viewModel.setTalkEnabled(!talkEnabled) },
|
) {
|
||||||
)
|
// Chat messages above the orb
|
||||||
|
val messages by viewModel.chatMessages.collectAsState()
|
||||||
|
val pendingRunCount by viewModel.pendingRunCount.collectAsState()
|
||||||
|
val pendingToolCalls by viewModel.chatPendingToolCalls.collectAsState()
|
||||||
|
val streamingText by viewModel.chatStreamingAssistantText.collectAsState()
|
||||||
|
|
||||||
|
if (messages.isNotEmpty() || pendingRunCount > 0 || pendingToolCalls.isNotEmpty() || !streamingText.isNullOrBlank()) {
|
||||||
|
com.clawdbot.android.ui.chat.ChatMessageListCard(
|
||||||
|
messages = messages,
|
||||||
|
pendingRunCount = pendingRunCount,
|
||||||
|
pendingToolCalls = pendingToolCalls,
|
||||||
|
streamingAssistantText = streamingText,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.weight(1f, fill = false)
|
||||||
|
.heightIn(max = 400.dp)
|
||||||
|
.padding(horizontal = 16.dp, vertical = 8.dp),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// PTT orb
|
||||||
|
TalkOrbOverlay(
|
||||||
|
seamColor = seamColor,
|
||||||
|
statusText = talkStatusText,
|
||||||
|
isListening = talkIsListening,
|
||||||
|
isSpeaking = talkIsSpeaking,
|
||||||
|
isActive = talkEnabled,
|
||||||
|
onTap = { viewModel.setTalkEnabled(!talkEnabled) },
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val currentSheet = sheet
|
val currentSheet = sheet
|
||||||
|
|||||||
@ -79,7 +79,7 @@ fun TalkOrbOverlay(
|
|||||||
Box(contentAlignment = Alignment.Center) {
|
Box(contentAlignment = Alignment.Center) {
|
||||||
Canvas(
|
Canvas(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(360.dp)
|
.size(200.dp)
|
||||||
.clickable(
|
.clickable(
|
||||||
interactionSource = remember { MutableInteractionSource() },
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
indication = null, // No ripple - the orb itself is the feedback
|
indication = null, // No ripple - the orb itself is the feedback
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user