Fix STATE_DEPTH stuck at 1 after setting wallpaper

- Made BaseDepthController.setDepth/mDepth private, all get/set should be done through STATE_DEPTH or WIDGET_DEPTH
- Generified ClampedDepthProperty into Utilities.ClampedProperty to apply on STATE_DEPTH

Bug: 240580498
Test: Go to walppaper&style, set new wallpaper, then go to widget picker, wallpaper depth should transition smoothly
Change-Id: I53cdedf970fd7ffba6a952c4edf4b34251b01f07
This commit is contained in:
Alex Chau committed 2022-10-18 17:07:17 +01:00
1 parent 7c9144328a
commit 950a10738b
6 files changed
+47 -58

No files matched your search

@@ -107,12 +107,9 @@ public class MultiPropertyFactory<T> {
@Override
public Float get(T object) {
// The scale of the view should match mLastAggregatedValue. Still, if it has been
// changed without using this property, it can differ. As this get method is usually
// used to set the starting point on an animation, this would result in some jumps
// when the view scale is different than the last aggregated value. To stay on the
// safe side, let's return the real view scale.
return mProperty.get(object);
// Callers of MultiProperty should only care about the sub-property that it sets. If
// the overall value is needed, mProperty.get should be called directly.
return mValue;
}
@Override