Merge changes I74af6a72,I603a67a8 into main
* changes: Animate bubble bar alpha when notif shade opens Set bubble bar invisible while stashed
This commit is contained in:
commit
ea6e59537e
4 files changed
+78
-3
No files matched your search
@@ -946,7 +946,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides the taskbar icons and background when the notication shade is expanded.
|
||||
* Hides the taskbar icons and background when the notification shade is expanded.
|
||||
*/
|
||||
private void onNotificationShadeExpandChanged(boolean isExpanded, boolean skipAnim) {
|
||||
float alpha = isExpanded ? 0 : 1;
|
||||
@@ -955,6 +955,12 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
TaskbarViewController.ALPHA_INDEX_NOTIFICATION_EXPANDED).animateToValue(alpha));
|
||||
anim.play(mControllers.taskbarDragLayerController.getNotificationShadeBgTaskbar()
|
||||
.animateToValue(alpha));
|
||||
|
||||
mControllers.bubbleControllers.ifPresent(controllers -> {
|
||||
BubbleBarViewController bubbleBarViewController = controllers.bubbleBarViewController;
|
||||
anim.play(bubbleBarViewController.getBubbleBarAlpha().get(0).animateToValue(alpha));
|
||||
});
|
||||
|
||||
anim.start();
|
||||
if (skipAnim) {
|
||||
anim.end();
|
||||
|
||||
@@ -106,6 +106,8 @@ public class BubbleBarViewController {
|
||||
private boolean mHiddenForSysui;
|
||||
// Whether the bar is hidden because there are no bubbles.
|
||||
private boolean mHiddenForNoBubbles = true;
|
||||
// Whether the bar is hidden when stashed
|
||||
private boolean mHiddenForStashed;
|
||||
private boolean mShouldShowEducation;
|
||||
|
||||
public boolean mOverflowAdded;
|
||||
@@ -467,9 +469,17 @@ public class BubbleBarViewController {
|
||||
}
|
||||
}
|
||||
|
||||
/** Sets whether the bubble bar should be hidden due to stashed state */
|
||||
public void setHiddenForStashed(boolean hidden) {
|
||||
if (mHiddenForStashed != hidden) {
|
||||
mHiddenForStashed = hidden;
|
||||
updateVisibilityForStateChange();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: (b/273592694) animate it
|
||||
private void updateVisibilityForStateChange() {
|
||||
if (!mHiddenForSysui && !mHiddenForNoBubbles) {
|
||||
if (!mHiddenForSysui && !mHiddenForNoBubbles && !mHiddenForStashed) {
|
||||
mBarView.setVisibility(VISIBLE);
|
||||
} else {
|
||||
mBarView.setVisibility(INVISIBLE);
|
||||
|
||||
+17
-1
@@ -169,7 +169,11 @@ class TransientBubbleStashController(
|
||||
isStashed = true
|
||||
stashHandleViewAlpha?.let { animatorSet.playTogether(it.animateToValue(1f)) }
|
||||
}
|
||||
animatorSet.updateTouchRegionOnAnimationEnd().setDuration(BAR_STASH_DURATION).start()
|
||||
animatorSet
|
||||
.updateBarVisibility(isStashed)
|
||||
.updateTouchRegionOnAnimationEnd()
|
||||
.setDuration(BAR_STASH_DURATION)
|
||||
.start()
|
||||
}
|
||||
|
||||
override fun showBubbleBarImmediate() {
|
||||
@@ -186,6 +190,7 @@ class TransientBubbleStashController(
|
||||
bubbleBarBackgroundScaleX.updateValue(1f)
|
||||
bubbleBarBackgroundScaleY.updateValue(1f)
|
||||
isStashed = false
|
||||
bubbleBarViewController.setHiddenForStashed(false)
|
||||
onIsStashedChanged()
|
||||
}
|
||||
|
||||
@@ -200,6 +205,7 @@ class TransientBubbleStashController(
|
||||
bubbleBarBackgroundScaleX.updateValue(getStashScaleX())
|
||||
bubbleBarBackgroundScaleY.updateValue(getStashScaleY())
|
||||
isStashed = true
|
||||
bubbleBarViewController.setHiddenForStashed(true)
|
||||
onIsStashedChanged()
|
||||
}
|
||||
|
||||
@@ -481,6 +487,7 @@ class TransientBubbleStashController(
|
||||
animator?.cancel()
|
||||
animator =
|
||||
createStashAnimator(isStashed, BAR_STASH_DURATION).apply {
|
||||
updateBarVisibility(isStashed)
|
||||
updateTouchRegionOnAnimationEnd()
|
||||
start()
|
||||
}
|
||||
@@ -495,6 +502,15 @@ class TransientBubbleStashController(
|
||||
return this
|
||||
}
|
||||
|
||||
private fun <T : Animator> T.updateBarVisibility(stashed: Boolean): T {
|
||||
if (stashed) {
|
||||
doOnEnd { bubbleBarViewController.setHiddenForStashed(true) }
|
||||
} else {
|
||||
doOnStart { bubbleBarViewController.setHiddenForStashed(false) }
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
private fun Animator.setBubbleBarPivotDuringAnim(pivotX: Float, pivotY: Float): Animator {
|
||||
var initialPivotX = Float.NaN
|
||||
var initialPivotY = Float.NaN
|
||||
|
||||
Reference in new issue
Block a user