diff --git a/app/src/main/kotlin/top/fatweb/oxygen/toolbox/navigation/TopLevelDestination.kt b/app/src/main/kotlin/top/fatweb/oxygen/toolbox/navigation/TopLevelDestination.kt index 9653dd9..cdd6f33 100644 --- a/app/src/main/kotlin/top/fatweb/oxygen/toolbox/navigation/TopLevelDestination.kt +++ b/app/src/main/kotlin/top/fatweb/oxygen/toolbox/navigation/TopLevelDestination.kt @@ -6,12 +6,14 @@ import top.fatweb.oxygen.toolbox.R import top.fatweb.oxygen.toolbox.icon.OxygenIcons enum class TopLevelDestination( + val route: String, val selectedIcon: ImageVector, val unselectedIcon: ImageVector, @StringRes val iconTextId: Int, @StringRes val titleTextId: Int ) { ToolStore( + route = "tool_store_route", selectedIcon = OxygenIcons.Store, unselectedIcon = OxygenIcons.StoreBorder, iconTextId = R.string.feature_store_title, @@ -19,6 +21,7 @@ enum class TopLevelDestination( ), Tools( + route = "tools_route", selectedIcon = OxygenIcons.Home, unselectedIcon = OxygenIcons.HomeBorder, iconTextId = R.string.feature_tools_title, @@ -26,6 +29,7 @@ enum class TopLevelDestination( ), Star( + route = "star_route", selectedIcon = OxygenIcons.Star, unselectedIcon = OxygenIcons.StarBorder, iconTextId = R.string.feature_star_title, diff --git a/app/src/main/kotlin/top/fatweb/oxygen/toolbox/ui/OxygenApp.kt b/app/src/main/kotlin/top/fatweb/oxygen/toolbox/ui/OxygenApp.kt index 6a4cbd5..db7353f 100644 --- a/app/src/main/kotlin/top/fatweb/oxygen/toolbox/ui/OxygenApp.kt +++ b/app/src/main/kotlin/top/fatweb/oxygen/toolbox/ui/OxygenApp.kt @@ -252,5 +252,5 @@ private fun OxygenNavRail( private fun NavDestination?.isTopLevelDestinationInHierarchy(destination: TopLevelDestination) = this?.hierarchy?.any { - it.route?.contains(destination.name, true) ?: false + it.route?.equals(destination.route) ?: false } ?: false