Merge "Tablet Settings Layout is no longer stretched" into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6cafff3b2c
@@ -20,4 +20,6 @@
|
||||
android:id="@+id/sliding_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dashboard_header_margin_left"
|
||||
android:layout_marginRight="@dimen/dashboard_header_margin_right"
|
||||
android:background="?android:attr/colorPrimary"/>
|
||||
|
@@ -21,4 +21,5 @@
|
||||
android:id="@+id/main_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/material_grey_300"
|
||||
/>
|
||||
|
@@ -15,7 +15,7 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<Space
|
||||
<View
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/support_spacer_height"
|
||||
|
@@ -18,8 +18,12 @@
|
||||
<dimen name="settings_side_margin">112dp</dimen>
|
||||
|
||||
<!-- Dashboard padding in its container -->
|
||||
<dimen name="dashboard_padding_start">128dp</dimen>
|
||||
<dimen name="dashboard_padding_end">128dp</dimen>
|
||||
<dimen name="dashboard_padding_start">160dp</dimen>
|
||||
<dimen name="dashboard_padding_end">160dp</dimen>
|
||||
|
||||
<!-- Dashboard Header margin in its container -->
|
||||
<dimen name="dashboard_header_margin_right">304dp</dimen>
|
||||
<dimen name="dashboard_header_margin_left">304dp</dimen>
|
||||
|
||||
<!-- ActionBar contentInsetStart -->
|
||||
<dimen name="actionbar_contentInsetStart">128dp</dimen>
|
||||
|
@@ -42,6 +42,10 @@
|
||||
<dimen name="dashboard_padding_start">80dp</dimen>
|
||||
<dimen name="dashboard_padding_end">80dp</dimen>
|
||||
|
||||
<!-- Dashboard Header margin in its container -->
|
||||
<dimen name="dashboard_header_margin_right">176dp</dimen>
|
||||
<dimen name="dashboard_header_margin_left">176dp</dimen>
|
||||
|
||||
<!-- Dashboard category padding start / end -->
|
||||
<dimen name="dashboard_category_padding_start">24dp</dimen>
|
||||
<dimen name="dashboard_category_padding_end">24dp</dimen>
|
||||
|
@@ -96,6 +96,10 @@
|
||||
<dimen name="dashboard_padding_top">0dp</dimen>
|
||||
<dimen name="dashboard_padding_bottom">0dp</dimen>
|
||||
|
||||
<!-- Dashboard Header margin in its container -->
|
||||
<dimen name="dashboard_header_margin_right">0dp</dimen>
|
||||
<dimen name="dashboard_header_margin_left">0dp</dimen>
|
||||
|
||||
<!-- Dashboard category padding start / end -->
|
||||
<dimen name="dashboard_category_padding_start">0dp</dimen>
|
||||
<dimen name="dashboard_category_padding_end">0dp</dimen>
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user