Skip to content

Commit

Permalink
Initial help topics screen from main menu
Browse files Browse the repository at this point in the history
Code to display the help text originating from the iOS resources. The
Sections data structure is designed to make it easy to add in new
Sections of help, FAQ and tips.
  • Loading branch information
davecraig committed Feb 4, 2025
1 parent eca2afa commit a896ff7
Show file tree
Hide file tree
Showing 4 changed files with 593 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fun DrawerContent(
icon = Icons.Rounded.Settings,
)
DrawerMenuItem(
onClick = { notAvailableToast() },
onClick = { onNavigate(HomeRoutes.Help.route + "/home") },
label = stringResource(R.string.menu_help_and_tutorials),
Icons.AutoMirrored.Rounded.HelpOutline,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ sealed class HomeRoutes(
route = "edit_route_screen",
title = "EditDetailsScreen",
)
data object Help : HomeRoutes(
route = "help_screen",
title = "HelpScreen",
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.navigation.compose.composable
import com.google.gson.GsonBuilder
import kotlinx.coroutines.flow.MutableStateFlow
import org.scottishtecharmy.soundscape.screens.home.data.LocationDescription
import org.scottishtecharmy.soundscape.screens.home.home.HelpScreen
import org.scottishtecharmy.soundscape.screens.home.home.Home
import org.scottishtecharmy.soundscape.screens.home.locationDetails.LocationDetailsScreen
import org.scottishtecharmy.soundscape.screens.home.locationDetails.generateLocationDetailsRoute
Expand Down Expand Up @@ -173,5 +174,23 @@ fun HomeScreen(
modifier = Modifier.windowInsetsPadding(WindowInsets.safeDrawing)
)
}

composable(HomeRoutes.RouteDetails.route + "/{routeName}") { backStackEntry ->
val routeName = backStackEntry.arguments?.getString("routeName") ?: ""
RouteDetailsScreenVM(
routeName = routeName,
navController = navController,
modifier = Modifier.windowInsetsPadding(WindowInsets.safeDrawing)
)
}

composable(HomeRoutes.Help.route + "/{topic}") { backStackEntry ->
val topic = backStackEntry.arguments?.getString("topic") ?: ""
HelpScreen(
topic = topic,
navController = navController,
modifier = Modifier.windowInsetsPadding(WindowInsets.safeDrawing)
)
}
}
}
Loading

0 comments on commit a896ff7

Please sign in to comment.