mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: migrate list-detail layouts to Material 3 Adaptive Navigation3
- Replace the custom `AdaptiveListDetailScaffold` with the official `ListDetailSceneStrategy` to manage adaptive layout orchestration. - Integrate `ListDetailSceneStrategy` into `MeshtasticNavDisplay` to enable native pane switching based on the navigation backstack. - Update `ContactsNavigation` and `NodesNavigation` graphs to include `listPane()` and `detailPane()` metadata for relevant route entries. - Simplify `AdaptiveContactsScreen` and `AdaptiveNodeListScreen` by removing manual scaffold navigation logic and delegating to the navigation framework. - Add the `jetbrains.compose.material3.adaptive.navigation3` library dependency to `core:ui` and relevant feature modules. - Refactor `DesktopMainScreen` and `Main.kt` with minor formatting and indentation updates for better readability.
This commit is contained in:
parent
26aa8377c5
commit
9c9a1d7567
12 changed files with 72 additions and 301 deletions
|
|
@ -32,12 +32,14 @@ import org.meshtastic.core.ui.component.MeshtasticNavigationSuite
|
|||
import org.meshtastic.core.ui.viewmodel.UIViewModel
|
||||
import org.meshtastic.desktop.navigation.desktopNavGraph
|
||||
|
||||
/**
|
||||
* Desktop main screen — uses shared navigation components.
|
||||
*/
|
||||
/** Desktop main screen — uses shared navigation components. */
|
||||
@Composable
|
||||
fun DesktopMainScreen(uiViewModel: UIViewModel) {
|
||||
val backStack = androidx.navigation3.runtime.rememberNavBackStack(MeshtasticNavSavedStateConfig, NodesRoutes.NodesGraph as NavKey)
|
||||
val backStack =
|
||||
androidx.navigation3.runtime.rememberNavBackStack(
|
||||
MeshtasticNavSavedStateConfig,
|
||||
NodesRoutes.NodesGraph as NavKey,
|
||||
)
|
||||
|
||||
Surface(modifier = Modifier.fillMaxSize()) {
|
||||
MeshtasticAppShell(
|
||||
|
|
@ -45,10 +47,12 @@ fun DesktopMainScreen(uiViewModel: UIViewModel) {
|
|||
uiViewModel = uiViewModel,
|
||||
hostModifier = Modifier.padding(bottom = 24.dp),
|
||||
) {
|
||||
MeshtasticNavigationSuite(backStack = backStack, uiViewModel = uiViewModel, modifier = Modifier.fillMaxSize()) {
|
||||
val provider = entryProvider<NavKey> {
|
||||
desktopNavGraph(backStack, uiViewModel)
|
||||
}
|
||||
MeshtasticNavigationSuite(
|
||||
backStack = backStack,
|
||||
uiViewModel = uiViewModel,
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
) {
|
||||
val provider = entryProvider<NavKey> { desktopNavGraph(backStack, uiViewModel) }
|
||||
MeshtasticNavDisplay(backStack = backStack, entryProvider = provider, modifier = Modifier.fillMaxSize())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue