From 7bcde5009d4478d6f1af22687e2fa43be400fcfa Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Fri, 11 Oct 2013 12:51:11 -0700 Subject: [PATCH] Workaround fading edge incompatibility with alpha modulation bug:11121809 Fading edges, such as drawn by a scrolling marquee TextView, don't behave correctly when their view is modulated, as done by the view system when alpha is set on a view that returns false from hasOverlappingRendering. To work around this, always return true from hasOverlappingRendering if a TextView has horizontal fading edges enabled. Change-Id: I64c9b8c653aa1d9ca320292306fd24333e3ee225 --- core/java/android/widget/TextView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 61e071b8673b0..cb930d6fbcb25 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -4870,8 +4870,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener @Override public boolean hasOverlappingRendering() { + // horizontal fading edge causes SaveLayerAlpha, which doesn't support alpha modulation return ((getBackground() != null && getBackground().getCurrent() != null) - || mText instanceof Spannable || hasSelection()); + || mText instanceof Spannable || hasSelection() + || isHorizontalFadingEdgeEnabled()); } /**