Pablo
02/05/2025, 4:49 PMListDetailPaneScaffold
inside a`NavigationSuiteScaffold`? I need both behaviours, NavigationSuiteScaffold
whould manage all the navigation of the application, but in one screen, I need list detail, so for that screen I need to embed it.Alex Vanyo
02/05/2025, 6:01 PMPablo
02/05/2025, 6:06 PMNavigationSuiteScaffold
or a custom navigation container... the App.kt scaffold and shared functionality is always onscreen, when you navigate to screen A, screen B or screen C, the parent App.kt scaffold is still visible.
So, in this case, should the app have a AppViewModel
loaded and managing the shared logic (currentDestination, navigation, logic for display about us dialog, other possible shared logic that can be launched from all the screens... ) and also a ScreenAViewModel
, ScreenBViewModel
etc... that can coexist at once with AppViewModel
?Pablo
02/05/2025, 6:10 PMPablo
02/05/2025, 6:10 PMAlex Vanyo
02/05/2025, 8:50 PMViewModel
, and you can scope `ViewModel`s to have different lifecycles. It sounds like AppViewModel
would be scoped to the overall Activity
, and then the different screen view models would be scoped to a particular screen.
Communicating between view models with different scopes is tricky though, and you can’t scope a ViewModel
easily within ListDetailPaneScaffold
either.
Probably the most straightforward route is to have a ViewModel
scoped to a destination that can handle everything in the list, detail, and showing both together, and then use a ListDetaliPaneScaffold
within that level.Pablo
02/05/2025, 11:10 PM