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 0000000000000..1be489cdc7001 --- /dev/null +++ b/packages/SystemUI/res-keyguard/layout/qs_media_divider.xml @@ -0,0 +1,7 @@ + + + \ 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 761ab03ee87e0..597644bf32958 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"> + diff --git a/packages/SystemUI/res/values-night/colors.xml b/packages/SystemUI/res/values-night/colors.xml index 196357c4794e8..cb9e178de2436 100644 --- a/packages/SystemUI/res/values-night/colors.xml +++ b/packages/SystemUI/res/values-night/colors.xml @@ -81,6 +81,8 @@ #FFFFFF #80000000 + + #85ffffff #ff888888 diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index 3fbac96c8ed88..994a18110260b 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -249,6 +249,7 @@ #c0ffffff #80ffffff #26ffffff + #1d000000 #E6FFFFFF diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java index bc8f5a8fb6526..e66b33c660d6c 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 5f191062c0d9c..c8a34f010ae42 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 */