Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions app/src/main/java/com/mapgie/goflo/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import androidx.compose.material.icons.filled.BarChart
import androidx.compose.material.icons.filled.Dashboard
import androidx.compose.material.icons.filled.DateRange
import androidx.compose.material.icons.filled.Home
import androidx.compose.material.icons.outlined.Tune
import androidx.compose.material.icons.filled.Settings
import android.graphics.Color as AndroidColor
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.Icon
Expand Down Expand Up @@ -238,7 +238,7 @@ private fun MainNavHost(app: GoFloApplication, currentTheme: AppTheme, pendingCa
NavigationBar {
NavigationBarItem(
colors = navItemColors,
selected = currentRoute == Screen.Home.route || currentRoute == Screen.Settings.route,
selected = currentRoute == Screen.Home.route || currentRoute == Screen.Manage.route,
onClick = { navController.navigate(Screen.Home.route) {
popUpTo(navController.graph.findStartDestination().id) { saveState = true }
launchSingleTop = true; restoreState = true
Expand Down Expand Up @@ -280,13 +280,13 @@ private fun MainNavHost(app: GoFloApplication, currentTheme: AppTheme, pendingCa
)
NavigationBarItem(
colors = navItemColors,
selected = currentRoute == Screen.Manage.route,
onClick = { navController.navigate(Screen.Manage.route) {
selected = currentRoute == Screen.Settings.route,
onClick = { navController.navigate(Screen.Settings.route) {
popUpTo(navController.graph.findStartDestination().id) { saveState = true }
launchSingleTop = true; restoreState = true
} },
icon = { Icon(Icons.Outlined.Tune, contentDescription = "Manage") },
label = { Text("Manage") }
icon = { Icon(Icons.Default.Settings, contentDescription = "Settings") },
label = { Text("Settings") }
)
}
}
Expand Down Expand Up @@ -372,7 +372,8 @@ private fun MainNavHost(app: GoFloApplication, currentTheme: AppTheme, pendingCa
},
onNavigateToLicenses = { navController.navigate(Screen.Licenses.route) },
onNavigateToPrivacy = { navController.navigate(Screen.Privacy.route) },
onNavigateToManageCategories = { navController.navigate(Screen.ManageCategories.route) }
onNavigateToManageCategories = { navController.navigate(Screen.ManageCategories.route) },
onNavigateToManage = { navController.navigate(Screen.Manage.route) }
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.Close
import androidx.compose.material.icons.filled.DateRange
import androidx.compose.material.icons.outlined.HelpOutline
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material.icons.outlined.Tune
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.IconButton
import androidx.compose.material3.Card
Expand Down Expand Up @@ -192,10 +192,10 @@ fun HomeScreen(
}
},
actions = {
IconButton(onClick = { onNavigate(Screen.Settings.route) }) {
IconButton(onClick = { onNavigate(Screen.Manage.route) }) {
Icon(
imageVector = Icons.Default.Settings,
contentDescription = "Settings",
imageVector = Icons.Outlined.Tune,
contentDescription = "Manage",
tint = MaterialTheme.colorScheme.onPrimaryContainer
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ fun SettingsScreen(
onNavigateToPinSetup: (changing: Boolean) -> Unit,
onNavigateToLicenses: () -> Unit,
onNavigateToPrivacy: () -> Unit,
onNavigateToManageCategories: () -> Unit = {}
onNavigateToManageCategories: () -> Unit = {},
onNavigateToManage: () -> Unit = {}
) {
val context = LocalContext.current
val prefs by viewModel.prefs.collectAsState()
Expand Down Expand Up @@ -607,13 +608,14 @@ fun SettingsScreen(

when (currentSubScreen) {
SettingsSubScreen.NONE -> SettingsMainList(
security = security,
currentTheme = currentTheme,
scrollState = mainListScrollState,
onBack = onBack,
onNavigateTo = { currentSubScreen = it },
onOpenDiscord = { openUrl(context, "https://discord.gg/xphnQCZeYq") },
onOpenSupport = { openUrl(context, "https://github.com/sponsors/mapgie") }
security = security,
currentTheme = currentTheme,
scrollState = mainListScrollState,
onBack = onBack,
onNavigateTo = { currentSubScreen = it },
onNavigateToManage = onNavigateToManage,
onOpenDiscord = { openUrl(context, "https://discord.gg/xphnQCZeYq") },
onOpenSupport = { openUrl(context, "https://github.com/sponsors/mapgie") }
)
SettingsSubScreen.CYCLE -> CycleSubScreen(
prefs = prefs,
Expand Down Expand Up @@ -690,6 +692,7 @@ private fun SettingsMainList(
scrollState: ScrollState,
onBack: () -> Unit,
onNavigateTo: (SettingsSubScreen) -> Unit,
onNavigateToManage: () -> Unit,
onOpenDiscord: () -> Unit,
onOpenSupport: () -> Unit,
) {
Expand Down Expand Up @@ -754,6 +757,16 @@ private fun SettingsMainList(
}
}

// ── MANAGE ────────────────────────────────────────────────────
SettingsNavItem(
title = "Manage",
subtitle = "Tracking modes, categories, cycle, and reminders",
icon = Icons.Outlined.Tune,
onClick = onNavigateToManage
)

HorizontalDivider(modifier = Modifier.padding(horizontal = 16.dp))

// ── PERSONALISATION ───────────────────────────────────────────
SettingsSectionHeader("Personalisation")
SettingsNavItem(
Expand Down
8 changes: 8 additions & 0 deletions changelog/unreleased/settings-manage-nav-swap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"bump": "minor",
"changed": [
"Settings now has its own spot on the bottom navigation bar",
"The home screen's top-right icon now opens Manage",
"Manage is now the first item in the Settings screen"
]
}
Loading