Tablet Settings Layout is no longer stretched am: c4a9b18121 am: a936610ae2

am: fa7aa9663e

Change-Id: I7865b06593fc99cabe78dac7bb4a3574dea79404
This commit is contained in:
Matthew Fritze
2016-09-29 05:59:08 +00:00
committed by android-build-merger
7 changed files with 22 additions and 5 deletions

View File

@@ -83,19 +83,21 @@ public final class SlidingTabLayout extends FrameLayout implements View.OnClickL
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
if (mTitleView.getChildCount() > 0) {
mTitleView.layout(0, 0, mTitleView.getMeasuredWidth(), mTitleView.getMeasuredHeight());
final int indicatorBottom = getMeasuredHeight();
final int indicatorHeight = mIndicatorView.getMeasuredHeight();
final int indicatorWidth = mIndicatorView.getMeasuredWidth();
final int totalWidth = getMeasuredWidth();
final int leftPadding = getPaddingLeft();
final int rightPadding = getPaddingRight();
mTitleView.layout(leftPadding, 0, mTitleView.getMeasuredWidth() + rightPadding,
mTitleView.getMeasuredHeight());
// IndicatorView should start on the right when RTL mode is enabled
if (isRtlMode()) {
mIndicatorView.layout(totalWidth - indicatorWidth,
indicatorBottom - indicatorHeight, totalWidth,
indicatorBottom);
} else {
mIndicatorView.layout(0, indicatorBottom - indicatorHeight,
indicatorWidth, indicatorBottom);
}