diff options
10 files changed, 46 insertions, 23 deletions
diff --git a/packages/SystemUI/res/drawable/qs_background_primary.xml b/packages/SystemUI/res/drawable/qs_background_primary.xml index 0bdbc5f17be6..8ea9e0639108 100644 --- a/packages/SystemUI/res/drawable/qs_background_primary.xml +++ b/packages/SystemUI/res/drawable/qs_background_primary.xml @@ -15,6 +15,6 @@ --> <inset xmlns:android="http://schemas.android.com/apk/res/android"> <shape> - <solid android:color="?android:attr/colorPrimaryDark"/> + <solid android:color="?android:attr/colorPrimary"/> </shape> </inset> diff --git a/packages/SystemUI/res/layout/qs_customize_panel.xml b/packages/SystemUI/res/layout/qs_customize_panel.xml index 9ab8ac6346d3..cbc2575bd6f8 100644 --- a/packages/SystemUI/res/layout/qs_customize_panel.xml +++ b/packages/SystemUI/res/layout/qs_customize_panel.xml @@ -21,6 +21,7 @@ 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"> diff --git a/packages/SystemUI/res/layout/qs_detail.xml b/packages/SystemUI/res/layout/qs_detail.xml index 1c087b374a2b..f41c4944fff8 100644 --- a/packages/SystemUI/res/layout/qs_detail.xml +++ b/packages/SystemUI/res/layout/qs_detail.xml @@ -20,6 +20,7 @@ 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" diff --git a/packages/SystemUI/res/layout/qs_footer.xml b/packages/SystemUI/res/layout/qs_footer.xml index 047f7aa704e4..c92c811950c7 100644 --- a/packages/SystemUI/res/layout/qs_footer.xml +++ b/packages/SystemUI/res/layout/qs_footer.xml @@ -21,6 +21,7 @@ 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" diff --git a/packages/SystemUI/res/layout/qs_panel.xml b/packages/SystemUI/res/layout/qs_panel.xml index 365831343c56..fb47bbc370e1 100644 --- a/packages/SystemUI/res/layout/qs_panel.xml +++ b/packages/SystemUI/res/layout/qs_panel.xml @@ -14,22 +14,28 @@ limitations under the License. --> <com.android.systemui.qs.QSContainerImpl - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/quick_settings_container" + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/quick_settings_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?android:attr/colorPrimaryDark" + android:clipToPadding="false" + android:clipChildren="false"> + + <View + android:id="@+id/qs_background" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:background="@drawable/qs_background_primary" - android:clipToPadding="false" - android:clipChildren="false" - android:elevation="4dp"> + android:elevation="4dp" /> <com.android.systemui.qs.QSPanel - android:id="@+id/quick_settings_panel" - android:background="#0000" - android:layout_marginTop="28dp" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="48dp" /> + android:id="@+id/quick_settings_panel" + android:layout_marginTop="28dp" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:elevation="4dp" + android:layout_marginBottom="48dp" /> <include layout="@layout/quick_status_bar_expanded_header" /> diff --git a/packages/SystemUI/res/layout/quick_status_bar_expanded_header.xml b/packages/SystemUI/res/layout/quick_status_bar_expanded_header.xml index 520dab4983ac..65344b703035 100644 --- a/packages/SystemUI/res/layout/quick_status_bar_expanded_header.xml +++ b/packages/SystemUI/res/layout/quick_status_bar_expanded_header.xml @@ -24,6 +24,7 @@ android:layout_height="@dimen/status_bar_header_height" android:layout_gravity="@integer/notification_panel_layout_gravity" android:baselineAligned="false" + android:elevation="4dp" android:clickable="false" android:clipChildren="false" android:clipToPadding="false" diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 63abee7a4f44..c00b562e0936 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -775,4 +775,6 @@ <dimen name="signal_icon_size">17dp</dimen> + <dimen name="qs_gutter_height">6dp</dimen> + </resources> diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java index 06264ba4b980..189c04c1ac4e 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java @@ -17,11 +17,14 @@ package com.android.systemui.qs; import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; import android.graphics.Point; import android.util.AttributeSet; import android.view.View; import android.widget.FrameLayout; +import com.android.settingslib.Utils; import com.android.systemui.R; import com.android.systemui.qs.customize.QSCustomizer; @@ -39,6 +42,8 @@ public class QSContainerImpl extends FrameLayout { protected float mQsExpansion; private QSCustomizer mQSCustomizer; private QSFooter mQSFooter; + private int mGutterHeight; + private View mBackground; public QSContainerImpl(Context context, AttributeSet attrs) { super(context, attrs); @@ -52,6 +57,8 @@ 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); } @Override @@ -94,8 +101,9 @@ public class QSContainerImpl extends FrameLayout { public void updateBottom() { int height = calculateContainerHeight(); - setBottom(getTop() + height); + setBottom(getTop() + height + mGutterHeight); mQSDetail.setBottom(getTop() + height); + mBackground.setBottom(mQSDetail.getBottom()); // Pin QS Footer to the bottom of the panel. mQSFooter.setTranslationY(height - mQSFooter.getHeight()); } diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java index 406f107f9872..5cf049abe135 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java @@ -32,6 +32,7 @@ import android.widget.FrameLayout.LayoutParams; import com.android.systemui.Interpolators; import com.android.systemui.R; +import com.android.systemui.R.id; import com.android.systemui.plugins.qs.QS; import com.android.systemui.qs.customize.QSCustomizer; import com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer; @@ -61,6 +62,7 @@ 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, @@ -75,7 +77,8 @@ public class QSFragment extends Fragment implements QS { mQSDetail = view.findViewById(R.id.qs_detail); mHeader = view.findViewById(R.id.header); mFooter = view.findViewById(R.id.qs_footer); - mContainer = (QSContainerImpl) view; + mContainer = view.findViewById(id.quick_settings_container); + mGutterHeight = getContext().getResources().getDimensionPixelSize(R.dimen.qs_gutter_height); mQSDetail.setQsPanel(mQSPanel, mHeader); @@ -239,7 +242,8 @@ public class QSFragment extends Fragment implements QS { mContainer.setExpansion(expansion); final float translationScaleY = expansion - 1; if (!mHeaderAnimating) { - getView().setTranslationY(mKeyguardShowing ? (translationScaleY * mHeader.getHeight()) + int height = mHeader.getHeight() + mGutterHeight; + getView().setTranslationY(mKeyguardShowing ? (translationScaleY * height) : headerTranslation); } mHeader.setExpansion(mKeyguardShowing ? 1 : expansion); @@ -321,19 +325,19 @@ public class QSFragment extends Fragment implements QS { LayoutParams layoutParams = (LayoutParams) mQSPanel.getLayoutParams(); int panelHeight = layoutParams.topMargin + layoutParams.bottomMargin + + mQSPanel.getMeasuredHeight(); - return panelHeight + getView().getPaddingBottom(); + return panelHeight + getView().getPaddingBottom() + mGutterHeight; } else { - return getView().getMeasuredHeight(); + return getView().getMeasuredHeight() + mGutterHeight; } } @Override public void setHeightOverride(int desiredHeight) { - mContainer.setHeightOverride(desiredHeight); + mContainer.setHeightOverride(desiredHeight - mGutterHeight); } public int getQsMinExpansionHeight() { - return mHeader.getHeight(); + return mHeader.getHeight() + mGutterHeight; } @Override diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java index 32af2305062e..d12b16b77ae5 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java @@ -340,10 +340,9 @@ public abstract class QSTileImpl<TState extends State> implements QSTile { switch (state) { case Tile.STATE_UNAVAILABLE: return Utils.getDisabled(context, - Utils.getColorAttr(context, android.R.attr.textColorPrimary)); - case Tile.STATE_INACTIVE: - return Utils.getDisabled(context, Utils.getColorAttr(context, android.R.attr.colorForeground)); + case Tile.STATE_INACTIVE: + return Utils.getColorAttr(context, android.R.attr.textColorHint); case Tile.STATE_ACTIVE: return Utils.getColorAttr(context, android.R.attr.textColorPrimary); default: |