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

Commit 88724657 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio Committed by Android (Google) Code Review
Browse files

Merge "Fix bug #7148393 Switch can crash when hierarchyviewer is connected" into jb-mr1-dev

parents b9674640 be06e329
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -750,10 +750,11 @@ public class Switch extends CompoundButton {
        mTextPaint.drawableState = getDrawableState();

        Layout switchText = getTargetCheckedState() ? mOnLayout : mOffLayout;

        if (switchText != null) {
            canvas.translate((thumbLeft + thumbRight) / 2 - switchText.getWidth() / 2,
                    (switchInnerTop + switchInnerBottom) / 2 - switchText.getHeight() / 2);
            switchText.draw(canvas);
        }

        canvas.restore();
    }