From 0d65c4b06b372b3693901062030580a992db93d5 Mon Sep 17 00:00:00 2001 From: Han Yin Date: Fri, 18 Apr 2025 15:04:04 -0700 Subject: [PATCH] nit: extract app name into a constant value; remove unused onBackPressed callbacks --- .../java/com/example/llama/revamp/KleidiLlamaApplication.kt | 2 ++ .../example/llama/revamp/ui/components/NavigationDrawer.kt | 3 ++- .../com/example/llama/revamp/ui/screens/ConversationScreen.kt | 2 +- .../example/llama/revamp/ui/screens/ModelsManagementScreen.kt | 1 - .../example/llama/revamp/ui/screens/SettingsGeneralScreen.kt | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/KleidiLlamaApplication.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/KleidiLlamaApplication.kt index 2d5568bae3..287230b16c 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/KleidiLlamaApplication.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/KleidiLlamaApplication.kt @@ -3,5 +3,7 @@ package com.example.llama.revamp import android.app.Application import dagger.hilt.android.HiltAndroidApp +const val APP_NAME = "Kleidi LLama" + @HiltAndroidApp class KleidiLlamaApplication : Application() diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/NavigationDrawer.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/NavigationDrawer.kt index 2743eb2563..cba5293aa5 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/NavigationDrawer.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/NavigationDrawer.kt @@ -32,6 +32,7 @@ import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp +import com.example.llama.revamp.APP_NAME import com.example.llama.revamp.navigation.NavigationActions import kotlinx.coroutines.launch @@ -103,7 +104,7 @@ private fun DrawerContent( horizontalAlignment = Alignment.CenterHorizontally ) { Text( - text = "Kleidi LLaMA", + text = APP_NAME, style = MaterialTheme.typography.titleLarge, textAlign = TextAlign.Center ) diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/ConversationScreen.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/ConversationScreen.kt index 5d2fd9b74c..ff95861ee8 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/ConversationScreen.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/ConversationScreen.kt @@ -404,7 +404,7 @@ private fun ConversationInputField( modifier = Modifier .weight(1f) .padding(end = 8.dp), - placeholder = { Text("Message Kleidi LLaMA...") }, + placeholder = { Text("Message $APP_NAME...") }, maxLines = 5, enabled = isEnabled, colors = TextFieldDefaults.colors( diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/ModelsManagementScreen.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/ModelsManagementScreen.kt index 48e67d6f30..54ef7cad30 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/ModelsManagementScreen.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/ModelsManagementScreen.kt @@ -47,7 +47,6 @@ import com.example.llama.revamp.viewmodel.ModelsManagementViewModel */ @Composable fun ModelsManagementScreen( - onBackPressed: () -> Unit, onScaffoldEvent: (ScaffoldEvent) -> Unit, viewModel: ModelsManagementViewModel, ) { diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/SettingsGeneralScreen.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/SettingsGeneralScreen.kt index de5e46ced5..99ad7d49b2 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/SettingsGeneralScreen.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/SettingsGeneralScreen.kt @@ -21,6 +21,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.example.llama.revamp.APP_NAME import com.example.llama.revamp.viewmodel.PerformanceViewModel /** @@ -29,7 +30,6 @@ import com.example.llama.revamp.viewmodel.PerformanceViewModel @Composable fun SettingsGeneralScreen( performanceViewModel: PerformanceViewModel = hiltViewModel(), - onBackPressed: () -> Unit, ) { // Collect state from ViewModel val isMonitoringEnabled by performanceViewModel.isMonitoringEnabled.collectAsState() @@ -76,7 +76,7 @@ fun SettingsGeneralScreen( modifier = Modifier.padding(16.dp) ) { Text( - text = "Kleidi LLaMA", + text = APP_NAME, style = MaterialTheme.typography.titleLarge )