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

Commit 9e2a8303 authored by d34d's avatar d34d Committed by Clark Scheff
Browse files

SysUI: Check that backgrounds are RippleDrawables

Since a theme can overlay a drawable with any type of drawable
we need to check that the backgrounds being referenced in
StatusBarHeaderView are actually RippleDrawables before calling
setForceSoftware()

Change-Id: I562d305bb88f8e8c2f8af343607f6a499607ca7e
TICKET: CYNGNOS-1662
parent 7bda589d
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -231,9 +231,18 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL

        // RenderThread is doing more harm than good when touching the header (to expand quick
        // settings), so disable it for this view
        ((RippleDrawable) getBackground()).setForceSoftware(true);
        ((RippleDrawable) mSettingsButton.getBackground()).setForceSoftware(true);
        ((RippleDrawable) mSystemIconsSuperContainer.getBackground()).setForceSoftware(true);
        Drawable d = getBackground();
        if (d instanceof RippleDrawable) {
            ((RippleDrawable) d).setForceSoftware(true);
        }
        d = mSettingsButton.getBackground();
        if (d instanceof RippleDrawable) {
            ((RippleDrawable) d).setForceSoftware(true);
        }
        d = mSystemIconsSuperContainer.getBackground();
        if (d instanceof RippleDrawable) {
            ((RippleDrawable) d).setForceSoftware(true);
        }
    }

    @Override