nit: extract app name into a constant value; remove unused onBackPressed callbacks

This commit is contained in:
Han Yin 2025-04-18 15:04:04 -07:00
parent 9f1d26ac95
commit 0d65c4b06b
5 changed files with 7 additions and 5 deletions

View File

@ -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()

View File

@ -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
)

View File

@ -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(

View File

@ -47,7 +47,6 @@ import com.example.llama.revamp.viewmodel.ModelsManagementViewModel
*/
@Composable
fun ModelsManagementScreen(
onBackPressed: () -> Unit,
onScaffoldEvent: (ScaffoldEvent) -> Unit,
viewModel: ModelsManagementViewModel,
) {

View File

@ -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
)