Let taskbar can trigger insets resize animation
All the system bar can trigger insets resize animation before, but some
sources might not have the resize animation. The framework now will only
trigger insets resize animation for sources which apply
FLAG_ANIMATE_RESIZING. So this CL applies the flag for gesture taskbar
because it can toggle its size via "Always show Taskbar"
Bug: 291562764
Flag: NA
Test: Fold and unfold a foldable device and ensure that won't create
InsetsResizeAnimationRunner.
Change-Id: I0d915422d160a81f12c3992ffe53200fd957f6d7
This commit is contained in:
@@ -28,6 +28,7 @@ import android.view.DisplayInfo
|
||||
import android.view.Gravity
|
||||
import android.view.InsetsFrameProvider
|
||||
import android.view.InsetsFrameProvider.SOURCE_DISPLAY
|
||||
import android.view.InsetsSource.FLAG_ANIMATE_RESIZING
|
||||
import android.view.InsetsSource.FLAG_INSETS_ROUNDED_CORNER
|
||||
import android.view.InsetsSource.FLAG_SUPPRESS_SCRIM
|
||||
import android.view.Surface
|
||||
@@ -201,10 +202,14 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas
|
||||
*/
|
||||
private fun getProvidedInsets(insetsRoundedCornerFlag: Int): Array<InsetsFrameProvider> {
|
||||
val navBarsFlag =
|
||||
(if (context.isGestureNav) FLAG_SUPPRESS_SCRIM else 0) or insetsRoundedCornerFlag
|
||||
(if (context.isGestureNav) FLAG_SUPPRESS_SCRIM or FLAG_ANIMATE_RESIZING else 0) or
|
||||
insetsRoundedCornerFlag
|
||||
return arrayOf(
|
||||
InsetsFrameProvider(insetsOwner, 0, navigationBars())
|
||||
.setFlags(navBarsFlag, FLAG_SUPPRESS_SCRIM or FLAG_INSETS_ROUNDED_CORNER),
|
||||
.setFlags(
|
||||
navBarsFlag,
|
||||
FLAG_SUPPRESS_SCRIM or FLAG_ANIMATE_RESIZING or FLAG_INSETS_ROUNDED_CORNER
|
||||
),
|
||||
InsetsFrameProvider(insetsOwner, 0, tappableElement()),
|
||||
InsetsFrameProvider(insetsOwner, 0, mandatorySystemGestures()),
|
||||
InsetsFrameProvider(insetsOwner, INDEX_LEFT, systemGestures())
|
||||
|
||||
Reference in New Issue
Block a user