diff --git a/examples/llama.android/app/src/main/java/com/example/llama/ui/components/ModelCards.kt b/examples/llama.android/app/src/main/java/com/example/llama/ui/components/ModelCards.kt index 25c768ea82..4261c82808 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/ui/components/ModelCards.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/ui/components/ModelCards.kt @@ -94,7 +94,7 @@ fun ModelCardCoreExpandable( ) false -> CardDefaults.cardColors() }, - elevation = CardDefaults.cardElevation(defaultElevation = 2.dp) + elevation = CardDefaults.cardElevation(defaultElevation = 12.dp) ) { Column( modifier = Modifier.padding(16.dp), diff --git a/examples/llama.android/app/src/main/java/com/example/llama/ui/components/ModelUnloadDialogHandler.kt b/examples/llama.android/app/src/main/java/com/example/llama/ui/components/ModelUnloadDialogHandler.kt index 714a1fb712..b203c442ed 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/ui/components/ModelUnloadDialogHandler.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/ui/components/ModelUnloadDialogHandler.kt @@ -30,6 +30,7 @@ import com.example.llama.viewmodel.UnloadModelState */ @Composable fun ModelUnloadDialogHandler( + message: String, unloadModelState: UnloadModelState, onUnloadConfirmed: (onNavigateBack: () -> Unit) -> Unit, onUnloadDismissed: () -> Unit, @@ -38,15 +39,17 @@ fun ModelUnloadDialogHandler( when (unloadModelState) { is UnloadModelState.Confirming -> { UnloadModelDialog( + message = message, onConfirm = { onUnloadConfirmed(onNavigateBack) }, onDismiss = onUnloadDismissed, - isUnloading = false + isUnloading = false, ) } is UnloadModelState.Unloading -> { UnloadModelDialog( + message = message, onConfirm = { onUnloadConfirmed(onNavigateBack) }, @@ -72,6 +75,7 @@ fun ModelUnloadDialogHandler( @Composable private fun UnloadModelDialog( + message: String, onConfirm: () -> Unit, onDismiss: () -> Unit, isUnloading: Boolean = false @@ -86,10 +90,7 @@ private fun UnloadModelDialog( }, text = { Column { - Text( - "Going back will unload the current model. " + - "Any unsaved conversation will be lost." - ) + Text(message) if (isUnloading) { Spacer(modifier = Modifier.height(16.dp)) diff --git a/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/BenchmarkScreen.kt b/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/BenchmarkScreen.kt index b5cdddb383..b14bc92208 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/BenchmarkScreen.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/BenchmarkScreen.kt @@ -178,6 +178,7 @@ fun BenchmarkScreen( // Unload confirmation dialog ModelUnloadDialogHandler( + message = "Going back will unload the current model and clear all the benchmark results.", unloadModelState = unloadDialogState, onUnloadConfirmed = { viewModel.onUnloadConfirmed(onNavigateBack) }, onUnloadDismissed = { viewModel.onUnloadDismissed() }, diff --git a/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/ConversationScreen.kt b/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/ConversationScreen.kt index 1c680e67b8..1cabc0d3ee 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/ConversationScreen.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/ConversationScreen.kt @@ -205,6 +205,7 @@ fun ConversationScreen( // Unload confirmation dialog ModelUnloadDialogHandler( + message = "Going back will unload the current model and clear the whole conversation.", unloadModelState = unloadDialogState, onUnloadConfirmed = { viewModel.onUnloadConfirmed(onNavigateBack) }, onUnloadDismissed = { viewModel.onUnloadDismissed() }, diff --git a/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/ModelLoadingScreen.kt b/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/ModelLoadingScreen.kt index cb70888408..a887b9924d 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/ModelLoadingScreen.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/ModelLoadingScreen.kt @@ -83,7 +83,6 @@ fun ModelLoadingScreen( val selectedModel by viewModel.selectedModel.collectAsState() val presetPrompts by viewModel.presetPrompts.collectAsState() val recentPrompts by viewModel.recentPrompts.collectAsState() - val unloadDialogState by viewModel.unloadModelState.collectAsState() // UI states var isModelCardExpanded by remember { mutableStateOf(false) } @@ -385,14 +384,6 @@ fun ModelLoadingScreen( } } } - - // Unload confirmation dialog - ModelUnloadDialogHandler( - unloadModelState = unloadDialogState, - onUnloadConfirmed = { viewModel.onUnloadConfirmed(onNavigateBack) }, - onUnloadDismissed = { viewModel.onUnloadDismissed() }, - onNavigateBack = onNavigateBack, - ) } @Composable diff --git a/examples/llama.android/app/src/main/java/com/example/llama/viewmodel/ConversationViewModel.kt b/examples/llama.android/app/src/main/java/com/example/llama/viewmodel/ConversationViewModel.kt index c650caef4c..106bc60f67 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/viewmodel/ConversationViewModel.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/viewmodel/ConversationViewModel.kt @@ -30,7 +30,7 @@ class ConversationViewModel @Inject constructor( val systemPrompt = conversationService.systemPrompt // UI state: Model card - private val _showModelCard = MutableStateFlow(true) + private val _showModelCard = MutableStateFlow(false) val showModelCard = _showModelCard.asStateFlow() fun toggleModelCard(show: Boolean) {