Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bcde500 authored by Chris Craik's avatar Chris Craik
Browse files

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
parent c37db9c0
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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());
    }

    /**