From b1831c4053602c906f8e9982a8c99d59013c3440 Mon Sep 17 00:00:00 2001 From: Han Yin Date: Mon, 21 Apr 2025 19:11:27 -0700 Subject: [PATCH] pkg: restructure TopBarApps into separate files in a child package --- .../com/example/llama/revamp/MainActivity.kt | 4 +- .../llama/revamp/ui/scaffold/AppScaffold.kt | 5 + .../llama/revamp/ui/scaffold/TopAppBars.kt | 271 ------------------ .../ui/scaffold/topbar/DefaultTopBar.kt | 50 ++++ .../ui/scaffold/topbar/PerformanceTopBar.kt | 137 +++++++++ .../ui/scaffold/topbar/StorageTopBar.kt | 86 ++++++ .../revamp/ui/scaffold/topbar/TopBarConfig.kt | 49 ++++ 7 files changed, 329 insertions(+), 273 deletions(-) delete mode 100644 examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/TopAppBars.kt create mode 100644 examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/DefaultTopBar.kt create mode 100644 examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/PerformanceTopBar.kt create mode 100644 examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/StorageTopBar.kt create mode 100644 examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/TopBarConfig.kt 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 a5f395ea18..ca57a7a002 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 @@ -38,11 +38,11 @@ import com.example.llama.revamp.navigation.NavigationActions 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.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.scaffold.bottombar.BottomBarConfig +import com.example.llama.revamp.ui.scaffold.topbar.NavigationIcon +import com.example.llama.revamp.ui.scaffold.topbar.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/scaffold/AppScaffold.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/AppScaffold.kt index 8017a555e1..1a74ec076f 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/AppScaffold.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/AppScaffold.kt @@ -12,6 +12,11 @@ import com.example.llama.revamp.ui.scaffold.bottombar.BottomBarConfig import com.example.llama.revamp.ui.scaffold.bottombar.ConversationBottomBar import com.example.llama.revamp.ui.scaffold.bottombar.ModelSelectionBottomBar import com.example.llama.revamp.ui.scaffold.bottombar.ModelsManagementBottomBar +import com.example.llama.revamp.ui.scaffold.topbar.DefaultTopBar +import com.example.llama.revamp.ui.scaffold.topbar.NavigationIcon +import com.example.llama.revamp.ui.scaffold.topbar.PerformanceTopBar +import com.example.llama.revamp.ui.scaffold.topbar.StorageTopBar +import com.example.llama.revamp.ui.scaffold.topbar.TopBarConfig /** * Configuration of both [TopBarConfig] and [BottomBarConfig] diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/TopAppBars.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/TopAppBars.kt deleted file mode 100644 index d564bdadf2..0000000000 --- a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/TopAppBars.kt +++ /dev/null @@ -1,271 +0,0 @@ -package com.example.llama.revamp.ui.scaffold - -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.width -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.automirrored.filled.ArrowBack -import androidx.compose.material.icons.filled.Memory -import androidx.compose.material.icons.filled.Menu -import androidx.compose.material.icons.filled.SdStorage -import androidx.compose.material.icons.filled.Thermostat -import androidx.compose.material.icons.filled.WarningAmber -import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.Icon -import androidx.compose.material3.IconButton -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text -import androidx.compose.material3.TopAppBar -import androidx.compose.material3.TopAppBarDefaults -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp -import com.example.llama.revamp.data.repository.StorageMetrics -import com.example.llama.revamp.monitoring.MemoryMetrics -import com.example.llama.revamp.monitoring.TemperatureMetrics -import com.example.llama.revamp.monitoring.TemperatureWarningLevel -import java.util.Locale - -/** - * [TopAppBar] configurations - */ -sealed class TopBarConfig { - abstract val title: String - abstract val navigationIcon: NavigationIcon - - // No top bar at all - data class None( - override val title: String = "", - override val navigationIcon: NavigationIcon = NavigationIcon.None - ) : TopBarConfig() - - // Default/simple top bar with only a navigation icon - data class Default( - override val title: String, - override val navigationIcon: NavigationIcon - ) : TopBarConfig() - - // Performance monitoring top bar with RAM and optional temperature - data class Performance( - override val title: String, - override val navigationIcon: NavigationIcon, - val memoryMetrics: MemoryMetrics, - val temperatureInfo: Pair?, - ) : TopBarConfig() - - // Storage management top bar with used & total storage - data class Storage( - override val title: String, - override val navigationIcon: NavigationIcon, - val storageMetrics: StorageMetrics? - ) : TopBarConfig() -} - -/** - * Helper class for navigation icon configuration - */ -sealed class NavigationIcon { - data class Back(val onNavigateBack: () -> Unit) : NavigationIcon() - data class Menu(val onMenuOpen: () -> Unit) : NavigationIcon() - object None : NavigationIcon() -} - -@OptIn(ExperimentalMaterial3Api::class) -@Composable -fun DefaultTopBar( - title: String, - onNavigateBack: (() -> Unit)? = null, - onMenuOpen: (() -> Unit)? = null -) { - TopAppBar( - title = { Text(title) }, - navigationIcon = { - when { - onNavigateBack != null -> { - IconButton(onClick = onNavigateBack) { - Icon( - imageVector = Icons.AutoMirrored.Filled.ArrowBack, - contentDescription = "Back" - ) - } - } - onMenuOpen != null -> { - IconButton(onClick = onMenuOpen) { - Icon( - imageVector = Icons.Default.Menu, - contentDescription = "Menu" - ) - } - } - } - }, - colors = TopAppBarDefaults.topAppBarColors( - containerColor = MaterialTheme.colorScheme.surface, - titleContentColor = MaterialTheme.colorScheme.onSurface - ) - ) -} - -@OptIn(ExperimentalMaterial3Api::class) -@Composable -fun PerformanceTopBar( - title: String, - memoryMetrics: MemoryMetrics, - temperatureDisplay: Pair?, - onNavigateBack: (() -> Unit)? = null, - onMenuOpen: (() -> Unit)? = null, -) { - TopAppBar( - title = { Text(title) }, - navigationIcon = { - when { - onNavigateBack != null -> { - IconButton(onClick = onNavigateBack) { - Icon( - imageVector = Icons.AutoMirrored.Filled.ArrowBack, - contentDescription = "Back" - ) - } - } - onMenuOpen != null -> { - IconButton(onClick = onMenuOpen) { - Icon( - imageVector = Icons.Default.Menu, - contentDescription = "Menu" - ) - } - } - } - }, - actions = { - // Temperature indicator (optional) - temperatureDisplay?.let { (temperatureMetrics, useFahrenheit) -> - TemperatureIndicator( - temperatureMetrics = temperatureMetrics, - useFahrenheit = useFahrenheit - ) - - Spacer(modifier = Modifier.width(8.dp)) - } - - // Memory indicator - MemoryIndicator(memoryUsage = memoryMetrics) - }, - colors = TopAppBarDefaults.topAppBarColors( - containerColor = MaterialTheme.colorScheme.surface, - titleContentColor = MaterialTheme.colorScheme.onSurface - ) - ) -} - -@OptIn(ExperimentalMaterial3Api::class) -@Composable -fun StorageTopBar( - title: String, - storageMetrics: StorageMetrics?, - onNavigateBack: (() -> Unit)? = null, -) { - TopAppBar( - title = { Text(title) }, - navigationIcon = { - if (onNavigateBack != null) { - IconButton(onClick = onNavigateBack) { - Icon( - imageVector = Icons.AutoMirrored.Filled.ArrowBack, - contentDescription = "Back" - ) - } - } - }, - actions = { - storageMetrics?.let { - StorageIndicator(storageMetrics = it) - } - }, - colors = TopAppBarDefaults.topAppBarColors( - containerColor = MaterialTheme.colorScheme.surface, - titleContentColor = MaterialTheme.colorScheme.onSurface - ) - ) -} - -@Composable -fun MemoryIndicator(memoryUsage: MemoryMetrics) { - Row(modifier = Modifier.padding(end = 8.dp), verticalAlignment = Alignment.CenterVertically) { - Icon( - imageVector = Icons.Default.Memory, - contentDescription = "RAM usage", - tint = when { - memoryUsage.availableGb < 1 -> MaterialTheme.colorScheme.error - memoryUsage.availableGb < 3 -> MaterialTheme.colorScheme.tertiary - else -> MaterialTheme.colorScheme.onSurface - } - ) - - Spacer(modifier = Modifier.width(4.dp)) - - Text( - text = String.format( - Locale.getDefault(), "%.1f / %.1f GB", memoryUsage.availableGb, memoryUsage.totalGb - ), - style = MaterialTheme.typography.bodySmall, - ) - } -} - -@Composable -fun TemperatureIndicator(temperatureMetrics: TemperatureMetrics, useFahrenheit: Boolean) { - Row(verticalAlignment = Alignment.CenterVertically) { - Icon( - imageVector = when (temperatureMetrics.warningLevel) { - TemperatureWarningLevel.HIGH -> Icons.Default.WarningAmber - else -> Icons.Default.Thermostat - }, - contentDescription = "Device temperature", - tint = when (temperatureMetrics.warningLevel) { - TemperatureWarningLevel.HIGH -> MaterialTheme.colorScheme.error - TemperatureWarningLevel.MEDIUM -> MaterialTheme.colorScheme.tertiary - else -> MaterialTheme.colorScheme.onSurface - } - ) - - Spacer(modifier = Modifier.width(2.dp)) - - Text( - text = temperatureMetrics.getDisplay(useFahrenheit), - style = MaterialTheme.typography.bodySmall, - color = when (temperatureMetrics.warningLevel) { - TemperatureWarningLevel.HIGH -> MaterialTheme.colorScheme.error - TemperatureWarningLevel.MEDIUM -> MaterialTheme.colorScheme.tertiary - else -> MaterialTheme.colorScheme.onSurface - } - ) - } -} - -@Composable -fun StorageIndicator(storageMetrics: StorageMetrics) { - val usedGb = storageMetrics.usedGB - val availableGb = storageMetrics.availableGB - - Row(modifier = Modifier.padding(end = 8.dp), verticalAlignment = Alignment.CenterVertically) { - Icon( - imageVector = Icons.Default.SdStorage, - contentDescription = "Storage", - tint = when { - availableGb < 5.0f -> MaterialTheme.colorScheme.error - availableGb < 10.0f -> MaterialTheme.colorScheme.tertiary - else -> MaterialTheme.colorScheme.onSurface - } - ) - - Spacer(modifier = Modifier.width(2.dp)) - - Text( - text = String.format(Locale.getDefault(), "%.1f / %.1f GB", usedGb, availableGb), - style = MaterialTheme.typography.bodySmall - ) - } -} diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/DefaultTopBar.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/DefaultTopBar.kt new file mode 100644 index 0000000000..dd49f693be --- /dev/null +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/DefaultTopBar.kt @@ -0,0 +1,50 @@ +package com.example.llama.revamp.ui.scaffold.topbar + +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.filled.ArrowBack +import androidx.compose.material.icons.filled.Menu +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.runtime.Composable + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun DefaultTopBar( + title: String, + onNavigateBack: (() -> Unit)? = null, + onMenuOpen: (() -> Unit)? = null +) { + TopAppBar( + title = { Text(title) }, + navigationIcon = { + when { + onNavigateBack != null -> { + IconButton(onClick = onNavigateBack) { + Icon( + imageVector = Icons.AutoMirrored.Filled.ArrowBack, + contentDescription = "Back" + ) + } + } + + onMenuOpen != null -> { + IconButton(onClick = onMenuOpen) { + Icon( + imageVector = Icons.Default.Menu, + contentDescription = "Menu" + ) + } + } + } + }, + colors = TopAppBarDefaults.topAppBarColors( + containerColor = MaterialTheme.colorScheme.surface, + titleContentColor = MaterialTheme.colorScheme.onSurface + ) + ) +} diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/PerformanceTopBar.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/PerformanceTopBar.kt new file mode 100644 index 0000000000..dcad7e8277 --- /dev/null +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/PerformanceTopBar.kt @@ -0,0 +1,137 @@ +package com.example.llama.revamp.ui.scaffold.topbar + +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.filled.ArrowBack +import androidx.compose.material.icons.filled.Memory +import androidx.compose.material.icons.filled.Menu +import androidx.compose.material.icons.filled.Thermostat +import androidx.compose.material.icons.filled.WarningAmber +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.example.llama.revamp.monitoring.MemoryMetrics +import com.example.llama.revamp.monitoring.TemperatureMetrics +import com.example.llama.revamp.monitoring.TemperatureWarningLevel +import java.util.Locale + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun PerformanceTopBar( + title: String, + memoryMetrics: MemoryMetrics, + temperatureDisplay: Pair?, + onNavigateBack: (() -> Unit)? = null, + onMenuOpen: (() -> Unit)? = null, +) { + TopAppBar( + title = { Text(title) }, + navigationIcon = { + when { + onNavigateBack != null -> { + IconButton(onClick = onNavigateBack) { + Icon( + imageVector = Icons.AutoMirrored.Filled.ArrowBack, + contentDescription = "Back" + ) + } + } + + onMenuOpen != null -> { + IconButton(onClick = onMenuOpen) { + Icon( + imageVector = Icons.Default.Menu, + contentDescription = "Menu" + ) + } + } + } + }, + actions = { + // Temperature indicator (optional) + temperatureDisplay?.let { (temperatureMetrics, useFahrenheit) -> + TemperatureIndicator( + temperatureMetrics = temperatureMetrics, + useFahrenheit = useFahrenheit + ) + + Spacer(modifier = Modifier.Companion.width(8.dp)) + } + + // Memory indicator + MemoryIndicator(memoryUsage = memoryMetrics) + }, + colors = TopAppBarDefaults.topAppBarColors( + containerColor = MaterialTheme.colorScheme.surface, + titleContentColor = MaterialTheme.colorScheme.onSurface + ) + ) +} + +@Composable +private fun MemoryIndicator(memoryUsage: MemoryMetrics) { + Row( + modifier = Modifier.Companion.padding(end = 8.dp), + verticalAlignment = Alignment.Companion.CenterVertically + ) { + Icon( + imageVector = Icons.Default.Memory, + contentDescription = "RAM usage", + tint = when { + memoryUsage.availableGb < 1 -> MaterialTheme.colorScheme.error + memoryUsage.availableGb < 3 -> MaterialTheme.colorScheme.tertiary + else -> MaterialTheme.colorScheme.onSurface + } + ) + + Spacer(modifier = Modifier.width(4.dp)) + + Text( + text = String.Companion.format( + Locale.getDefault(), "%.1f / %.1f GB", memoryUsage.availableGb, memoryUsage.totalGb + ), + style = MaterialTheme.typography.bodySmall, + ) + } +} + +@Composable +private fun TemperatureIndicator(temperatureMetrics: TemperatureMetrics, useFahrenheit: Boolean) { + Row(verticalAlignment = Alignment.CenterVertically) { + Icon( + imageVector = when (temperatureMetrics.warningLevel) { + TemperatureWarningLevel.HIGH -> Icons.Default.WarningAmber + else -> Icons.Default.Thermostat + }, + contentDescription = "Device temperature", + tint = when (temperatureMetrics.warningLevel) { + TemperatureWarningLevel.HIGH -> MaterialTheme.colorScheme.error + TemperatureWarningLevel.MEDIUM -> MaterialTheme.colorScheme.tertiary + else -> MaterialTheme.colorScheme.onSurface + } + ) + + Spacer(modifier = Modifier.width(2.dp)) + + Text( + text = temperatureMetrics.getDisplay(useFahrenheit), + style = MaterialTheme.typography.bodySmall, + color = when (temperatureMetrics.warningLevel) { + TemperatureWarningLevel.HIGH -> MaterialTheme.colorScheme.error + TemperatureWarningLevel.MEDIUM -> MaterialTheme.colorScheme.tertiary + else -> MaterialTheme.colorScheme.onSurface + } + ) + } +} diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/StorageTopBar.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/StorageTopBar.kt new file mode 100644 index 0000000000..2dda5c53de --- /dev/null +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/StorageTopBar.kt @@ -0,0 +1,86 @@ +package com.example.llama.revamp.ui.scaffold.topbar + +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.filled.ArrowBack +import androidx.compose.material.icons.filled.SdStorage +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.example.llama.revamp.data.repository.StorageMetrics +import java.util.Locale + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun StorageTopBar( + title: String, + storageMetrics: StorageMetrics?, + onNavigateBack: (() -> Unit)? = null, +) { + TopAppBar( + title = { Text(title) }, + navigationIcon = { + if (onNavigateBack != null) { + IconButton(onClick = onNavigateBack) { + Icon( + imageVector = Icons.AutoMirrored.Filled.ArrowBack, + contentDescription = "Back" + ) + } + } + }, + actions = { + storageMetrics?.let { + StorageIndicator(storageMetrics = it) + } + }, + colors = TopAppBarDefaults.topAppBarColors( + containerColor = MaterialTheme.colorScheme.surface, + titleContentColor = MaterialTheme.colorScheme.onSurface + ) + ) +} + +@Composable +private fun StorageIndicator(storageMetrics: StorageMetrics) { + val usedGb = storageMetrics.usedGB + val availableGb = storageMetrics.availableGB + + Row( + modifier = Modifier.Companion.padding(end = 8.dp), + verticalAlignment = Alignment.Companion.CenterVertically + ) { + Icon( + imageVector = Icons.Default.SdStorage, + contentDescription = "Storage", + tint = when { + availableGb < 5.0f -> MaterialTheme.colorScheme.error + availableGb < 10.0f -> MaterialTheme.colorScheme.tertiary + else -> MaterialTheme.colorScheme.onSurface + } + ) + + Spacer(modifier = Modifier.Companion.width(2.dp)) + + Text( + text = String.Companion.format( + Locale.getDefault(), + "%.1f / %.1f GB", + usedGb, + availableGb + ), + style = MaterialTheme.typography.bodySmall + ) + } +} diff --git a/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/TopBarConfig.kt b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/TopBarConfig.kt new file mode 100644 index 0000000000..fc52c717d9 --- /dev/null +++ b/examples/llama.android/app/src/main/java/com/example/llama/revamp/ui/scaffold/topbar/TopBarConfig.kt @@ -0,0 +1,49 @@ +package com.example.llama.revamp.ui.scaffold.topbar + +import com.example.llama.revamp.data.repository.StorageMetrics +import com.example.llama.revamp.monitoring.MemoryMetrics +import com.example.llama.revamp.monitoring.TemperatureMetrics + +/** + * [TopAppBar] configurations + */ +sealed class TopBarConfig { + abstract val title: String + abstract val navigationIcon: NavigationIcon + + // No top bar at all + data class None( + override val title: String = "", + override val navigationIcon: NavigationIcon = NavigationIcon.None + ) : TopBarConfig() + + // Default/simple top bar with only a navigation icon + data class Default( + override val title: String, + override val navigationIcon: NavigationIcon + ) : TopBarConfig() + + // Performance monitoring top bar with RAM and optional temperature + data class Performance( + override val title: String, + override val navigationIcon: NavigationIcon, + val memoryMetrics: MemoryMetrics, + val temperatureInfo: Pair?, + ) : TopBarConfig() + + // Storage management top bar with used & total storage + data class Storage( + override val title: String, + override val navigationIcon: NavigationIcon, + val storageMetrics: StorageMetrics? + ) : TopBarConfig() +} + +/** + * Helper class for navigation icon configuration + */ +sealed class NavigationIcon { + data class Back(val onNavigateBack: () -> Unit) : NavigationIcon() + data class Menu(val onMenuOpen: () -> Unit) : NavigationIcon() + object None : NavigationIcon() +}