Source/sources/android/support/p003v7/widget/SwitchCompat.java
public void onDraw(Canvas canvas) {
        Layout switchText;
        int cX;
        super.onDraw(canvas);
        Rect padding = this.mTempRect;
        Drawable trackDrawable = this.mTrackDrawable;
        if (trackDrawable != null) {
            trackDrawable.getPadding(padding);
        } else {
            padding.setEmpty();
        }
        int switchTop = this.mSwitchTop;
        int switchInnerTop = switchTop + padding.top;
        int switchInnerBottom = this.mSwitchBottom - padding.bottom;
        Drawable thumbDrawable = this.mThumbDrawable;
        if (trackDrawable != null) {
            if (!this.mSplitTrack || thumbDrawable == null) {
                trackDrawable.draw(canvas);
            } else {
                Rect insets = DrawableUtils.getOpticalBounds(thumbDrawable);
                thumbDrawable.copyBounds(padding);
                padding.left += insets.left;
                padding.right -= insets.right;
                int saveCount = canvas.save();
                canvas.clipRect(padding, Op.DIFFERENCE);
                trackDrawable.draw(canvas);
                canvas.restoreToCount(saveCount);
            }
        }
        int saveCount2 = canvas.save();
        if (thumbDrawable != null) {
            thumbDrawable.draw(canvas);
        }
        if (getTargetCheckedState()) {
            switchText = this.mOnLayout;
        } else {
            switchText = this.mOffLayout;
        }
        if (switchText != null) {
            int[] drawableState = getDrawableState();
            if (this.mTextColors != null) {
                this.mTextPaint.setColor(this.mTextColors.getColorForState(drawableState, 0));
            }
            this.mTextPaint.drawableState = drawableState;
            if (thumbDrawable != null) {
                Rect bounds = thumbDrawable.getBounds();
                cX = bounds.left + bounds.right;
            } else {
                cX = getWidth();
            }
            canvas.translate((float) ((cX / 2) - (switchText.getWidth() / 2)), (float) (((switchInnerTop + switchInnerBottom) / 2) - (switchText.getHeight() / 2)));
            switchText.draw(canvas);
        }
        canvas.restoreToCount(saveCount2);
    }
/* access modifiers changed from: protected */
access modifiers changed from: protected
access modifiers changed from : protected
public void onDraw(Canvas canvas) {
        Layout switchText;
        int cX;
        super.onDraw(canvas);
        Rect padding = this.mTempRect;
        Drawable trackDrawable = this.mTrackDrawable;
        if (trackDrawable != null) {
            trackDrawable.getPadding(padding);
        } else {
            padding.setEmpty();
        }
        int switchTop = this.mSwitchTop;
        int switchInnerTop = switchTop + padding.top;
        int switchInnerBottom = this.mSwitchBottom - padding.bottom;
        Drawable thumbDrawable = this.mThumbDrawable;
        if (trackDrawable != null) {
            if (!this.mSplitTrack || thumbDrawable == null) {
                trackDrawable.draw(canvas);
            } else {
                Rect insets = DrawableUtils.getOpticalBounds(thumbDrawable);
                thumbDrawable.copyBounds(padding);
                padding.left += insets.left;
                padding.right -= insets.right;
                int saveCount = canvas.save();
                canvas.clipRect(padding, Op.DIFFERENCE);
                trackDrawable.draw(canvas);
                canvas.restoreToCount(saveCount);
            }
        }
        int saveCount2 = canvas.save();
        if (thumbDrawable != null) {
            thumbDrawable.draw(canvas);
        }
        if (getTargetCheckedState()) {
            switchText = this.mOnLayout;
        } else {
            switchText = this.mOffLayout;
        }
        if (switchText != null) {
            int[] drawableState = getDrawableState();
            if (this.mTextColors != null) {
                this.mTextPaint.setColor(this.mTextColors.getColorForState(drawableState, 0));
            }
            this.mTextPaint.drawableState = drawableState;
            if (thumbDrawable != null) {
                Rect bounds = thumbDrawable.getBounds();
                cX = bounds.left + bounds.right;
            } else {
                cX = getWidth();
            }
            canvas.translate((float) ((cX / 2) - (switchText.getWidth() / 2)), (float) (((switchInnerTop + switchInnerBottom) / 2) - (switchText.getHeight() / 2)));
            switchText.draw(canvas);
        }
        canvas.restoreToCount(saveCount2);
    }
public void onDraw ( Canvas canvas ) { Layout switchText ; int cX ; super . onDraw ( canvas ) ; Rect padding = this . mTempRect ; Drawable trackDrawable = this . mTrackDrawable ; if ( trackDrawable != null ) { trackDrawable . getPadding ( padding ) ; } else { padding . setEmpty ( ) ; } int switchTop = this . mSwitchTop ; int switchInnerTop = switchTop + padding . top ; int switchInnerBottom = this . mSwitchBottom - padding . bottom ; Drawable thumbDrawable = this . mThumbDrawable ; if ( trackDrawable != null ) { if ( ! this . mSplitTrack || thumbDrawable == null ) { trackDrawable . draw ( canvas ) ; } else { Rect insets = DrawableUtils . getOpticalBounds ( thumbDrawable ) ; thumbDrawable . copyBounds ( padding ) ; padding . left += insets . left ; padding . right -= insets . right ; int saveCount = canvas . save ( ) ; canvas . clipRect ( padding , Op . DIFFERENCE ) ; trackDrawable . draw ( canvas ) ; canvas . restoreToCount ( saveCount ) ; } } int saveCount2 = canvas . save ( ) ; if ( thumbDrawable != null ) { thumbDrawable . draw ( canvas ) ; } if ( getTargetCheckedState ( ) ) { switchText = this . mOnLayout ; } else { switchText = this . mOffLayout ; } if ( switchText != null ) { int [ ] drawableState = getDrawableState ( ) ; if ( this . mTextColors != null ) { this . mTextPaint . setColor ( this . mTextColors . getColorForState ( drawableState , 0 ) ) ; } this . mTextPaint . drawableState = drawableState ; if ( thumbDrawable != null ) { Rect bounds = thumbDrawable . getBounds ( ) ; cX = bounds . left + bounds . right ; } else { cX = getWidth ( ) ; } canvas . translate ( ( float ) ( ( cX / 2 ) - ( switchText . getWidth ( ) / 2 ) ) , ( float ) ( ( ( switchInnerTop + switchInnerBottom ) / 2 ) - ( switchText . getHeight ( ) / 2 ) ) ) ; switchText . draw ( canvas ) ; } canvas . restoreToCount ( saveCount2 ) ; }
access modifiers changed from: protected
access modifiers changed from : protected