diff options
| author | 2018-01-16 23:48:52 +0000 | |
|---|---|---|
| committer | 2018-01-16 23:48:52 +0000 | |
| commit | 87b4ceeca74886c7b185048c32fc74ffe30a93dd (patch) | |
| tree | f257a883618535e2e386aa40c248efe255716022 | |
| parent | e2861da8ef0eba65c1bb9d5f67380884e2ead939 (diff) | |
| parent | 8a514cb414b5ed9457b5b417f19b990153285520 (diff) | |
Merge "Make QS rounding match notifications"
3 files changed, 28 insertions, 0 deletions
diff --git a/packages/SystemUI/res/drawable/qs_background_primary.xml b/packages/SystemUI/res/drawable/qs_background_primary.xml index 03bba53946da..dd74cadd0955 100644 --- a/packages/SystemUI/res/drawable/qs_background_primary.xml +++ b/packages/SystemUI/res/drawable/qs_background_primary.xml @@ -16,5 +16,6 @@ <inset xmlns:android="http://schemas.android.com/apk/res/android"> <shape> <solid android:color="@color/qs_background_dark"/> + <corners android:radius="?android:attr/dialogCornerRadius" /> </shape> </inset> diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml index bef0830d5802..c5e5ee1f4af0 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded.xml @@ -43,6 +43,8 @@ android:layout_width="@dimen/qs_panel_width" android:layout_height="match_parent" android:layout_gravity="@integer/notification_panel_layout_gravity" + android:layout_marginStart="@dimen/notification_side_paddings" + android:layout_marginEnd="@dimen/notification_side_paddings" android:clipToPadding="false" android:clipChildren="false" systemui:viewType="com.android.systemui.plugins.qs.QS" /> diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java index 33b5268e03e1..7f0acc254a7c 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java @@ -17,13 +17,18 @@ package com.android.systemui.qs; import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Path; import android.graphics.Point; import android.util.AttributeSet; +import android.util.Log; 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; +import com.android.systemui.statusbar.ExpandableOutlineView; /** * Wrapper view with background which contains {@link QSPanel} and {@link BaseStatusBarHeader} @@ -31,6 +36,7 @@ import com.android.systemui.qs.customize.QSCustomizer; public class QSContainerImpl extends FrameLayout { private final Point mSizePoint = new Point(); + private final Path mClipPath = new Path(); private int mHeightOverride = -1; protected View mQSPanel; @@ -40,6 +46,7 @@ public class QSContainerImpl extends FrameLayout { private QSCustomizer mQSCustomizer; private View mQSFooter; private float mFullElevation; + private float mRadius; public QSContainerImpl(Context context, AttributeSet attrs) { super(context, attrs); @@ -54,6 +61,8 @@ public class QSContainerImpl extends FrameLayout { mQSCustomizer = findViewById(R.id.qs_customize); mQSFooter = findViewById(R.id.qs_footer); mFullElevation = mQSPanel.getElevation(); + mRadius = getResources().getDimensionPixelSize( + Utils.getThemeAttr(mContext, android.R.attr.dialogCornerRadius)); setClickable(true); setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); @@ -93,6 +102,18 @@ public class QSContainerImpl extends FrameLayout { updateExpansion(); } + @Override + protected boolean drawChild(Canvas canvas, View child, long drawingTime) { + boolean ret; + canvas.save(); + if (child != mQSCustomizer) { + canvas.clipPath(mClipPath); + } + ret = super.drawChild(canvas, child, drawingTime); + canvas.restore(); + return ret; + } + /** * Overrides the height of this view (post-layout), so that the content is clipped to that * height and the background is set to that height. @@ -110,6 +131,10 @@ public class QSContainerImpl extends FrameLayout { mQSDetail.setBottom(getTop() + height); // Pin QS Footer to the bottom of the panel. mQSFooter.setTranslationY(height - mQSFooter.getHeight()); + + ExpandableOutlineView.getRoundedRectPath(0, 0, getWidth(), height, mRadius, + mRadius, + mClipPath); } protected int calculateContainerHeight() { |