diff options
| author | 2019-01-29 14:15:34 -0800 | |
|---|---|---|
| committer | 2019-01-29 14:15:34 -0800 | |
| commit | de2d4d21640bcaed90a98037a4262bded7f5344f (patch) | |
| tree | 9fa95571dc38ba3dfd3f587bcc31bacfb3c4b52b | |
| parent | 0b409e8cc0d37f47abfd46dad61a3ae661de29b0 (diff) | |
Improves pointer positioning & remove no-op when expanding
Fixes: 123568424
Bug: 123022982
Test: manual / visual - expand bubbles, tap through them, remove bubbles
and make sure arrow jumps to next one
Change-Id: I770c3f868f2bd6c0b4af773c707bb40d0dcffeb7
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java index b584f6781796..86a036fa61ba 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java @@ -236,14 +236,14 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F */ public void setExpandedBubble(BubbleView bubbleToExpand) { mExpandedBubble = bubbleToExpand; - boolean prevExpanded = mIsExpanded; - mIsExpanded = true; - if (!prevExpanded) { + if (!mIsExpanded) { // If we weren't previously expanded we should animate open. animateExpansion(true /* expand */); } else { - // If we were expanded just update the views + // Otherwise just update the views + // TODO: probably animate / page to expanded one updateExpandedBubble(); + updatePointerPosition(); requestUpdate(); } mExpandedBubble.getEntry().setShowInShadeWhenBubble(false); @@ -385,7 +385,6 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F mIsExpanded = shouldExpand; updateExpandedBubble(); applyCurrentState(); - //requestUpdate(); mIsAnimating = true; @@ -398,7 +397,10 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F if (shouldExpand) { mBubbleContainer.setController(mExpandedAnimationController); mExpandedAnimationController.expandFromStack( - mStackAnimationController.getStackPosition(), updateAfter); + mStackAnimationController.getStackPosition(), () -> { + updatePointerPosition(); + updateAfter.run(); + }); } else { mBubbleContainer.cancelAllAnimations(); mExpandedAnimationController.collapseBackToStack( @@ -647,10 +649,7 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F } // Bubble with notification as expanded state doesn't need a header / title mExpandedViewContainer.setHeaderText(null); - } - float pointerPosition = mExpandedBubble.getPosition().x + (mExpandedBubble.getWidth() / 2); - mExpandedViewContainer.setPointerPosition((int) pointerPosition); } private void applyCurrentState() { @@ -677,6 +676,14 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F } } + private void updatePointerPosition() { + if (mExpandedBubble != null) { + float pointerPosition = mExpandedBubble.getPosition().x + + (mExpandedBubble.getWidth() / 2f); + mExpandedViewContainer.setPointerPosition((int) pointerPosition); + } + } + private void applyRowState(ExpandableNotificationRow view) { view.reset(); view.setHeadsUp(false); |