commit | 8188878db7495d09b4a71418c3cf8a5fe99e1831 | [log] [tgz] |
---|---|---|
author | George Lin <giolin@google.com> | Wed Apr 19 23:03:22 2023 +0000 |
committer | George Lin <giolin@google.com> | Thu Apr 27 20:31:24 2023 +0000 |
tree | dd42ae181db387c57b54759fa52d18d10b900724 | |
parent | d1d1b5a8b7e6622c66b4b253c3de41daa8cd44a6 [diff] |
Make fragment the owner of the view model Clock settings view model should live under the scope of the fragment, which means a new fragment should use a new view model. Test: Manually tested a new view model created whenever a new fragment. See bug. Bug: 279948130 Change-Id: Ifced266f5421b95c53bbbbdbbd22442af03f4a6a
diff --git a/src/com/android/customization/picker/clock/ui/fragment/ClockSettingsFragment.kt b/src/com/android/customization/picker/clock/ui/fragment/ClockSettingsFragment.kt index 7233c80..88d6d8e 100644 --- a/src/com/android/customization/picker/clock/ui/fragment/ClockSettingsFragment.kt +++ b/src/com/android/customization/picker/clock/ui/fragment/ClockSettingsFragment.kt
@@ -118,7 +118,7 @@ ClockSettingsBinder.bind( view, ViewModelProvider( - activity, + this, injector.getClockSettingsViewModelFactory( context, injector.getWallpaperColorsViewModel(),