diff options
author | Romain Guy <> | 2009-03-27 15:30:50 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-27 15:30:50 -0700 |
commit | c4a5f87c7ad6d8bca3929e1a3c0d280951f7a12e (patch) | |
tree | 3bca80df5c641d7b3fb3f72eb3fc00c8e091fbe2 /core | |
parent | a565e5e3d084c4e5a21a094b1409e3b23f9dce48 (diff) | |
download | frameworks_base-c4a5f87c7ad6d8bca3929e1a3c0d280951f7a12e.zip frameworks_base-c4a5f87c7ad6d8bca3929e1a3c0d280951f7a12e.tar.gz frameworks_base-c4a5f87c7ad6d8bca3929e1a3c0d280951f7a12e.tar.bz2 |
AI 143240: am: CL 142790 am: CL 142788 Fixes #1730741. Marquee text was not always animated in context menus.
The reason for that bug was that the marquee could potentially be stopped/started as part of the layout workflow. Unfortunately TextView was relying on setFrame() being called after onMeasure() which is *not* always the case, especially when the widget is inside of a ListView. This change simply checks for the marquee restart flag in on the onDraw() method in case we skipped the setFrame() step.
Original author: romainguy
Merged from: //branches/cupcake/...
Original author: android-build
Merged from: //branches/donutburger/...
Automated import of CL 143240
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/ViewGroup.java | 8 | ||||
-rw-r--r-- | core/java/android/widget/ListView.java | 1 | ||||
-rw-r--r-- | core/java/android/widget/TextView.java | 10 |
3 files changed, 13 insertions, 6 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 39aecfd..4f506ff 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -1407,6 +1407,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } + // Clear the flag as early as possible to allow draw() implementations + // to call invalidate() successfully when doing animations + child.mPrivateFlags |= DRAWN; + if (!concatMatrix && canvas.quickReject(cl, ct, cr, cb, Canvas.EdgeType.BW) && (child.mPrivateFlags & DRAW_ANIMATION) == 0) { return more; @@ -1476,10 +1480,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } } - // Clear the flag as early as possible to allow draw() implementations - // to call invalidate() successfully when doing animations - child.mPrivateFlags |= DRAWN; - if (hasNoCache) { // Fast path for layouts with no backgrounds if ((child.mPrivateFlags & SKIP_DRAW) == SKIP_DRAW) { diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index 7e30f7b..c84be0f 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -1060,6 +1060,7 @@ public class ListView extends AbsListView { * UNSPECIFIED/AT_MOST modes, false otherwise. * @hide */ + @ViewDebug.ExportedProperty protected boolean recycleOnMeasure() { return true; } diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 81516b9..9c810e1 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -3359,12 +3359,16 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mPopup.update(this, getErrorX(), getErrorY(), -1, -1); } + restartMarqueeIfNeeded(); + + return result; + } + + private void restartMarqueeIfNeeded() { if (mRestartMarquee && mEllipsize == TextUtils.TruncateAt.MARQUEE) { mRestartMarquee = false; startMarquee(); } - - return result; } /** @@ -3674,6 +3678,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener @Override protected void onDraw(Canvas canvas) { + restartMarqueeIfNeeded(); + // Draw the background for this view super.onDraw(canvas); |