OSDN Git Service

Remove QS Gutter
authorJason Monk <jmonk@google.com>
Fri, 2 Jun 2017 16:50:24 +0000 (12:50 -0400)
committerJason Monk <jmonk@google.com>
Mon, 5 Jun 2017 13:16:52 +0000 (09:16 -0400)
Test: manual
Change-Id: I10be3dfc9b9745f25b8fec3ef1f5d812441890ad
Fixes: 62234983

packages/SystemUI/res/layout/qs_customize_panel.xml
packages/SystemUI/res/layout/qs_detail.xml
packages/SystemUI/res/layout/qs_footer.xml
packages/SystemUI/res/layout/qs_panel.xml
packages/SystemUI/res/layout/quick_status_bar_expanded_header.xml
packages/SystemUI/res/values/dimens.xml
packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java
packages/SystemUI/src/com/android/systemui/qs/QSFragment.java

index cbc2575..9ab8ac6 100644 (file)
@@ -21,7 +21,6 @@
     android:layout_width="match_parent"
     android:layout_height="0dp"
     android:orientation="vertical"
-    android:elevation="4dp"
     android:background="@drawable/qs_customizer_background"
     android:gravity="center_horizontal">
 
index 34e43ce..63f80ae 100644 (file)
@@ -20,7 +20,6 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@drawable/qs_detail_background"
-    android:elevation="4dp"
     android:clickable="true"
     android:orientation="vertical"
     android:paddingBottom="8dp"
index 871d1f3..db39905 100644 (file)
     android:id="@+id/header"
     android:layout_width="match_parent"
     android:layout_height="48dp"
-    android:elevation="4dp"
     android:baselineAligned="false"
     android:clickable="false"
     android:clipChildren="false"
     android:clipToPadding="false"
     android:paddingTop="0dp"
-    android:background="#00000000"
     android:gravity="center_vertical"
     android:orientation="horizontal">
 
             android:padding="14dp" />
     </LinearLayout>
 
-    <include layout="@layout/qs_divider"
-        android:layout_width="match_parent"
-        android:layout_height="1dp"
-        android:layout_gravity="bottom" />
-
 </com.android.systemui.qs.QSFooter>
index 62a1756..87101e4 100644 (file)
     android:id="@+id/quick_settings_container"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:background="@drawable/qs_background_primary"
+    android:elevation="4dp"
     android:clipToPadding="false"
     android:clipChildren="false">
 
-    <View
-        android:id="@+id/qs_background"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="@drawable/qs_background_primary"
-        android:alpha="0.8"
-        android:elevation="4dp" />
-
     <com.android.systemui.qs.QSPanel
         android:id="@+id/quick_settings_panel"
         android:layout_marginTop="28dp"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:elevation="4dp"
-        android:background="#00000000"
         android:layout_marginBottom="48dp" />
 
     <include layout="@layout/quick_status_bar_expanded_header" />
index 97376c3..885e3f3 100644 (file)
@@ -24,8 +24,6 @@
     android:layout_height="@dimen/status_bar_header_height"
     android:layout_gravity="@integer/notification_panel_layout_gravity"
     android:baselineAligned="false"
-    android:background="#00000000"
-    android:elevation="4dp"
     android:clickable="false"
     android:clipChildren="false"
     android:clipToPadding="false"
index d71bfca..fe422db 100644 (file)
     <dimen name="rounded_corner_radius">0dp</dimen>
     <dimen name="rounded_corner_content_padding">0dp</dimen>
 
-    <dimen name="qs_gutter_height">6dp</dimen>
-
     <!-- Intended corner radius when drawing the mobile signal -->
     <dimen name="stat_sys_mobile_signal_corner_radius">0.75dp</dimen>
 
