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
Loading
Please register or sign in to comment