library: default top app bar titles to empty and drop the redundant ones
- Commit
e43563aef2597a7b7283e67532efd0af1adef73e- Author
- Vayun Mathur <[email protected]>
- When
- 2026-08-05 19:25 UTC (4 months ago)
- Parents
e1faee2
Diff
appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesPage.kt
diff --git a/appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesPage.kt b/appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesPage.ktindex b55a6cceda..7196dfc810 100644--- a/appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesPage.kt+++ b/appstore/src/main/java/com/vayunmathur/appstore/ui/UpdatesPage.kt@@ -62,7 +62,6 @@ fun UpdatesScreen( Scaffold( topBar = { TopAppBar(- title = { Text(stringResource(R.string.updates)) }, actions = { if (state.isChecking) { CircularProgressIndicator(Modifier.size(18.dp).padding(end = 4.dp))
calculator/src/main/java/com/vayunmathur/calculator/ui/CalculatorPage.kt
diff --git a/calculator/src/main/java/com/vayunmathur/calculator/ui/CalculatorPage.kt b/calculator/src/main/java/com/vayunmathur/calculator/ui/CalculatorPage.ktindex ded397ea8f..f1880ca5dd 100644--- a/calculator/src/main/java/com/vayunmathur/calculator/ui/CalculatorPage.kt+++ b/calculator/src/main/java/com/vayunmathur/calculator/ui/CalculatorPage.kt@@ -184,7 +184,6 @@ fun CalculatorScreen( Scaffold( topBar = { CenterAlignedTopAppBar(- title = { Text(stringResource(R.string.app_name)) }, actions = { IconButton({ showHistory = true }) { IconHistory() } }, ) },
calculator/src/main/java/com/vayunmathur/calculator/ui/GraphPage.kt
diff --git a/calculator/src/main/java/com/vayunmathur/calculator/ui/GraphPage.kt b/calculator/src/main/java/com/vayunmathur/calculator/ui/GraphPage.ktindex b6fcccdc97..ef3a76e933 100644--- a/calculator/src/main/java/com/vayunmathur/calculator/ui/GraphPage.kt+++ b/calculator/src/main/java/com/vayunmathur/calculator/ui/GraphPage.kt@@ -85,7 +85,6 @@ fun GraphScreen(state: GraphUiState, actions: GraphActions) { Scaffold( topBar = { TopAppBar(- title = { Text(stringResource(R.string.graph)) }, actions = { AssistChip( onClick = { actions.toggleAngleMode() },
clock/src/main/java/com/vayunmathur/clock/ui/AlarmPage.kt
diff --git a/clock/src/main/java/com/vayunmathur/clock/ui/AlarmPage.kt b/clock/src/main/java/com/vayunmathur/clock/ui/AlarmPage.ktindex 38593dd3e6..66a729b775 100644--- a/clock/src/main/java/com/vayunmathur/clock/ui/AlarmPage.kt+++ b/clock/src/main/java/com/vayunmathur/clock/ui/AlarmPage.kt@@ -164,7 +164,6 @@ fun AlarmScreen( val alarms = state.alarms Scaffold(topBar = { TopAppBar(- title = { Text(stringResource(R.string.label_alarm)) }, actions = { IconButton(onClick = { backStack.add(Route.AlarmSettings) }) { IconSettings() } },
clock/src/main/java/com/vayunmathur/clock/ui/ClockPage.kt
diff --git a/clock/src/main/java/com/vayunmathur/clock/ui/ClockPage.kt b/clock/src/main/java/com/vayunmathur/clock/ui/ClockPage.ktindex 22ab1dd2ae..f17b7ff743 100644--- a/clock/src/main/java/com/vayunmathur/clock/ui/ClockPage.kt+++ b/clock/src/main/java/com/vayunmathur/clock/ui/ClockPage.kt@@ -78,9 +78,7 @@ fun ClockPage(backStack: NavBackStack<Route>, ds: DataStoreUtils, clockViewModel @Composable fun ClockScreen(backStack: NavBackStack<Route>, state: ClockUiState) { val time = state.now.toLocalDateTime(state.zone)- Scaffold(topBar = {- TopAppBar({Text(stringResource(R.string.label_clock))})- }, bottomBar = {+ Scaffold(bottomBar = { BottomNavBar(backStack, mainPages(), Route.Clock) }, floatingActionButton = { FloatingActionButton({
clock/src/main/java/com/vayunmathur/clock/ui/StopwatchPage.kt
diff --git a/clock/src/main/java/com/vayunmathur/clock/ui/StopwatchPage.kt b/clock/src/main/java/com/vayunmathur/clock/ui/StopwatchPage.ktindex 25c5fdee0b..9e5959cdb4 100644--- a/clock/src/main/java/com/vayunmathur/clock/ui/StopwatchPage.kt+++ b/clock/src/main/java/com/vayunmathur/clock/ui/StopwatchPage.kt@@ -88,9 +88,7 @@ fun StopwatchScreen(backStack: NavBackStack<Route>, state: StopwatchUiState, act } } - Scaffold(topBar = {- TopAppBar({Text(stringResource(R.string.label_stopwatch))})- }, bottomBar = {+ Scaffold(bottomBar = { BottomNavBar(backStack, mainPages(), Route.Stopwatch) }, floatingActionButton = { Column(verticalArrangement = Arrangement.spacedBy(16.dp)) {
clock/src/main/java/com/vayunmathur/clock/ui/TimerPage.kt
diff --git a/clock/src/main/java/com/vayunmathur/clock/ui/TimerPage.kt b/clock/src/main/java/com/vayunmathur/clock/ui/TimerPage.ktindex f3d5ab3d2a..e70630b1cf 100644--- a/clock/src/main/java/com/vayunmathur/clock/ui/TimerPage.kt+++ b/clock/src/main/java/com/vayunmathur/clock/ui/TimerPage.kt@@ -183,9 +183,6 @@ fun TimerScreen( val showKeypad = timers.isEmpty() || isAddingTimer Scaffold(- topBar = {- TopAppBar({ Text(stringResource(R.string.label_timer)) })- }, bottomBar = { BottomNavBar(backStack, mainPages(), Route.Timer) },
contacts/src/main/java/com/vayunmathur/contacts/ui/GroupsPage.kt
diff --git a/contacts/src/main/java/com/vayunmathur/contacts/ui/GroupsPage.kt b/contacts/src/main/java/com/vayunmathur/contacts/ui/GroupsPage.ktindex ca56e0826a..8511dc9bad 100644--- a/contacts/src/main/java/com/vayunmathur/contacts/ui/GroupsPage.kt+++ b/contacts/src/main/java/com/vayunmathur/contacts/ui/GroupsPage.kt@@ -80,11 +80,6 @@ fun GroupsScreen(state: GroupsUiState, actions: ContactsActions, expandGroupId: } Scaffold(- topBar = {- TopAppBar(- title = { Text(stringResource(R.string.groups)) }- )- }, floatingActionButton = { FloatingActionButton(onClick = { showAddDialog = true }) { IconAdd()
contacts/src/main/java/com/vayunmathur/contacts/ui/SettingsPage.kt
diff --git a/contacts/src/main/java/com/vayunmathur/contacts/ui/SettingsPage.kt b/contacts/src/main/java/com/vayunmathur/contacts/ui/SettingsPage.ktindex 94f57fd2e5..8b833b9987 100644--- a/contacts/src/main/java/com/vayunmathur/contacts/ui/SettingsPage.kt+++ b/contacts/src/main/java/com/vayunmathur/contacts/ui/SettingsPage.kt@@ -76,11 +76,6 @@ fun SettingsPage(viewModel: ContactViewModel, backStack: NavBackStack<Route>) { } Scaffold(- topBar = {- TopAppBar(- title = { Text(stringResource(UiR.string.settings)) },- )- }, floatingActionButton = { FloatingActionButton(onClick = { backStack.add(Route.AddAccountDialog) }) { IconAdd()
games/chess/src/main/java/com/vayunmathur/games/chess/MainActivity.kt
diff --git a/games/chess/src/main/java/com/vayunmathur/games/chess/MainActivity.kt b/games/chess/src/main/java/com/vayunmathur/games/chess/MainActivity.ktindex 1a3a0cb40e..f56b9f4d72 100644--- a/games/chess/src/main/java/com/vayunmathur/games/chess/MainActivity.kt+++ b/games/chess/src/main/java/com/vayunmathur/games/chess/MainActivity.kt@@ -684,9 +684,7 @@ fun LearnHomeScreen(onOpenStage: (String, String) -> Unit) { com.vayunmathur.games.chess.data.LearnRepository.categories } }- Scaffold(- topBar = { TopAppBar(title = { Text(stringResource(R.string.tab_learn)) }) }- ) { pad ->+ Scaffold { pad -> val cats = categories if (cats == null) { Box(Modifier.fillMaxSize().padding(pad), Alignment.Center) { CircularProgressIndicator() }@@ -1102,9 +1100,7 @@ fun PuzzleBoardScreen(state: PuzzleUiState, actions: PuzzleActions) { PawnPromotionDialog(state.playerColor, onPromote = actions::onPromote) } - Scaffold(- topBar = { TopAppBar(title = { Text(stringResource(R.string.tab_puzzles)) }) }- ) { innerPadding ->+ Scaffold { innerPadding -> Column( Modifier .fillMaxSize()
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 b1e5927e26..ef50a579d2 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@@ -106,7 +106,6 @@ fun GamesListScreen( Scaffold( topBar = { TopAppBar(- title = { Text(stringResource(R.string.tab_games)) }, actions = { IconButton(onClick = { showSortMenu = true }) { IconMoreVert() } DropdownMenu(expanded = showSortMenu, onDismissRequest = { showSortMenu = false }) {
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 4c4f11a226..d4789c6166 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@@ -93,7 +93,6 @@ fun ProfileScreen( Scaffold(topBar = { TopAppBar(- title = { Text(stringResource(R.string.profile_title)) }, actions = { androidx.compose.material3.IconButton(onClick = { editName = state.playerName ?: ""
health/src/main/java/com/vayunmathur/health/ui/ActivityPage.kt
diff --git a/health/src/main/java/com/vayunmathur/health/ui/ActivityPage.kt b/health/src/main/java/com/vayunmathur/health/ui/ActivityPage.ktindex d347e4e223..707b5be565 100644--- a/health/src/main/java/com/vayunmathur/health/ui/ActivityPage.kt+++ b/health/src/main/java/com/vayunmathur/health/ui/ActivityPage.kt@@ -70,11 +70,7 @@ fun ActivityPage(backStack: NavBackStack<Route>, viewModel: HealthViewModel) { viewModel.sumInRange(RecordType.Exercise, dayStart, dayEnd).map { it.toLong() } }.collectAsState(0L) - Scaffold(- topBar = {- TopAppBar(title = { Text(stringResource(R.string.nav_activity)) })- }- ) { paddingValues ->+ Scaffold { paddingValues -> LazyColumn( modifier = Modifier.fillMaxSize(), contentPadding = PaddingValues(
health/src/main/java/com/vayunmathur/health/ui/BodyPage.kt
diff --git a/health/src/main/java/com/vayunmathur/health/ui/BodyPage.kt b/health/src/main/java/com/vayunmathur/health/ui/BodyPage.ktindex 636da53ffa..92925b288e 100644--- a/health/src/main/java/com/vayunmathur/health/ui/BodyPage.kt+++ b/health/src/main/java/com/vayunmathur/health/ui/BodyPage.kt@@ -67,9 +67,6 @@ fun BodyPage(backStack: NavBackStack<Route>, viewModel: HealthViewModel) { } Scaffold(- topBar = {- TopAppBar(title = { Text(stringResource(R.string.nav_body)) })- }, floatingActionButton = { FloatingActionButtonMenu( expanded = fabExpanded,
health/src/main/java/com/vayunmathur/health/ui/NutritionPage.kt
diff --git a/health/src/main/java/com/vayunmathur/health/ui/NutritionPage.kt b/health/src/main/java/com/vayunmathur/health/ui/NutritionPage.ktindex 946fb6bc63..3608119382 100644--- a/health/src/main/java/com/vayunmathur/health/ui/NutritionPage.kt+++ b/health/src/main/java/com/vayunmathur/health/ui/NutritionPage.kt@@ -159,9 +159,6 @@ fun NutritionScreen(state: NutritionUiState, actions: NutritionActions) { var fabExpanded by remember { mutableStateOf(false) } Scaffold(- topBar = {- TopAppBar(title = { Text(stringResource(R.string.label_nutrition_details)) })- }, floatingActionButton = { FloatingActionButtonMenu( expanded = fabExpanded,
library/ui/src/main/java/com/vayunmathur/library/ui/MaterialComponents.kt
diff --git a/library/ui/src/main/java/com/vayunmathur/library/ui/MaterialComponents.kt b/library/ui/src/main/java/com/vayunmathur/library/ui/MaterialComponents.ktindex 0bed5697b6..ebb62e0025 100644--- a/library/ui/src/main/java/com/vayunmathur/library/ui/MaterialComponents.kt+++ b/library/ui/src/main/java/com/vayunmathur/library/ui/MaterialComponents.kt@@ -290,7 +290,7 @@ fun Scaffold( // --- Top app bars --- @Composable fun TopAppBar(- title: @Composable () -> Unit,+ title: @Composable () -> Unit = {}, modifier: Modifier = Modifier, navigationIcon: @Composable () -> Unit = {}, actions: @Composable RowScope.() -> Unit = {},@@ -304,7 +304,7 @@ fun TopAppBar( @Composable fun CenterAlignedTopAppBar(- title: @Composable () -> Unit,+ title: @Composable () -> Unit = {}, modifier: Modifier = Modifier, navigationIcon: @Composable () -> Unit = {}, actions: @Composable RowScope.() -> Unit = {},
office/src/main/java/com/vayunmathur/office/MainActivity.kt
diff --git a/office/src/main/java/com/vayunmathur/office/MainActivity.kt b/office/src/main/java/com/vayunmathur/office/MainActivity.ktindex 9228f496ae..0319cc6f4c 100644--- a/office/src/main/java/com/vayunmathur/office/MainActivity.kt+++ b/office/src/main/java/com/vayunmathur/office/MainActivity.kt@@ -339,7 +339,7 @@ private fun OnlineInit(viewModel: OfficeViewModel) { @OptIn(ExperimentalMaterial3Api::class) @Composable private fun OnlineDisabledScreen(onEnable: () -> Unit) {- Scaffold(topBar = { TopAppBar(title = { Text(stringResource(R.string.online)) }) }) { pad ->+ Scaffold { pad -> Column( Modifier.fillMaxSize().padding(pad).padding(24.dp), horizontalAlignment = Alignment.CenterHorizontally
vpn/src/main/java/com/vayunmathur/vpn/ui/LoggingPage.kt
diff --git a/vpn/src/main/java/com/vayunmathur/vpn/ui/LoggingPage.kt b/vpn/src/main/java/com/vayunmathur/vpn/ui/LoggingPage.ktindex 9e453397f4..cadac8575c 100644--- a/vpn/src/main/java/com/vayunmathur/vpn/ui/LoggingPage.kt+++ b/vpn/src/main/java/com/vayunmathur/vpn/ui/LoggingPage.kt@@ -89,7 +89,6 @@ fun LoggingContent( Scaffold( topBar = { TopAppBar(- title = { Text(stringResource(R.string.logging)) }, actions = { IconButton(onClick = { showDeleteDialog = true }) { IconDelete()
youpipe/src/main/java/com/vayunmathur/youpipe/ui/DownloadedVideosPage.kt
diff --git a/youpipe/src/main/java/com/vayunmathur/youpipe/ui/DownloadedVideosPage.kt b/youpipe/src/main/java/com/vayunmathur/youpipe/ui/DownloadedVideosPage.ktindex 405012d16a..6acee6550a 100644--- a/youpipe/src/main/java/com/vayunmathur/youpipe/ui/DownloadedVideosPage.kt+++ b/youpipe/src/main/java/com/vayunmathur/youpipe/ui/DownloadedVideosPage.kt@@ -61,8 +61,10 @@ fun DownloadedVideosPage(backStack: NavBackStack<Route>, youPipeViewModel: YouPi topBar = { TopAppBar( title = { - val totalSelected = selectedIds.size + selectedActiveIds.size- Text(if (isSelectionMode) stringResource(R.string.selected_1, totalSelected) else stringResource(R.string.downloads)) + if (isSelectionMode) {+ val totalSelected = selectedIds.size + selectedActiveIds.size+ Text(stringResource(R.string.selected_1, totalSelected))+ } }, actions = { if (isSelectionMode) {
youpipe/src/main/java/com/vayunmathur/youpipe/ui/HistoryPage.kt
diff --git a/youpipe/src/main/java/com/vayunmathur/youpipe/ui/HistoryPage.kt b/youpipe/src/main/java/com/vayunmathur/youpipe/ui/HistoryPage.ktindex 97fdfc20ab..2bfe682a9e 100644--- a/youpipe/src/main/java/com/vayunmathur/youpipe/ui/HistoryPage.kt+++ b/youpipe/src/main/java/com/vayunmathur/youpipe/ui/HistoryPage.kt@@ -45,7 +45,6 @@ fun HistoryPage(backStack: NavBackStack<Route>, youPipeViewModel: YouPipeViewMod TopAppBar( title = { if (inSelectionMode) Text(stringResource(R.string.selected, selectedIds.size))- else Text(stringResource(R.string.title_history)) }, navigationIcon = { if (inSelectionMode) {
youpipe/src/main/java/com/vayunmathur/youpipe/ui/SettingsPage.kt
diff --git a/youpipe/src/main/java/com/vayunmathur/youpipe/ui/SettingsPage.kt b/youpipe/src/main/java/com/vayunmathur/youpipe/ui/SettingsPage.ktindex df7351fb66..ceb5aad473 100644--- a/youpipe/src/main/java/com/vayunmathur/youpipe/ui/SettingsPage.kt+++ b/youpipe/src/main/java/com/vayunmathur/youpipe/ui/SettingsPage.kt@@ -146,7 +146,6 @@ fun SettingsPage( } Scaffold(- topBar = { TopAppBar({ Text(stringResource(R.string.title_settings)) }) }, bottomBar = { BottomNavBar(backStack, MAIN_BOTTOM_BAR_ITEMS, Route.Settings) } ) { paddingValues -> if (!isLoading) {
youpipe/src/main/java/com/vayunmathur/youpipe/ui/SubscriptionsPage.kt
diff --git a/youpipe/src/main/java/com/vayunmathur/youpipe/ui/SubscriptionsPage.kt b/youpipe/src/main/java/com/vayunmathur/youpipe/ui/SubscriptionsPage.ktindex 9c8179a129..2b0abbabd2 100644--- a/youpipe/src/main/java/com/vayunmathur/youpipe/ui/SubscriptionsPage.kt+++ b/youpipe/src/main/java/com/vayunmathur/youpipe/ui/SubscriptionsPage.kt@@ -44,9 +44,7 @@ fun SubscriptionsPage( val fetchProgress by youPipeViewModel.fetchProgress.collectAsState() val context = androidx.compose.ui.platform.LocalContext.current - Scaffold(topBar = {- TopAppBar({ Text(stringResource(R.string.title_subscriptions)) })- }, bottomBar = { BottomNavBar(backStack, MAIN_BOTTOM_BAR_ITEMS, Route.SubscriptionsPage) }) { paddingValues ->+ Scaffold(bottomBar = { BottomNavBar(backStack, MAIN_BOTTOM_BAR_ITEMS, Route.SubscriptionsPage) }) { paddingValues -> LazyColumn(Modifier.padding(paddingValues)) { if (fetchProgress in 0f..1f) { item {