index 0d74b7a..ed57c04 100644 (file)
@@ -39,8 +39,6 @@ public class QSContainerImpl extends FrameLayout {
     protected float mQsExpansion;
     private QSCustomizer mQSCustomizer;
     private QSFooter mQSFooter;
-    private int mGutterHeight;
-    private View mBackground;
     private float mFullElevation;
 
     public QSContainerImpl(Context context, AttributeSet attrs) {
@@ -55,8 +53,6 @@ public class QSContainerImpl extends FrameLayout {
         mHeader = findViewById(R.id.header);
         mQSCustomizer = findViewById(R.id.qs_customize);
         mQSFooter = findViewById(R.id.qs_footer);
-        mBackground = findViewById(R.id.qs_background);
-        mGutterHeight = getContext().getResources().getDimensionPixelSize(R.dimen.qs_gutter_height);
         mFullElevation = mQSPanel.getElevation();
 
         setClickable(true);
@@ -110,18 +106,10 @@ public class QSContainerImpl extends FrameLayout {
 
     public void updateExpansion() {
         int height = calculateContainerHeight();
-        int gutterHeight = Math.round(mQsExpansion * mGutterHeight);
-        setBottom(getTop() + height + gutterHeight);
+        setBottom(getTop() + height);
         mQSDetail.setBottom(getTop() + height);
-        mBackground.setBottom(getTop() + height);
         // Pin QS Footer to the bottom of the panel.
         mQSFooter.setTranslationY(height - mQSFooter.getHeight());
-
-        float elevation = mQsExpansion * mFullElevation;
-        mQSDetail.setElevation(elevation);
-        mBackground.setElevation(elevation);
-        mQSFooter.setElevation(elevation);
-        mQSPanel.setElevation(elevation);
     }
 
     protected int calculateContainerHeight() {
@@ -135,17 +123,4 @@ public class QSContainerImpl extends FrameLayout {
         mQsExpansion = expansion;
         updateExpansion();
     }
-
-    public void setGutterEnabled(boolean gutterEnabled) {
-        if (gutterEnabled == (mGutterHeight != 0)) {
-            return;
-        }
-        if (gutterEnabled) {
-            mGutterHeight = getContext().getResources().getDimensionPixelSize(
-                    R.dimen.qs_gutter_height);
-        } else {
-            mGutterHeight = 0;
-        }
-        updateExpansion();
-    }
 }
index c9c3a7f..3f00276 100644 (file)
@@ -63,7 +63,6 @@ public class QSFragment extends Fragment implements QS {
     private QSContainerImpl mContainer;
     private int mLayoutDirection;
     private QSFooter mFooter;
-    private int mGutterHeight;
 
     @Override
     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@@ -80,7 +79,6 @@ public class QSFragment extends Fragment implements QS {
         mHeader = view.findViewById(R.id.header);
         mFooter = view.findViewById(R.id.qs_footer);
         mContainer = view.findViewById(id.quick_settings_container);
-        mGutterHeight = getContext().getResources().getDimensionPixelSize(R.dimen.qs_gutter_height);
 
         mQSDetail.setQsPanel(mQSPanel, mHeader);
 
@@ -131,7 +129,6 @@ public class QSFragment extends Fragment implements QS {
 
     @Override
     public void setHasNotifications(boolean hasNotifications) {
-        mContainer.setGutterEnabled(hasNotifications);
     }
 
     public void setPanelView(HeightListener panelView) {
@@ -250,7 +247,7 @@ public class QSFragment extends Fragment implements QS {
         mContainer.setExpansion(expansion);
         final float translationScaleY = expansion - 1;
         if (!mHeaderAnimating) {
-            int height = mHeader.getHeight() + mGutterHeight;
+            int height = mHeader.getHeight();
             getView().setTranslationY(mKeyguardShowing ? (translationScaleY * height)
                     : headerTranslation);
         }
@@ -333,15 +330,15 @@ public class QSFragment extends Fragment implements QS {
             LayoutParams layoutParams = (LayoutParams) mQSPanel.getLayoutParams();
             int panelHeight = layoutParams.topMargin + layoutParams.bottomMargin +
                     + mQSPanel.getMeasuredHeight();
-            return panelHeight + getView().getPaddingBottom() + mGutterHeight;
+            return panelHeight + getView().getPaddingBottom();
         } else {
-            return getView().getMeasuredHeight() + mGutterHeight;
+            return getView().getMeasuredHeight();
         }
     }
 
     @Override
     public void setHeightOverride(int desiredHeight) {
-        mContainer.setHeightOverride(desiredHeight - mGutterHeight);
+        mContainer.setHeightOverride(desiredHeight);
     }
 
     public int getQsMinExpansionHeight() {