Skip to content

Your phone, on your command. Gotcha is world's first fully on-device AI copilot for Android that turns natural language into real device actions — safely.

feat: add greeting pool and navigation drawer content for UI revamp

Durganshu Mishrae7ee593c6c00
diff --git a/app/src/main/java/com/gotcha/ui/AppDrawer.kt b/app/src/main/java/com/gotcha/ui/AppDrawer.kt
new file mode 100644
index 0000000..3908acf
--- /dev/null
+++ b/app/src/main/java/com/gotcha/ui/AppDrawer.kt
@@ -0,0 +1,126 @@
+package com.gotcha.ui
+
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.width
+import androidx.compose.foundation.lazy.LazyColumn
+import androidx.compose.foundation.lazy.items
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Add
+import androidx.compose.material.icons.filled.Settings
+import androidx.compose.material.icons.outlined.Delete
+import androidx.compose.material3.AlertDialog
+import androidx.compose.material3.Button
+import androidx.compose.material3.ButtonDefaults
+import androidx.compose.material3.HorizontalDivider
+import androidx.compose.material3.Icon
+import androidx.compose.material3.IconButton
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.ModalDrawerSheet
+import androidx.compose.material3.NavigationDrawerItem
+import androidx.compose.material3.NavigationDrawerItemDefaults
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextButton
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.text.style.TextOverflow
+import androidx.compose.ui.unit.dp
+import com.gotcha.data.ChatSession
+
+@Composable
+fun AppDrawerContent(
+ sessions: List<ChatSession>,
+ activeSessionId: String?,
+ onNewChat: () -> Unit,
+ onSessionClick: (String) -> Unit,
+ onDeleteSession: (String) -> Unit,
+ onOpenSettings: () -> Unit
+) {
+ var sessionToDelete by remember { mutableStateOf<String?>(null) }
+
+ ModalDrawerSheet(modifier = Modifier.width(300.dp)) {
+ Column(modifier = Modifier.fillMaxSize()) {
+ Spacer(modifier = Modifier.height(12.dp))
+ NavigationDrawerItem(
+ label = { Text("New Chat") },
+ icon = { Icon(Icons.Default.Add, contentDescription = null) },
+ selected = false,
+ onClick = onNewChat,
+ modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding)
+ )
+ HorizontalDivider(modifier = Modifier.padding(vertical = 8.dp))
+ Text(
+ "Recent chats",
+ style = MaterialTheme.typography.labelMedium,
+ color = MaterialTheme.colorScheme.onSurfaceVariant,
+ modifier = Modifier.padding(horizontal = 28.dp, vertical = 4.dp)
+ )
+ LazyColumn(modifier = Modifier.weight(1f)) {
+ items(sessions, key = { it.id }) { session ->
+ NavigationDrawerItem(
+ label = {
+ Text(
+ session.title,
+ maxLines = 1,
+ overflow = TextOverflow.Ellipsis
+ )
+ },
+ selected = session.id == activeSessionId,
+ onClick = { onSessionClick(session.id) },
+ badge = {
+ IconButton(onClick = { sessionToDelete = session.id }) {
+ Icon(
+ Icons.Outlined.Delete,
+ contentDescription = "Delete chat",
+ tint = MaterialTheme.colorScheme.onSurfaceVariant
+ )
+ }
+ },
+ modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding)
+ )
+ }
+ }
+ HorizontalDivider()
+ NavigationDrawerItem(
+ label = { Text("Settings") },
+ icon = { Icon(Icons.Default.Settings, contentDescription = null) },
+ selected = false,
+ onClick = onOpenSettings,
+ modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding)
+ )
+ Spacer(modifier = Modifier.height(12.dp))
+ }
+ }
+
+ sessionToDelete?.let { id ->
+ val title = sessions.find { it.id == id }?.title ?: "this chat"
+ AlertDialog(
+ onDismissRequest = { sessionToDelete = null },
+ title = { Text("Delete Chat?") },
+ text = { Text("Are you sure you want to permanently delete \"$title\"? This action cannot be undone.") },
+ confirmButton = {
+ Button(
+ onClick = {
+ onDeleteSession(id)
+ sessionToDelete = null
+ },
+ colors = ButtonDefaults.buttonColors(containerColor = MaterialTheme.colorScheme.error)
+ ) {
+ Text("Delete")
+ }
+ },
+ dismissButton = {
+ TextButton(onClick = { sessionToDelete = null }) {
+ Text("Cancel")
+ }
+ }
+ )
+ }
+}
diff --git a/app/src/main/java/com/gotcha/ui/Greetings.kt b/app/src/main/java/com/gotcha/ui/Greetings.kt
new file mode 100644
index 0000000..ae081d9
--- /dev/null
+++ b/app/src/main/java/com/gotcha/ui/Greetings.kt
@@ -0,0 +1,25 @@
+package com.gotcha.ui
+
+/** Gender-neutral greetings for the empty home screen; one is chosen per new session. */
+internal val HOME_GREETINGS = listOf(
+ "Hello, how can I help you?",
+ "What can I do for you today?",
+ "Ready when you are.",
+ "What's on your mind?",
+ "How can I make your day easier?",
+ "Need a hand with something?",
+ "Let's get something done.",
+ "What would you like to do?",
+ "I'm all ears — what do you need?",
+ "Where should we start?",
+ "Got a task for me?",
+ "Happy to help — what's up?",
+ "What shall we tackle first?",
+ "Ask me anything.",
+ "Here to help, whenever you're ready.",
+ "What's next on your list?",
+ "Let's make something happen.",
+ "How can I assist you right now?",
+ "Tell me what you need.",
+ "At your service — what can I do?"
+)