Merge "More QS theme fixes for contrast"
This commit is contained in:
committed by
Android (Google) Code Review
commit
e52840449e
@@ -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">
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -814,4 +814,6 @@
|
||||
<dimen name="rounded_corner_radius">0dp</dimen>
|
||||
<dimen name="rounded_corner_content_padding">0dp</dimen>
|
||||
|
||||
<dimen name="qs_gutter_height">6dp</dimen>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -339,11 +339,10 @@ public abstract class QSTileImpl<TState extends State> implements QSTile {
|
||||
public static int getColorForState(Context context, int state) {
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user