From 73330596aecca131efd6aa6d3e5b94eb4eefa09d Mon Sep 17 00:00:00 2001 From: Han Yin Date: Mon, 21 Apr 2025 13:43:52 -0700 Subject: [PATCH] nit: move scaffold related UI components into a separate package --- .../com/example/llama/revamp/MainActivity.kt | 16 ++++++++-------- .../{components => scaffold}/AnimatedNavHost.kt | 2 +- .../ui/{components => scaffold}/AppScaffold.kt | 2 +- .../ui/{components => scaffold}/BottomAppBars.kt | 11 +++++------ .../{components => scaffold}/NavigationDrawer.kt | 9 +++++---- .../ui/{components => scaffold}/TopAppBars.kt | 2 +- .../revamp/ui/screens/ModelLoadingScreen.kt | 2 +- .../revamp/ui/screens/ModelsManagementScreen.kt | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) rename examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/{components => scaffold}/AnimatedNavHost.kt (98%) rename examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/{components => scaffold}/AppScaffold.kt (98%) rename examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/{components => scaffold}/BottomAppBars.kt (98%) rename examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/{components => scaffold}/NavigationDrawer.kt (94%) rename examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/{components => scaffold}/TopAppBars.kt (99%) diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/MainActivity.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/MainActivity.kt index 8e104fbecb..4e74d46b18 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/MainActivity.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/MainActivity.kt @@ -29,14 +29,14 @@ import androidx.navigation.navArgument import com.example.llama.revamp.engine.ModelLoadingMetrics import com.example.llama.revamp.navigation.AppDestinations import com.example.llama.revamp.navigation.NavigationActions -import com.example.llama.revamp.ui.components.AnimatedNavHost -import com.example.llama.revamp.ui.components.AppNavigationDrawer -import com.example.llama.revamp.ui.components.AppScaffold -import com.example.llama.revamp.ui.components.BottomBarConfig -import com.example.llama.revamp.ui.components.NavigationIcon -import com.example.llama.revamp.ui.components.ScaffoldConfig -import com.example.llama.revamp.ui.components.ScaffoldEvent -import com.example.llama.revamp.ui.components.TopBarConfig +import com.example.llama.revamp.ui.scaffold.AnimatedNavHost +import com.example.llama.revamp.ui.scaffold.AppNavigationDrawer +import com.example.llama.revamp.ui.scaffold.AppScaffold +import com.example.llama.revamp.ui.scaffold.BottomBarConfig +import com.example.llama.revamp.ui.scaffold.NavigationIcon +import com.example.llama.revamp.ui.scaffold.ScaffoldConfig +import com.example.llama.revamp.ui.scaffold.ScaffoldEvent +import com.example.llama.revamp.ui.scaffold.TopBarConfig import com.example.llama.revamp.ui.screens.BenchmarkScreen import com.example.llama.revamp.ui.screens.ConversationScreen import com.example.llama.revamp.ui.screens.ModelLoadingScreen diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/AnimatedNavHost.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/AnimatedNavHost.kt similarity index 98% rename from examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/AnimatedNavHost.kt rename to examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/AnimatedNavHost.kt index 273032e009..eb2e32e3c0 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/AnimatedNavHost.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/AnimatedNavHost.kt @@ -1,4 +1,4 @@ -package com.example.llama.revamp.ui.components +package com.example.llama.revamp.ui.scaffold import androidx.compose.animation.AnimatedContentTransitionScope import androidx.compose.animation.core.LinearOutSlowInEasing diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/AppScaffold.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/AppScaffold.kt similarity index 98% rename from examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/AppScaffold.kt rename to examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/AppScaffold.kt index 5f4b5f3214..1c034b2a6a 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/AppScaffold.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/AppScaffold.kt @@ -1,4 +1,4 @@ -package com.example.llama.revamp.ui.components +package com.example.llama.revamp.ui.scaffold import androidx.compose.foundation.layout.PaddingValues import androidx.compose.material3.Scaffold diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/BottomAppBars.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/BottomAppBars.kt similarity index 98% rename from examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/BottomAppBars.kt rename to examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/BottomAppBars.kt index 698ab2eac7..b611277a12 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/BottomAppBars.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/BottomAppBars.kt @@ -1,4 +1,4 @@ -package com.example.llama.revamp.ui.components +package com.example.llama.revamp.ui.scaffold import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size @@ -37,7 +37,6 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import com.example.llama.R import com.example.llama.revamp.data.model.ModelInfo -import com.example.llama.revamp.ui.components.BottomBarConfig.ModelsManagement import com.example.llama.revamp.viewmodel.ModelSortOrder /** @@ -253,10 +252,10 @@ fun ModelSelectionBottomBar( @Composable fun ModelsManagementBottomBar( - sorting: ModelsManagement.SortingConfig, - filtering: ModelsManagement.FilteringConfig, - selection: ModelsManagement.SelectionConfig, - importing: ModelsManagement.ImportConfig + sorting: BottomBarConfig.ModelsManagement.SortingConfig, + filtering: BottomBarConfig.ModelsManagement.FilteringConfig, + selection: BottomBarConfig.ModelsManagement.SelectionConfig, + importing: BottomBarConfig.ModelsManagement.ImportConfig ) { BottomAppBar( actions = { 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/scaffold/NavigationDrawer.kt similarity index 94% rename from examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/NavigationDrawer.kt rename to examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/NavigationDrawer.kt index cba5293aa5..680304a45c 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/scaffold/NavigationDrawer.kt @@ -1,4 +1,4 @@ -package com.example.llama.revamp.ui.components +package com.example.llama.revamp.ui.scaffold import androidx.activity.compose.BackHandler import androidx.compose.foundation.clickable @@ -33,6 +33,7 @@ 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.AppDestinations import com.example.llama.revamp.navigation.NavigationActions import kotlinx.coroutines.launch @@ -132,7 +133,7 @@ private fun DrawerContent( DrawerNavigationItem( icon = Icons.Default.Home, label = "Home", - isSelected = currentRoute == com.example.llama.revamp.navigation.AppDestinations.MODEL_SELECTION_ROUTE, + isSelected = currentRoute == AppDestinations.MODEL_SELECTION_ROUTE, onClick = { onNavigate { navigationActions.navigateToModelSelection() } } ) @@ -149,14 +150,14 @@ private fun DrawerContent( DrawerNavigationItem( icon = Icons.Default.Settings, label = "General Settings", - isSelected = currentRoute == com.example.llama.revamp.navigation.AppDestinations.SETTINGS_GENERAL_ROUTE, + isSelected = currentRoute == AppDestinations.SETTINGS_GENERAL_ROUTE, onClick = { onNavigate { navigationActions.navigateToSettingsGeneral() } } ) DrawerNavigationItem( icon = Icons.Default.Folder, label = "Models", - isSelected = currentRoute == com.example.llama.revamp.navigation.AppDestinations.MODELS_MANAGEMENT_ROUTE, + isSelected = currentRoute == AppDestinations.MODELS_MANAGEMENT_ROUTE, onClick = { onNavigate { navigationActions.navigateToModelsManagement() } } ) } diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/TopAppBars.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/TopAppBars.kt similarity index 99% rename from examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/TopAppBars.kt rename to examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/TopAppBars.kt index 5a3683fd92..d564bdadf2 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/components/TopAppBars.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/TopAppBars.kt @@ -1,4 +1,4 @@ -package com.example.llama.revamp.ui.components +package com.example.llama.revamp.ui.scaffold import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/ModelLoadingScreen.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/ModelLoadingScreen.kt index e2f2a82ed4..424dee812a 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/ModelLoadingScreen.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/screens/ModelLoadingScreen.kt @@ -52,7 +52,7 @@ import com.example.llama.revamp.data.model.SystemPrompt import com.example.llama.revamp.engine.ModelLoadingMetrics import com.example.llama.revamp.ui.components.ModelCardCoreExpandable import com.example.llama.revamp.ui.components.ModelUnloadDialogHandler -import com.example.llama.revamp.ui.components.ScaffoldEvent +import com.example.llama.revamp.ui.scaffold.ScaffoldEvent import com.example.llama.revamp.viewmodel.ModelLoadingViewModel 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 abe622918b..90918343ce 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 @@ -37,7 +37,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.window.DialogProperties import com.example.llama.revamp.data.model.ModelInfo import com.example.llama.revamp.ui.components.ModelCardFullExpandable -import com.example.llama.revamp.ui.components.ScaffoldEvent +import com.example.llama.revamp.ui.scaffold.ScaffoldEvent import com.example.llama.revamp.util.formatFileByteSize import com.example.llama.revamp.viewmodel.ModelManagementState import com.example.llama.revamp.viewmodel.ModelManagementState.Deletion