Use ViewHierarchyAnimator to animate media container layout.
Instead of LayoutTransition.
- The main advantage over LayoutTransition: no need for the second
OnLayoutChangeListener. With LayoutTransition, the second
OnLayoutChangeListener is necessary in order to disable the
LayoutTransition.CHANGING.
- The main disadvantage is testing. It's tricky to verify the usage of
ViewHierarchyAnimator.Companion methods. But it's still achievable,
via java reflect. (ViewHierarchyAnimator.Companion is essentially
a singleton.)
The transition basially looks the same as with LayoutTransition. It does
use a different interpolator: Interpolators.STANDARD vs DECELERATE.
Other transitions tested include:
- Same transition not in split shade
- AOD <-> Lockscreen <-> Launcher
- Fold / unfold, and rotate
- Pick a different wallpaper/clock
Bug: 296907535
Test: On split shade with media, turn on/off flashlight via shortcut.
Test: With CHANGING duration = 10000, test other transitions with media.
Test: KeyguardStatusViewControllerTest
Change-Id: I9f41d75edd54196706e9f6009c9089148ffe7707
5 files changed