diff options
6 files changed, 40 insertions, 1 deletions
diff --git a/packages/SystemUI/res-keyguard/layout/qs_media_divider.xml b/packages/SystemUI/res-keyguard/layout/qs_media_divider.xml new file mode 100644 index 000000000000..1be489cdc700 --- /dev/null +++ b/packages/SystemUI/res-keyguard/layout/qs_media_divider.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<View xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="1dp" + android:layout_marginBottom="16dp" + android:background="@color/media_divider"> +</View>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/qs_panel.xml b/packages/SystemUI/res/layout/qs_panel.xml index 761ab03ee87e..597644bf3295 100644 --- a/packages/SystemUI/res/layout/qs_panel.xml +++ b/packages/SystemUI/res/layout/qs_panel.xml @@ -62,6 +62,8 @@ android:focusable="true" android:accessibilityTraversalBefore="@android:id/edit"> <include layout="@layout/qs_footer_impl" /> + <include layout="@layout/qs_media_divider" + android:id="@+id/divider"/> </com.android.systemui.qs.QSPanel> </com.android.systemui.qs.NonInterceptingScrollView> diff --git a/packages/SystemUI/res/values-night/colors.xml b/packages/SystemUI/res/values-night/colors.xml index 196357c4794e..cb9e178de243 100644 --- a/packages/SystemUI/res/values-night/colors.xml +++ b/packages/SystemUI/res/values-night/colors.xml @@ -81,6 +81,8 @@ <color name="global_screenshot_dismiss_foreground">#FFFFFF</color> <color name="global_screenshot_background_protection_start">#80000000</color> <!-- 50% black --> + <!-- Media --> + <color name="media_divider">#85ffffff</color> <!-- Biometric dialog colors --> <color name="biometric_dialog_gray">#ff888888</color> diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index 3fbac96c8ed8..994a18110260 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -249,6 +249,7 @@ <color name="media_seekbar_progress">#c0ffffff</color> <color name="media_disabled">#80ffffff</color> <color name="media_seamless_border">#26ffffff</color> <!-- 15% --> + <color name="media_divider">#1d000000</color> <!-- controls --> <color name="control_primary_text">#E6FFFFFF</color> diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java index bc8f5a8fb652..e66b33c660d6 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java @@ -18,7 +18,6 @@ import android.util.Log; import android.view.View; import android.view.View.OnAttachStateChangeListener; import android.view.View.OnLayoutChangeListener; -import android.widget.ScrollView; import com.android.systemui.Dependency; import com.android.systemui.plugins.qs.QS; @@ -300,10 +299,16 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha if (mQsPanel.getSecurityFooter() != null) { builder.addFloat(mQsPanel.getSecurityFooter().getView(), "alpha", 0, 1); } + if (mQsPanel.getDivider() != null) { + builder.addFloat(mQsPanel.getDivider(), "alpha", 0, 1); + } mFirstPageDelayedAnimator = builder.build(); if (mQsPanel.getSecurityFooter() != null) { mAllViews.add(mQsPanel.getSecurityFooter().getView()); } + if (mQsPanel.getDivider() != null) { + mAllViews.add(mQsPanel.getDivider()); + } float px = 0; float py = 1; if (tiles.size() <= 3) { diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java index 5f191062c0d9..c8a34f010ae4 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java @@ -118,6 +118,8 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne @Nullable protected View mFooter; + @Nullable + protected View mDivider; @Nullable private ViewGroup mHeaderContainer; @@ -488,6 +490,7 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne protected void onFinishInflate() { super.onFinishInflate(); mFooter = findViewById(R.id.qs_footer); + mDivider = findViewById(R.id.divider); switchTileLayout(true /* force */); } @@ -498,6 +501,13 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne private boolean switchTileLayout(boolean force) { /** Whether or not the QuickQSPanel currently contains a media player. */ boolean horizontal = shouldUseHorizontalLayout(); + if (mDivider != null) { + if (!horizontal && mUsingMediaPlayer && mMediaHost.getVisible()) { + mDivider.setVisibility(View.VISIBLE); + } else { + mDivider.setVisibility(View.GONE); + } + } if (horizontal != mUsingHorizontalLayout || force) { mUsingHorizontalLayout = horizontal; View visibleView = horizontal ? mHorizontalLinearLayout : (View) mRegularTileLayout; @@ -531,6 +541,7 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne } updateTileLayoutMargins(); updateFooterMargin(); + updateDividerMargin(); updateMediaHostContentMargins(); updateHorizontalLinearLayoutMargins(); updatePadding(); @@ -980,6 +991,11 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne return mSecurityFooter; } + @Nullable + public View getDivider() { + return mDivider; + } + public void showDeviceMonitoringDialog() { if (mSecurityFooter != null) { mSecurityFooter.showDeviceMonitoringDialog(); @@ -995,6 +1011,7 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne mContentMarginEnd - mVisualTilePadding); updateMediaHostContentMargins(); updateFooterMargin(); + updateDividerMargin(); } private void updateFooterMargin() { @@ -1036,6 +1053,11 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne updateMargins((View) mTileLayout, mVisualMarginStart, marginEnd); } + private void updateDividerMargin() { + if (mDivider == null) return; + updateMargins(mDivider, mContentMarginStart, mContentMarginEnd); + } + /** * Update the margins of the media hosts */ |