Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b64adf8 authored by Kazuki Takise's avatar Kazuki Takise
Browse files

Integrate ActivityTransitionAnimator in CompatUI

This change integrates ActivityTransitionAnimator into CompatUI
so the user aspect ratio settings can be launched with the
expand animation.

- Animation invocation
The main logic is implemented in
`CompatUIController#launchUserAspectRatioSettings()`. (The no
animation version is now split out to
`launchUserAspectRatioSettings()`).

- Threading problem (`ActivityTransitionAnimator`)
Just removed the looper check. `mainExecutor` is supposed to
check if resposting to the main thead is needed, so this check
shouldn't be done by the caller. (At least conceptually. We need
to monitor performance regressions in reality.)

- View hierarchy change
Now the settings button has a fullscreen parent which is
requirement for the new animation to work.
`UserAspectRatioSettingsWindowManager` has `mLayoutParent` and
takes care of this new structure. We also need to not let the
fullscreen parent view steal input events by adding only the
button bounds to the touchable region.

- Layout lifecycle change
The layout stays alive until the end of the animation, and needs
to be cleaned up properly. To ensure this, `mIsAnimatingToHide`
is introduced to `UserAspectRatioSettingsWindowManager`, which
blocks all the calls to `release()` during the animation.
Clean-up will be handled in
`DelegateTransitionAnimatorController#onDispose()`.

- Layout bounds calculation change
Layout bounds are calculated in `getWindowLayoutParams()` and
`updateLayoutBounds()`, and this needs to be for the fullscreen
parent view of the button. Also bottom padding needs to be set
to the button.

Flag: com.android.window.flags.enable_compatui_sysui_launcher_fix
Bug: 300357441
Test: atest WMShellUnitTests:CompatUIControllerTest
Test: atest WMShellUnitTests:UserAspectRatioSettingsLayoutTest
Test: atest WMShellUnitTests:UserAspectRatioSettingsWindowManagerTest
Change-Id: I2c1eecf61bad51e293be3f6977fcc337475ce46c
parent 3142705c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment