am 88724657: Merge "Fix bug #7148393 Switch can crash when hierarchyviewer is connected" into jb-mr1-dev
* commit '8872465709d336083a908cb79d08661c6658265b': Fix bug #7148393 Switch can crash when hierarchyviewer is connected
This commit is contained in:
@@ -750,10 +750,11 @@ public class Switch extends CompoundButton {
|
||||
mTextPaint.drawableState = getDrawableState();
|
||||
|
||||
Layout switchText = getTargetCheckedState() ? mOnLayout : mOffLayout;
|
||||
|
||||
canvas.translate((thumbLeft + thumbRight) / 2 - switchText.getWidth() / 2,
|
||||
(switchInnerTop + switchInnerBottom) / 2 - switchText.getHeight() / 2);
|
||||
switchText.draw(canvas);
|
||||
if (switchText != null) {
|
||||
canvas.translate((thumbLeft + thumbRight) / 2 - switchText.getWidth() / 2,
|
||||
(switchInnerTop + switchInnerBottom) / 2 - switchText.getHeight() / 2);
|
||||
switchText.draw(canvas);
|
||||
}
|
||||
|
||||
canvas.restore();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user