mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-28 02:32:24 -04:00
refactor: unify navigation display and enhance desktop adaptive layout
- Replace the standard `NavDisplay` with the custom `MeshtasticNavDisplay` in `AppIntroductionScreen` to centralize navigation and backstack handling. - Update `DesktopMainScreen` to transition from a persistent `NavigationRail` to an adaptive navigation shell. - Clean up unused imports related to `NavigationRail`, `NavKey`, and `NavDisplay` across desktop and intro features.
This commit is contained in:
@@ -19,7 +19,6 @@ package org.meshtastic.desktop.ui
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.NavigationRail
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
@@ -34,7 +33,7 @@ import org.meshtastic.core.ui.viewmodel.UIViewModel
|
||||
import org.meshtastic.desktop.navigation.desktopNavGraph
|
||||
|
||||
/**
|
||||
* Desktop main screen — Navigation 3 shell with a persistent [NavigationRail] and shared [MeshtasticNavDisplay].
|
||||
* Desktop main screen — Navigation 3 shell with adaptive navigation and shared [MeshtasticNavDisplay].
|
||||
*
|
||||
* Uses the same shared routes from `core:navigation` and the same `MeshtasticNavDisplay` + `entryProvider` pattern as
|
||||
* the Android app, proving the shared backstack architecture works across targets.
|
||||
|
||||
@@ -19,9 +19,7 @@ package org.meshtastic.feature.intro
|
||||
import android.Manifest
|
||||
import android.os.Build
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.navigation3.runtime.NavKey
|
||||
import androidx.navigation3.runtime.rememberNavBackStack
|
||||
import androidx.navigation3.ui.NavDisplay
|
||||
import com.google.accompanist.permissions.ExperimentalPermissionsApi
|
||||
import com.google.accompanist.permissions.PermissionState
|
||||
import com.google.accompanist.permissions.rememberMultiplePermissionsState
|
||||
@@ -58,9 +56,8 @@ fun AppIntroductionScreen(onDone: () -> Unit, viewModel: IntroViewModel) {
|
||||
|
||||
val backStack = rememberNavBackStack(Welcome)
|
||||
|
||||
NavDisplay<NavKey>(
|
||||
org.meshtastic.core.ui.component.MeshtasticNavDisplay(
|
||||
backStack = backStack,
|
||||
onBack = { backStack.removeLastOrNull() },
|
||||
entryProvider =
|
||||
introNavGraph(
|
||||
backStack = backStack,
|
||||
|
||||
Reference in New Issue
Block a user