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

Commit 877d9ecd authored by Xiaowen Lei's avatar Xiaowen Lei
Browse files

Animate notif stack when OnLayoutChange detects Smartspace visibility change.

The existing `keyguardSmartspaceViewModel.bcsmartspaceVisibility`
triggers a SmartspaceVisibility transition. However,
`bcsmartspaceVisibility` is set via a `OnGlobalLayoutListener`, which is
called after the layout bounds are already applied.

Since `viewModel.onNotificationContainerBoundsChanged` is called inside
`onLayoutChange`, the only way to make this work is to detect Smartspace
visibility change inside the same function.

I also tried calling the following inside `onLayoutChange`:
    `smartspaceInteractor.setBcSmartspaceVisibility(smartspaceVisibility)
     // requestLayout()
     childViews[bcSmartspaceId]?.requestLayout()
     return;`.
My hope was that the immediate next call of `onLayoutChange` would get
the SmartspaceVisibility transtion. However, the SmartspaceVisibility
transition didn't come until a few calls later. So that didn't work.

The value of `bcsmartspaceVisibility` is updated in the immediate next
call of `onLayoutChange`, regardless of whether it's set in
`onLayoutChange` or via the `OnGlobalLayoutListener`. So I left it
untouched.

Also cleaned up some unused parameters.

Flag: EXEMPT bugfix
Fix: 393871116
Test: on device, use flashlight shortcut to turn flashlight on/off (when
there is no other content in the Lockscreen Smartspace)
Test: Presubmit

Change-Id: I8f06bf854af1c02d5e6de760cfc608a792b6c72d
parent 47bf2907
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