diff options
Diffstat (limited to 'java/com/android/bubble/Bubble.java')
-rw-r--r-- | java/com/android/bubble/Bubble.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/java/com/android/bubble/Bubble.java b/java/com/android/bubble/Bubble.java index d83e284b9..9abfa432f 100644 --- a/java/com/android/bubble/Bubble.java +++ b/java/com/android/bubble/Bubble.java @@ -99,6 +99,7 @@ public class Bubble { private boolean expanded; private boolean textShowing; private boolean hideAfterText; + private CharSequence textAfterShow; private int collapseEndAction; @VisibleForTesting ViewHolder viewHolder; @@ -304,7 +305,15 @@ public class Bubble { .setInterpolator(new OvershootInterpolator()) .scaleX(1) .scaleY(1) - .withEndAction(() -> visibility = Visibility.SHOWING) + .withEndAction( + () -> { + visibility = Visibility.SHOWING; + // Show the queued up text, if available. + if (textAfterShow != null) { + showText(textAfterShow); + textAfterShow = null; + } + }) .start(); updatePrimaryIconAnimation(); @@ -380,6 +389,12 @@ public class Bubble { transition.addTarget(startValues.view); transition.captureStartValues(startValues); + // If our view is not laid out yet, postpone showing the text. + if (startValues.values.isEmpty()) { + textAfterShow = text; + return; + } + doResize( () -> { doShowText(text); |