Animate the bubble bar for the first bubble

This change animates the bubble bar for the first bubble.
When we're in home -- the bubble bar bounces in and stays visible
When we're in app -- the bubble bar bounces in, then animates to
the stashed handle.
When the bubble bar auto expands, we currently animate the bubble
bar already expanded. In the future we'll time the expansion
until after the bubble bar settles in.

Demo: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/hIGwtb3YKyCT9Ke9adZNgY

Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Bug: 339066271
Test: atest BubbleBarViewAnimatorTest
Change-Id: I80ce55676b72a50bab23623e0b5c1e602690682f
This commit is contained in:
Liran Binyamin committed 2024-05-06 20:17:28 -04:00
1 parent b4b5e79ffe
commit aa73f595cf
5 files changed
+189 -19

No files matched your search

@@ -123,21 +123,17 @@ public class BubbleStashController {
}
/**
* Animates the bubble bar and handle to their initial state, transitioning from the state where
* both views are invisible. Called when the first bubble is added or when the device is
* Animates the handle (or bubble bar depending on state) to be visible after the device is
* unlocked.
*
* <p>Normally either the bubble bar or the handle is visible,
* and {@link #showBubbleBar(boolean)} and {@link #stashBubbleBar()} are used to transition
* between these two states. But the transition from the state where both the bar and handle
* are invisible is slightly different.
*
* <p>The initial state will depend on the current state of the device, i.e. overview, home etc
* and whether bubbles are requested to be expanded.
*/
public void animateToInitialState(boolean expanding) {
private void animateAfterUnlock() {
AnimatorSet animatorSet = new AnimatorSet();
if (expanding || mBubblesShowingOnHome || mBubblesShowingOnOverview) {
if (mBubblesShowingOnHome || mBubblesShowingOnOverview) {
mIsStashed = false;
animatorSet.playTogether(mIconScaleForStash.animateToValue(1),
mIconTranslationYForStash.animateToValue(getBubbleBarTranslationY()),
@@ -217,7 +213,7 @@ public class BubbleStashController {
if (isSysuiLocked != mIsSysuiLocked) {
mIsSysuiLocked = isSysuiLocked;
if (!mIsSysuiLocked && mBarViewController.hasBubbles()) {
animateToInitialState(false /* expanding */);
animateAfterUnlock();
}
}
}
@@ -453,4 +449,9 @@ public class BubbleStashController {
mIsStashed = isStashed;
onIsStashedChanged();
}
/** Set the translation Y for the stashed handle. */
public void setHandleTranslationY(float ty) {
mHandleViewController.setTranslationYForSwipe(ty);
}
}