Merge "If we're not showing switch text, don't include in measure."

This commit is contained in:
John Spurlock
2014-06-20 17:02:12 +00:00
committed by Android (Google) Code Review

View File

@@ -570,8 +570,8 @@ public class Switch extends CompoundButton {
mTrackDrawable.getPadding(mTempRect);
final int maxTextWidth = Math.max(mOnLayout.getWidth(), mOffLayout.getWidth())
+ mThumbTextPadding * 2;
final int maxTextWidth = mShowText ? Math.max(mOnLayout.getWidth(), mOffLayout.getWidth())
+ mThumbTextPadding * 2 : 0;
mThumbWidth = Math.max(maxTextWidth, mThumbDrawable.getIntrinsicWidth());
final int switchWidth = Math.max(mSwitchMinWidth,