Modern Apps git

← Modern-Apps.git

hub: use shared scaffolds (no raw Scaffold)

Commit
53247d3a58efe8e54824bd78ecdb9426fcfa3346
Author
vayun-mathur <[email protected]>
When
2026-08-16 03:06 UTC (3 months ago)
Parents
a0d68b7

Diff

games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/AchievementsScreen.kt
diff --git a/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/AchievementsScreen.kt b/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/AchievementsScreen.ktindex 6d128206c4..39359614ed 100644--- a/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/AchievementsScreen.kt+++ b/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/AchievementsScreen.kt@@ -18,12 +18,11 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vayunmathur.games.hub.data.dao.AchievementWithProgress import com.vayunmathur.games.hub.ui.components.AchievementRow import com.vayunmathur.games.hub.viewmodel.GameHubViewModel+import com.vayunmathur.library.ui.AppScaffold import com.vayunmathur.library.ui.CommonSearchBar import com.vayunmathur.library.ui.FilterChip import com.vayunmathur.library.ui.MaterialTheme-import com.vayunmathur.library.ui.Scaffold import com.vayunmathur.library.ui.Text-import com.vayunmathur.library.ui.TopAppBar import androidx.compose.ui.res.stringResource import com.vayunmathur.games.hub.R @@ -60,7 +59,7 @@ fun AchievementsScreen(         list.sortedWith(compareBy<AchievementWithProgress> { !it.isUnlocked }.thenBy { it.gameId }.thenBy { it.name })     } -    Scaffold(topBar = { TopAppBar(title = { CommonSearchBar(value = search, onValueChange = { search = it }, padding = PaddingValues(0.dp)) }) }) { padding ->+    AppScaffold(title = { CommonSearchBar(value = search, onValueChange = { search = it }, padding = PaddingValues(0.dp)) }) { padding ->         LazyColumn(modifier = modifier.fillMaxSize().padding(padding), contentPadding = PaddingValues(bottom = 16.dp), verticalArrangement = Arrangement.spacedBy(4.dp)) {             item {                 LazyRow(contentPadding = PaddingValues(horizontal = 16.dp), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/ActivityFeedScreen.kt
diff --git a/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/ActivityFeedScreen.kt b/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/ActivityFeedScreen.ktindex 1a449c009a..80a8bdfebc 100644--- a/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/ActivityFeedScreen.kt+++ b/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/ActivityFeedScreen.kt@@ -16,11 +16,10 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vayunmathur.games.hub.MainRoute import com.vayunmathur.games.hub.ui.components.ActivityItemCard import com.vayunmathur.games.hub.viewmodel.GameHubViewModel+import com.vayunmathur.library.ui.AppScaffold import com.vayunmathur.library.ui.IconNavigation import com.vayunmathur.library.ui.MaterialTheme-import com.vayunmathur.library.ui.Scaffold import com.vayunmathur.library.ui.Text-import com.vayunmathur.library.ui.TopAppBar import com.vayunmathur.library.util.NavBackStack import androidx.compose.ui.res.stringResource import com.vayunmathur.games.hub.R@@ -34,12 +33,10 @@ fun ActivityFeedScreen( ) {     val activity by viewModel.allActivityFlow.collectAsStateWithLifecycle() -    Scaffold(topBar = {-        TopAppBar(-            title = { Text(stringResource(R.string.tab_activity)) },-            navigationIcon = { backStack?.let { IconNavigation(it) } }-        )-    }) { padding ->+    AppScaffold(+        title = stringResource(R.string.tab_activity),+        navigationIcon = { backStack?.let { IconNavigation(it) } }+    ) { padding ->         if (activity.isEmpty()) {             Box(modifier = Modifier.fillMaxSize().padding(padding).padding(16.dp), contentAlignment = Alignment.TopStart) {                 Text(stringResource(R.string.no_activity_yet_start_playing_games_to_s), style = MaterialTheme.typography.bodyMedium)
games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/DashboardScreen.kt
diff --git a/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/DashboardScreen.kt b/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/DashboardScreen.ktindex fddd43b282..f6ca666ccc 100644--- a/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/DashboardScreen.kt+++ b/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/DashboardScreen.kt@@ -29,12 +29,11 @@ import com.vayunmathur.games.hub.ui.components.XpProgressBar import com.vayunmathur.games.hub.util.DashboardActions import com.vayunmathur.games.hub.util.DashboardUiState import com.vayunmathur.games.hub.util.formatPlaytime+import com.vayunmathur.library.ui.AppScaffold import com.vayunmathur.library.ui.Card import com.vayunmathur.library.ui.MaterialTheme-import com.vayunmathur.library.ui.Scaffold import com.vayunmathur.library.ui.Text import com.vayunmathur.library.ui.TextButton-import com.vayunmathur.library.ui.TopAppBar import androidx.compose.ui.res.stringResource  /**@@ -53,13 +52,9 @@ fun DashboardScreen(     iconFor: (HubGameEntity) -> Drawable? = { null },     topBarActions: @Composable RowScope.() -> Unit = {}, ) {-    Scaffold(-        topBar = {-            TopAppBar(-                title = { Text(stringResource(R.string.app_name), fontWeight = FontWeight.Bold) },-                actions = topBarActions-            )-        }+    AppScaffold(+        title = { Text(stringResource(R.string.app_name), fontWeight = FontWeight.Bold) },+        actions = topBarActions     ) { padding ->         LazyColumn(             modifier = modifier.fillMaxSize().padding(padding),
games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/GamesListScreen.kt
diff --git a/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/GamesListScreen.kt b/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/GamesListScreen.ktindex d5474112ae..8a212c9235 100644--- a/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/GamesListScreen.kt+++ b/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/GamesListScreen.kt@@ -21,13 +21,12 @@ import com.vayunmathur.games.hub.data.entities.HubGameEntity import com.vayunmathur.games.hub.ui.components.GameCard import com.vayunmathur.games.hub.util.GamesListActions import com.vayunmathur.games.hub.util.GamesListUiState+import com.vayunmathur.library.ui.AppScaffold import com.vayunmathur.library.ui.CommonSearchBar import com.vayunmathur.library.ui.IconButton import com.vayunmathur.library.ui.IconMoreVert import com.vayunmathur.library.ui.MaterialTheme-import com.vayunmathur.library.ui.Scaffold import com.vayunmathur.library.ui.Text-import com.vayunmathur.library.ui.TopAppBar import androidx.compose.ui.res.stringResource  enum class GameSort { LAST_PLAYED, MOST_PLAYED, NAME, COMPLETION }@@ -61,27 +60,23 @@ fun GamesListScreen(         }     } -    Scaffold(-        topBar = {-            TopAppBar(-                title = {-                    CommonSearchBar(-                        value = search,-                        onValueChange = { search = it },-                        placeholder = stringResource(com.vayunmathur.games.hub.R.string.search_games),-                        padding = PaddingValues(0.dp),-                    )-                },-                actions = {-                    IconButton(onClick = { showSortMenu = true }) { IconMoreVert() }-                    DropdownMenu(expanded = showSortMenu, onDismissRequest = { showSortMenu = false }) {-                        DropdownMenuItem(text = { Text(stringResource(R.string.sort_last_played)) }, onClick = { sort = GameSort.LAST_PLAYED; showSortMenu = false })-                        DropdownMenuItem(text = { Text(stringResource(R.string.sort_most_played)) }, onClick = { sort = GameSort.MOST_PLAYED; showSortMenu = false })-                        DropdownMenuItem(text = { Text(stringResource(R.string.sort_name)) }, onClick = { sort = GameSort.NAME; showSortMenu = false })-                        DropdownMenuItem(text = { Text(stringResource(R.string.sort_completion)) }, onClick = { sort = GameSort.COMPLETION; showSortMenu = false })-                    }-                }+    AppScaffold(+        title = {+            CommonSearchBar(+                value = search,+                onValueChange = { search = it },+                placeholder = stringResource(com.vayunmathur.games.hub.R.string.search_games),+                padding = PaddingValues(0.dp),             )+        },+        actions = {+            IconButton(onClick = { showSortMenu = true }) { IconMoreVert() }+            DropdownMenu(expanded = showSortMenu, onDismissRequest = { showSortMenu = false }) {+                DropdownMenuItem(text = { Text(stringResource(R.string.sort_last_played)) }, onClick = { sort = GameSort.LAST_PLAYED; showSortMenu = false })+                DropdownMenuItem(text = { Text(stringResource(R.string.sort_most_played)) }, onClick = { sort = GameSort.MOST_PLAYED; showSortMenu = false })+                DropdownMenuItem(text = { Text(stringResource(R.string.sort_name)) }, onClick = { sort = GameSort.NAME; showSortMenu = false })+                DropdownMenuItem(text = { Text(stringResource(R.string.sort_completion)) }, onClick = { sort = GameSort.COMPLETION; showSortMenu = false })+            }         }     ) { padding ->         LazyColumn(modifier = modifier.fillMaxSize().padding(padding), contentPadding = PaddingValues(16.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {
games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/ProfileScreen.kt
diff --git a/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/ProfileScreen.kt b/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/ProfileScreen.ktindex 80970df0c2..760e5d5cd7 100644--- a/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/ProfileScreen.kt+++ b/games/hub/src/main/java/com/vayunmathur/games/hub/ui/screens/ProfileScreen.kt@@ -31,14 +31,13 @@ import com.vayunmathur.games.hub.util.ProfileUiState import com.vayunmathur.games.hub.util.XpLevelCalculator import com.vayunmathur.games.hub.util.formatPlaytime import com.vayunmathur.library.ui.AlertDialog+import com.vayunmathur.library.ui.AppScaffold import com.vayunmathur.library.ui.Button import com.vayunmathur.library.ui.Card import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.OutlinedTextField-import com.vayunmathur.library.ui.Scaffold import com.vayunmathur.library.ui.Text import com.vayunmathur.library.ui.TextButton-import com.vayunmathur.library.ui.TopAppBar import androidx.compose.ui.res.stringResource  private val avatarOptions = listOf(@@ -66,17 +65,16 @@ fun ProfileScreen(         selectedAvatar = state.avatarSymbol     } -    Scaffold(topBar = {-        TopAppBar(-            actions = {-                androidx.compose.material3.IconButton(onClick = {-                    editName = state.playerName ?: ""-                    selectedAvatar = state.avatarSymbol-                    showEditDialog = true-                }) { IconPerson() }-            }-        )-    }) { padding ->+    AppScaffold(+        title = {},+        actions = {+            androidx.compose.material3.IconButton(onClick = {+                editName = state.playerName ?: ""+                selectedAvatar = state.avatarSymbol+                showEditDialog = true+            }) { IconPerson() }+        }+    ) { padding ->         LazyColumn(modifier = modifier.fillMaxSize().padding(padding), contentPadding = PaddingValues(16.dp), verticalArrangement = Arrangement.spacedBy(16.dp)) {             item {                 Card(modifier = Modifier.fillMaxWidth()) {