Loading core/java/android/widget/TabWidget.java +24 −8 Original line number Diff line number Diff line Loading @@ -61,7 +61,10 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { // This value will be set to 0 as soon as the first tab is added to TabHost. private int mSelectedTab = -1; @Nullable private Drawable mLeftStrip; @Nullable private Drawable mRightStrip; private boolean mDrawBottomStrips = true; Loading Loading @@ -374,24 +377,37 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { final Drawable leftStrip = mLeftStrip; final Drawable rightStrip = mRightStrip; if (leftStrip != null) { leftStrip.setState(selectedChild.getDrawableState()); } if (rightStrip != null) { rightStrip.setState(selectedChild.getDrawableState()); } if (mStripMoved) { final Rect bounds = mBounds; bounds.left = selectedChild.getLeft(); bounds.right = selectedChild.getRight(); final int myHeight = getHeight(); if (leftStrip != null) { leftStrip.setBounds(Math.min(0, bounds.left - leftStrip.getIntrinsicWidth()), myHeight - leftStrip.getIntrinsicHeight(), bounds.left, myHeight); } if (rightStrip != null) { rightStrip.setBounds(bounds.right, myHeight - rightStrip.getIntrinsicHeight(), Math.max(getWidth(), bounds.right + rightStrip.getIntrinsicWidth()), myHeight); Math.max(getWidth(), bounds.right + rightStrip.getIntrinsicWidth()), myHeight); } mStripMoved = false; } if (leftStrip != null) { leftStrip.draw(canvas); } if (rightStrip != null) { rightStrip.draw(canvas); } } /** * Sets the current tab. Loading Loading
core/java/android/widget/TabWidget.java +24 −8 Original line number Diff line number Diff line Loading @@ -61,7 +61,10 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { // This value will be set to 0 as soon as the first tab is added to TabHost. private int mSelectedTab = -1; @Nullable private Drawable mLeftStrip; @Nullable private Drawable mRightStrip; private boolean mDrawBottomStrips = true; Loading Loading @@ -374,24 +377,37 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { final Drawable leftStrip = mLeftStrip; final Drawable rightStrip = mRightStrip; if (leftStrip != null) { leftStrip.setState(selectedChild.getDrawableState()); } if (rightStrip != null) { rightStrip.setState(selectedChild.getDrawableState()); } if (mStripMoved) { final Rect bounds = mBounds; bounds.left = selectedChild.getLeft(); bounds.right = selectedChild.getRight(); final int myHeight = getHeight(); if (leftStrip != null) { leftStrip.setBounds(Math.min(0, bounds.left - leftStrip.getIntrinsicWidth()), myHeight - leftStrip.getIntrinsicHeight(), bounds.left, myHeight); } if (rightStrip != null) { rightStrip.setBounds(bounds.right, myHeight - rightStrip.getIntrinsicHeight(), Math.max(getWidth(), bounds.right + rightStrip.getIntrinsicWidth()), myHeight); Math.max(getWidth(), bounds.right + rightStrip.getIntrinsicWidth()), myHeight); } mStripMoved = false; } if (leftStrip != null) { leftStrip.draw(canvas); } if (rightStrip != null) { rightStrip.draw(canvas); } } /** * Sets the current tab. Loading