Animate alpha for bubbles and background (3/n)

Use separate timings for bubble icons and bubble bar background when
stashing and unstashing.
Follows alpha timings applied to taskbar background and icons.

Bug: 345488489
Test: TransientBubbleStashControllerTest
Test: stash and unstash bubble bar in app by swiping up from taskbar
Test: expand and collapse bubble bar in app by swiping up on bar
Test: expand and collapse bubble bar on home screen by tapping on it
Flag: com.android.wm.shell.enable_bubble_bar
Change-Id: I485f6346539cb6c8ea6dd4d15f25a6421021fec1
This commit is contained in:
Ats Jenk
2024-09-05 16:08:41 -07:00
parent 9ca662a7f7
commit 332828b340
4 changed files with 80 additions and 9 deletions
@@ -86,6 +86,9 @@ public class BubbleBarViewController {
// These are exposed to {@link BubbleStashController} to animate for stashing/un-stashing
private final MultiValueAlpha mBubbleBarAlpha;
private final AnimatedFloat mBubbleBarBubbleAlpha = new AnimatedFloat(this::updateBubbleAlpha);
private final AnimatedFloat mBubbleBarBackgroundAlpha = new AnimatedFloat(
this::updateBackgroundAlpha);
private final AnimatedFloat mBubbleBarScaleX = new AnimatedFloat(this::updateScaleX);
private final AnimatedFloat mBubbleBarScaleY = new AnimatedFloat(this::updateScaleY);
private final AnimatedFloat mBubbleBarBackgroundScaleX = new AnimatedFloat(
@@ -268,6 +271,14 @@ public class BubbleBarViewController {
return mBubbleBarAlpha;
}
public AnimatedFloat getBubbleBarBubbleAlpha() {
return mBubbleBarBubbleAlpha;
}
public AnimatedFloat getBubbleBarBackgroundAlpha() {
return mBubbleBarBackgroundAlpha;
}
public AnimatedFloat getBubbleBarScaleX() {
return mBubbleBarScaleX;
}
@@ -561,6 +572,14 @@ public class BubbleBarViewController {
mBarView.setBackgroundScaleY(scale);
}
private void updateBubbleAlpha(float alpha) {
mBarView.setBubbleAlpha(alpha);
}
private void updateBackgroundAlpha(float alpha) {
mBarView.setBackgroundAlpha(alpha);
}
//
// Manipulating the specific bubble views in the bar
//