Merge "Add divider between QS and media" into rvc-dev am: bd0b819c21

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11953553

Change-Id: I6421116de90db3faa838f0a28dc167bcdb83f7b5
This commit is contained in:
Fabian Kozynski
2020-06-22 21:54:40 +00:00
committed by Automerger Merge Worker
6 changed files with 40 additions and 1 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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) {

View File

@@ -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
*/