OSDN Git Service

Tablet Settings Layout is no longer stretched am: c4a9b18121
authorMatthew Fritze <mfritze@google.com>
Thu, 29 Sep 2016 00:36:04 +0000 (00:36 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Thu, 29 Sep 2016 00:36:04 +0000 (00:36 +0000)
am: a936610ae2

Change-Id: Ib6d604f753d3424d67396c9e051829cad43d6d76

res/layout/dashboard_container_header.xml
res/layout/settings_main_dashboard.xml
res/layout/support_tile_spacer.xml
res/values-sw720dp-land/dimens.xml
res/values-sw720dp/dimens.xml
res/values/dimens.xml
src/com/android/settings/widget/SlidingTabLayout.java

index a12f249..59e7eb1 100644 (file)
@@ -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"/>
index c10193c..1b7506e 100644 (file)
@@ -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"
              />
index 95aea0b..41cc221 100644 (file)
@@ -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"
index 56d8318..d924344 100644 (file)
     <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>
index 981c936..0a2a1ce 100644 (file)
     <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>
index 2a2b406..74441c2 100755 (executable)
     <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>
index 6e2d8c6..7099646 100644 (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);
             }