Fix selected option not updated after applying color (2/2)
The issue comes from the diffing utils that we use to compare 2
OptionItemViewModels and update the recycler view. In
OptionItemViewModel, the equality check is overridden to check that the
flow values are equal, and not whether the flows are the same instance,
but flow values of the old items could be updated to match new items,
causing no view update. This was done to fix the original grid picker's
selection animation, which was janky because options were applied and
reloaded mid-animation (b/273336388). This will no longer be an issue
in the new picker UI, which uses the preview and apply pattern.
Therefore create a new OptionItemViewModel2 without overriding the
equality check.
Flag: com.android.systemui.shared.new_customization_picker_ui
Test: manually verified & unit tests
Bug: 350718581
Change-Id: If892a3f1dc011e9e2a3fd4a1eff507abb1e4d94a
5 files changed