Fixed
Status Update
Comments
[Deleted User] <[Deleted User]> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit c60f33e229e31ab328ef6b59dab63b264954831c
Author: Alexandre Elias <aelias@google.com>
Date: Fri Jul 10 16:23:09 2020
Semantics no-op cleanups
Partly in response to lmr's broad code review, I did a pass of
superficial API/implementation cleanup. The main changes are:
- I changed each Boolean SemanticsProperty where false is equivalent to
not being present to take "Unit" instead. This is conceptually
clearer: it avoids questions like "can I cancel out a semantics from a
merged child by setting it to false?" Because "property = Unit" looks
weird, I also changed the style of these to "property()".
- I moved the Semantics id generator closer to where it's used, in
SemanticsModifierCore. I made it internal and an AtomicInt.
(Note that integer ids are heavily used in the Android
AccessibilityNodeInfo APIs so I can't simply remove them entirely.)
- I deleted dead code. Some examples include SemanticsHintOverrides,
a public API not connected to anything, and SemanticsPropertyKey
merge() open method which is never called. (In both cases I have
a different plan in mind for accessibility.)
Fixes: 145951226
Fixes: 145955412
Test: existing tests
Relnote: "Single-value semantics properties now use a calling style.
For example, 'semantics { hidden = true }' is now written as:
'semantics { hidden() }'."
Change-Id: Ic1afd12ea22c926babc9662f1804d80b33aa0cfc
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/LayoutNodeModifierBenchmark.kt
M ui/ui-core/api/0.1.0-dev15.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev15.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/graphics/vector/VectorTest.kt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeView.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeViewAccessibilityDelegateCompat.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidPopup.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
D ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
M ui/ui-foundation/api/0.1.0-dev15.txt
M ui/ui-foundation/api/current.txt
M ui/ui-foundation/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-foundation/api/public_plus_experimental_current.txt
M ui/ui-foundation/api/restricted_0.1.0-dev15.txt
M ui/ui-foundation/api/restricted_current.txt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Clickable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Dialog.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Selectable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Toggleable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/semantics/FoundationSemanticsProperties.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/AppBar.kt
M ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
M ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
M ui/ui-text/api/0.1.0-dev15.txt
M ui/ui-text/api/current.txt
M ui/ui-text/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-text/api/public_plus_experimental_current.txt
M ui/ui-text/api/restricted_0.1.0-dev15.txt
M ui/ui-text/api/restricted_current.txt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/CoreTextField.kt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/TextSemanticsProperties.kt
https://android-review.googlesource.com/1360099
Branch: androidx-master-dev
commit c60f33e229e31ab328ef6b59dab63b264954831c
Author: Alexandre Elias <aelias@google.com>
Date: Fri Jul 10 16:23:09 2020
Semantics no-op cleanups
Partly in response to lmr's broad code review, I did a pass of
superficial API/implementation cleanup. The main changes are:
- I changed each Boolean SemanticsProperty where false is equivalent to
not being present to take "Unit" instead. This is conceptually
clearer: it avoids questions like "can I cancel out a semantics from a
merged child by setting it to false?" Because "property = Unit" looks
weird, I also changed the style of these to "property()".
- I moved the Semantics id generator closer to where it's used, in
SemanticsModifierCore. I made it internal and an AtomicInt.
(Note that integer ids are heavily used in the Android
AccessibilityNodeInfo APIs so I can't simply remove them entirely.)
- I deleted dead code. Some examples include SemanticsHintOverrides,
a public API not connected to anything, and SemanticsPropertyKey
merge() open method which is never called. (In both cases I have
a different plan in mind for accessibility.)
Fixes: 145951226
Fixes: 145955412
Test: existing tests
Relnote: "Single-value semantics properties now use a calling style.
For example, 'semantics { hidden = true }' is now written as:
'semantics { hidden() }'."
Change-Id: Ic1afd12ea22c926babc9662f1804d80b33aa0cfc
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/LayoutNodeModifierBenchmark.kt
M ui/ui-core/api/0.1.0-dev15.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev15.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/graphics/vector/VectorTest.kt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeView.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeViewAccessibilityDelegateCompat.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidPopup.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
D ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
M ui/ui-foundation/api/0.1.0-dev15.txt
M ui/ui-foundation/api/current.txt
M ui/ui-foundation/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-foundation/api/public_plus_experimental_current.txt
M ui/ui-foundation/api/restricted_0.1.0-dev15.txt
M ui/ui-foundation/api/restricted_current.txt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Clickable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Dialog.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Selectable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Toggleable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/semantics/FoundationSemanticsProperties.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/AppBar.kt
M ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
M ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
M ui/ui-text/api/0.1.0-dev15.txt
M ui/ui-text/api/current.txt
M ui/ui-text/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-text/api/public_plus_experimental_current.txt
M ui/ui-text/api/restricted_0.1.0-dev15.txt
M ui/ui-text/api/restricted_current.txt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/CoreTextField.kt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/TextSemanticsProperties.kt
ka...@gmail.com <ka...@gmail.com> #3
We need ViewModelStoreOwner that will only live during our scoped flow. As an option - we could nest fragments and use parent fragment as ViewModelStoreOwner like this:
ViewModelProviders.of(getParentFragment()).get(viewModelClass)
This would both keep ViewModel accessible to child fragments and local to the parent fragment. All ViewModels that were created using parent fragment will be cleared after parent fragment will be popped off backstack.
However, nesting fragments and configurating proper navigation still isn't easy in 1.0.0-alpha09.
ViewModelProviders.of(getParentFragment()).get(viewModelClass)
This would both keep ViewModel accessible to child fragments and local to the parent fragment. All ViewModels that were created using parent fragment will be cleared after parent fragment will be popped off backstack.
However, nesting fragments and configurating proper navigation still isn't easy in 1.0.0-alpha09.
[Deleted User] <[Deleted User]> #4
I've been using (and kind of abusing) nested fragments at work to hold the flow ViewModel like you said (but we're not using navigation library). But they bring their own set of issues. Animations are pain because popping a parent fragment instantly pops their children without animation. You get a white screen while popping the parent.
And I'm not even sure if Google intends to make the parent/child fragment relation as good as activity/fragment.
And I'm not even sure if Google intends to make the parent/child fragment relation as good as activity/fragment.
ca...@gmail.com <ca...@gmail.com> #5
Any suggestions for a workaround until an official solution is released? The only way I can think of is break my nav_graph into graphs that match the scope that I want for my viewmodel, but then that becomes inflexible since I might want to share viewmodels across different graphs.
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit a57c661958456fc4782121ec37858fd767d5d2f2
Author: jbwoods <jbwoods@google.com>
Date: Mon Mar 25 17:29:53 2019
Class ViewModelLazy class to take a ViewModelStoreProducer
Changed ViewModelLazy to take a ViewModelStoreProducer instead of a
ViewModelStoreOwner making the class more generic.
Test: ran FragmentViewModelLazy, ActivityViewModelLazy, and
ViewModelProvider test.
./gradle checkApi
BUG: 111614463
Change-Id: I111b4df94cd6c8b272a2fec89a66de86616aa1ad
M activity/ktx/src/main/java/androidx/activity/ActivityViewModelLazy.kt
M fragment/ktx/api/1.1.0-alpha06.txt
M fragment/ktx/api/current.txt
M fragment/ktx/src/main/java/androidx/fragment/app/FragmentViewModelLazy.kt
M lifecycle/viewmodel/ktx/api/2.1.0-alpha04.txt
M lifecycle/viewmodel/ktx/api/current.txt
M lifecycle/viewmodel/ktx/src/main/java/androidx/lifecycle/ViewModelProvider.kt
M lifecycle/viewmodel/ktx/src/test/java/androidx/lifecycle/ViewModelLazyTest.kt
https://android-review.googlesource.com/932932
https://goto.google.com/android-sha1/a57c661958456fc4782121ec37858fd767d5d2f2
Branch: androidx-master-dev
commit a57c661958456fc4782121ec37858fd767d5d2f2
Author: jbwoods <jbwoods@google.com>
Date: Mon Mar 25 17:29:53 2019
Class ViewModelLazy class to take a ViewModelStoreProducer
Changed ViewModelLazy to take a ViewModelStoreProducer instead of a
ViewModelStoreOwner making the class more generic.
Test: ran FragmentViewModelLazy, ActivityViewModelLazy, and
ViewModelProvider test.
./gradle checkApi
BUG: 111614463
Change-Id: I111b4df94cd6c8b272a2fec89a66de86616aa1ad
M activity/ktx/src/main/java/androidx/activity/ActivityViewModelLazy.kt
M fragment/ktx/api/1.1.0-alpha06.txt
M fragment/ktx/api/current.txt
M fragment/ktx/src/main/java/androidx/fragment/app/FragmentViewModelLazy.kt
M lifecycle/viewmodel/ktx/api/2.1.0-alpha04.txt
M lifecycle/viewmodel/ktx/api/current.txt
M lifecycle/viewmodel/ktx/src/main/java/androidx/lifecycle/ViewModelProvider.kt
M lifecycle/viewmodel/ktx/src/test/java/androidx/lifecycle/ViewModelLazyTest.kt
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 1e09fdb1e5ce72359698bf5fa37e31a931e8c575
Author: jbwoods <jbwoods@google.com>
Date: Mon Mar 25 22:36:00 2019
Add ViewModel support at NavGraph scope
Allows users to get a ViewModelStore for a NavGraph. The ViewModelStore
is retrieved using the graph ID. Only NavGraphs on the NavController
back stack can create a ViewModelStore.
Test: New Tests and reran NavControllerTest
./gradlew checkApi
BUG: 111614463
Change-Id: Ib60bb0eda2c1dc9d2cd5a5aa132162105d172b68
M navigation/common/src/main/java/androidx/navigation/NavBackStackEntry.java
M navigation/fragment/ktx/api/2.1.0-alpha02.txt
M navigation/fragment/ktx/api/current.txt
M navigation/fragment/ktx/build.gradle
A navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/NavGraphViewModelLazyTest.kt
A navigation/fragment/ktx/src/main/java/androidx/navigation/NavGraphViewModelLazy.kt
M navigation/fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.java
M navigation/runtime/api/2.1.0-alpha02.txt
M navigation/runtime/api/current.txt
M navigation/runtime/build.gradle
M navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
A navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerViewModelTest.kt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
A navigation/runtime/src/main/java/androidx/navigation/NavControllerViewModel.java
https://android-review.googlesource.com/932046
https://goto.google.com/android-sha1/1e09fdb1e5ce72359698bf5fa37e31a931e8c575
Branch: androidx-master-dev
commit 1e09fdb1e5ce72359698bf5fa37e31a931e8c575
Author: jbwoods <jbwoods@google.com>
Date: Mon Mar 25 22:36:00 2019
Add ViewModel support at NavGraph scope
Allows users to get a ViewModelStore for a NavGraph. The ViewModelStore
is retrieved using the graph ID. Only NavGraphs on the NavController
back stack can create a ViewModelStore.
Test: New Tests and reran NavControllerTest
./gradlew checkApi
BUG: 111614463
Change-Id: Ib60bb0eda2c1dc9d2cd5a5aa132162105d172b68
M navigation/common/src/main/java/androidx/navigation/NavBackStackEntry.java
M navigation/fragment/ktx/api/2.1.0-alpha02.txt
M navigation/fragment/ktx/api/current.txt
M navigation/fragment/ktx/build.gradle
A navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/NavGraphViewModelLazyTest.kt
A navigation/fragment/ktx/src/main/java/androidx/navigation/NavGraphViewModelLazy.kt
M navigation/fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.java
M navigation/runtime/api/2.1.0-alpha02.txt
M navigation/runtime/api/current.txt
M navigation/runtime/build.gradle
M navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
A navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerViewModelTest.kt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
A navigation/runtime/src/main/java/androidx/navigation/NavControllerViewModel.java
il...@google.com <il...@google.com> #8
Navigation 2.1.0-alpha02 now supports ViewModels at the navigation graph level.
This allows you to write such as:
val viewModel: RegistrationViewModel
by navGraphViewModels(R.id.registration_graph) { factory }
or if you're using Java:
ViewModelStore store =
navController.getViewModelStore(R.id.registration_graph);
RegistrationViewModel viewModel = new ViewModelProvider(store, factory);
And the ViewModel will live until the containing host and its ViewModelStore is cleared or the navigation graph is popped off the back stack.
This allows you to write such as:
val viewModel: RegistrationViewModel
by navGraphViewModels(R.id.registration_graph) { factory }
or if you're using Java:
ViewModelStore store =
navController.getViewModelStore(R.id.registration_graph);
RegistrationViewModel viewModel = new ViewModelProvider(store, factory);
And the ViewModel will live until the containing host and its ViewModelStore is cleared or the navigation graph is popped off the back stack.
ap...@google.com <ap...@google.com> #9
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 3cc9b77742508c095f3268b60956967bce46f0ed
Author: Ian Lake <ilake@google.com>
Date: Sat Mar 30 08:40:04 2019
Save and restore back stack UUIDs for getViewModelStore()
As each NavBackStackEntry has a UUID which matches
the non-config ViewModelStore for each graph, we
need to make sure that those UUIDs are properly
saved and restored across configuration changes to
ensure that when you ask for a particular
ViewModelStore, you get the same object back.
Test: new testSaveRestoreGetViewModelStore
BUG: 111614463
Change-Id: Ie174eeae7318e9b8ba233e58df57f960a8861d99
M navigation/common/src/main/java/androidx/navigation/NavBackStackEntry.java
M navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
https://android-review.googlesource.com/936699
https://goto.google.com/android-sha1/3cc9b77742508c095f3268b60956967bce46f0ed
Branch: androidx-master-dev
commit 3cc9b77742508c095f3268b60956967bce46f0ed
Author: Ian Lake <ilake@google.com>
Date: Sat Mar 30 08:40:04 2019
Save and restore back stack UUIDs for getViewModelStore()
As each NavBackStackEntry has a UUID which matches
the non-config ViewModelStore for each graph, we
need to make sure that those UUIDs are properly
saved and restored across configuration changes to
ensure that when you ask for a particular
ViewModelStore, you get the same object back.
Test: new testSaveRestoreGetViewModelStore
BUG: 111614463
Change-Id: Ie174eeae7318e9b8ba233e58df57f960a8861d99
M navigation/common/src/main/java/androidx/navigation/NavBackStackEntry.java
M navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
tu...@gmail.com <tu...@gmail.com> #10
unresolved reference: by navGraphViewModels(R.id...)?
[Deleted User] <[Deleted User]> #11
In that case what if I have a global navigation action screen let's say for this example a CountryPickerFragment where I want to share data between this screen and the parent caller fragment only (not the entire navigation graph) and I want it cleared after the parent is done how could I scope the ViewModel in that case?
[Deleted User] <[Deleted User]> #12
That is a different issue, that is not yet available. What you want is actually opening a screen while waiting for a result. Check:
https://issuetracker.google.com/issues/79672220
b9...@gmail.com <b9...@gmail.com> #13
What's the difference between graph scoped and parent Fragment/Activity scoped ViewModel?
Navigation graph use child fragment manager to navigate its graph, I think it equals to use parent Fragment scoped ViewModel.
Navigation graph use child fragment manager to navigate its graph, I think it equals to use parent Fragment scoped ViewModel.
ra...@gmail.com <ra...@gmail.com> #14
In reference to #8 how would this work when one needs to implement an app flow of "single activity wih multiple fragments" where also you could share a parent fragment viewmodel with it's child/nested fragments. Referring to your talk on Google IO/19 navGraphViewModels work with only the fragments within the same graph, so how does one share the parent fragment viewmodel with it's child fragment in such a case?
ma...@gmail.com <ma...@gmail.com> #15
In reference to #14... ¿When using dynamic feature modules, the navGraphViewModels property delegate work while the destination are in the same nav graph, how do i handle the scenario when the destinations are included dynamically and separated in their respective DFM ?
Description
Version used: 1.0.0-alpha03
When using nested graph or included graphs to represent certain flows (such as user sign up or checkout), it would be nice to have a built in way to share data across all of these destinations while ensuring that it is cleaned up after the entire graph is removed from the back stack.
Effectively a ViewModel that has a scope somewhere between a single Fragment / ViewModelStoreOwner destination and an Activity scoped ViewModel.