Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +8 −4 Original line number Diff line number Diff line Loading @@ -785,6 +785,10 @@ public class BubbleStackView extends FrameLayout { StatsLog.BUBBLE_UICHANGED__ACTION__STACK_MOVED); } void onDragFinishAsDismiss() { mIsDragging = false; } /** * Calculates how large the expanded view of the bubble can be. This takes into account the * y position when the bubbles are expanded as well as the bounds of the dismiss target. Loading Loading @@ -824,9 +828,12 @@ public class BubbleStackView extends FrameLayout { if (updateMessage != null && !isExpanded() && !mIsExpansionAnimating && !mIsDragging) { final PointF stackPos = mStackAnimationController.getStackPosition(); mFlyout.setAlpha(0f); mFlyout.setVisibility(VISIBLE); mFlyoutText.setText(updateMessage); mFlyout.measure(WRAP_CONTENT, WRAP_CONTENT); mFlyout.post(() -> { post(() -> { final boolean onLeft = mStackAnimationController.isStackOnLeftSide(); final float destinationX = onLeft ? stackPos.x + mBubbleSize + mBubblePadding Loading @@ -835,9 +842,6 @@ public class BubbleStackView extends FrameLayout { // Translate towards the stack slightly, then spring out from the stack. mFlyout.setTranslationX(destinationX + (onLeft ? -mBubblePadding : mBubblePadding)); mFlyout.setTranslationY(stackPos.y); mFlyout.setAlpha(0f); mFlyout.setVisibility(VISIBLE); mFlyout.animate().alpha(1f); mFlyoutSpring.animateToFinalPosition(destinationX); Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleTouchHandler.java +1 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,7 @@ class BubbleTouchHandler implements View.OnTouchListener { trackMovement(event); if (mInDismissTarget && isStack) { mController.dismissStack(BubbleController.DISMISS_USER_GESTURE); mStack.onDragFinishAsDismiss(); } else if (isFlyout) { // TODO(b/129768381): Expand if tapped, dismiss if swiped away. if (!mStack.isExpanded() && !mMovedEnough) { Loading packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java +1 −0 Original line number Diff line number Diff line Loading @@ -535,6 +535,7 @@ public class StackAnimationController extends Log.d(TAG, String.format("Setting position to (%f, %f).", pos.x, pos.y)); mStackPosition.set(pos.x, pos.y); mLayout.cancelAllAnimations(); cancelStackPositionAnimations(); // Since we're not using the chained animations, apply the offsets manually. Loading packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleStackViewTest.java +1 −13 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import static org.mockito.Mockito.when; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.View; import android.widget.TextView; import androidx.test.filters.SmallTest; Loading Loading @@ -53,22 +52,11 @@ public class BubbleStackViewTest extends SysuiTestCase { } @Test public void testAnimateInFlyoutForBubble() throws InterruptedException { public void testAnimateInFlyoutForBubble() { when(mNotifEntry.getUpdateMessage(any())).thenReturn("Test Flyout Message."); mStackView.animateInFlyoutForBubble(mBubble); // Wait for the fade in. Thread.sleep(200); // Flyout should be visible and showing our text. assertEquals(1f, mStackView.findViewById(R.id.bubble_flyout).getAlpha(), .01f); assertEquals("Test Flyout Message.", ((TextView) mStackView.findViewById(R.id.bubble_flyout_text)).getText()); // Wait until it should have gone away. Thread.sleep(BubbleStackView.FLYOUT_HIDE_AFTER + 200); // Flyout should be gone. assertEquals(View.GONE, mStackView.findViewById(R.id.bubble_flyout).getVisibility()); } } Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +8 −4 Original line number Diff line number Diff line Loading @@ -785,6 +785,10 @@ public class BubbleStackView extends FrameLayout { StatsLog.BUBBLE_UICHANGED__ACTION__STACK_MOVED); } void onDragFinishAsDismiss() { mIsDragging = false; } /** * Calculates how large the expanded view of the bubble can be. This takes into account the * y position when the bubbles are expanded as well as the bounds of the dismiss target. Loading Loading @@ -824,9 +828,12 @@ public class BubbleStackView extends FrameLayout { if (updateMessage != null && !isExpanded() && !mIsExpansionAnimating && !mIsDragging) { final PointF stackPos = mStackAnimationController.getStackPosition(); mFlyout.setAlpha(0f); mFlyout.setVisibility(VISIBLE); mFlyoutText.setText(updateMessage); mFlyout.measure(WRAP_CONTENT, WRAP_CONTENT); mFlyout.post(() -> { post(() -> { final boolean onLeft = mStackAnimationController.isStackOnLeftSide(); final float destinationX = onLeft ? stackPos.x + mBubbleSize + mBubblePadding Loading @@ -835,9 +842,6 @@ public class BubbleStackView extends FrameLayout { // Translate towards the stack slightly, then spring out from the stack. mFlyout.setTranslationX(destinationX + (onLeft ? -mBubblePadding : mBubblePadding)); mFlyout.setTranslationY(stackPos.y); mFlyout.setAlpha(0f); mFlyout.setVisibility(VISIBLE); mFlyout.animate().alpha(1f); mFlyoutSpring.animateToFinalPosition(destinationX); Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleTouchHandler.java +1 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,7 @@ class BubbleTouchHandler implements View.OnTouchListener { trackMovement(event); if (mInDismissTarget && isStack) { mController.dismissStack(BubbleController.DISMISS_USER_GESTURE); mStack.onDragFinishAsDismiss(); } else if (isFlyout) { // TODO(b/129768381): Expand if tapped, dismiss if swiped away. if (!mStack.isExpanded() && !mMovedEnough) { Loading
packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java +1 −0 Original line number Diff line number Diff line Loading @@ -535,6 +535,7 @@ public class StackAnimationController extends Log.d(TAG, String.format("Setting position to (%f, %f).", pos.x, pos.y)); mStackPosition.set(pos.x, pos.y); mLayout.cancelAllAnimations(); cancelStackPositionAnimations(); // Since we're not using the chained animations, apply the offsets manually. Loading
packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleStackViewTest.java +1 −13 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import static org.mockito.Mockito.when; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.View; import android.widget.TextView; import androidx.test.filters.SmallTest; Loading Loading @@ -53,22 +52,11 @@ public class BubbleStackViewTest extends SysuiTestCase { } @Test public void testAnimateInFlyoutForBubble() throws InterruptedException { public void testAnimateInFlyoutForBubble() { when(mNotifEntry.getUpdateMessage(any())).thenReturn("Test Flyout Message."); mStackView.animateInFlyoutForBubble(mBubble); // Wait for the fade in. Thread.sleep(200); // Flyout should be visible and showing our text. assertEquals(1f, mStackView.findViewById(R.id.bubble_flyout).getAlpha(), .01f); assertEquals("Test Flyout Message.", ((TextView) mStackView.findViewById(R.id.bubble_flyout_text)).getText()); // Wait until it should have gone away. Thread.sleep(BubbleStackView.FLYOUT_HIDE_AFTER + 200); // Flyout should be gone. assertEquals(View.GONE, mStackView.findViewById(R.id.bubble_flyout).getVisibility()); } }