diff --git a/packages/SystemUI/res/color/remote_input_hint.xml b/packages/SystemUI/res/color/remote_input_hint.xml
new file mode 100644
index 0000000000000..7fe58dbcf8225
--- /dev/null
+++ b/packages/SystemUI/res/color/remote_input_hint.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/SystemUI/res/color/remote_input_text.xml b/packages/SystemUI/res/color/remote_input_text.xml
index 33eeb7794d091..3622c910b78b4 100644
--- a/packages/SystemUI/res/color/remote_input_text.xml
+++ b/packages/SystemUI/res/color/remote_input_text.xml
@@ -16,6 +16,6 @@
-->
-
-
+
+
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/notif_footer_btn_background.xml b/packages/SystemUI/res/drawable/notif_footer_btn_background.xml
new file mode 100644
index 0000000000000..f35f5d1f9d76e
--- /dev/null
+++ b/packages/SystemUI/res/drawable/notif_footer_btn_background.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/remote_input_view_text_bg.xml b/packages/SystemUI/res/drawable/remote_input_view_text_bg.xml
new file mode 100644
index 0000000000000..5d374a98ae481
--- /dev/null
+++ b/packages/SystemUI/res/drawable/remote_input_view_text_bg.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/remote_input.xml b/packages/SystemUI/res/layout/remote_input.xml
index 43182eb991e5c..ae3adb82fe6fb 100644
--- a/packages/SystemUI/res/layout/remote_input.xml
+++ b/packages/SystemUI/res/layout/remote_input.xml
@@ -25,26 +25,25 @@
diff --git a/packages/SystemUI/res/layout/status_bar_notification_footer.xml b/packages/SystemUI/res/layout/status_bar_notification_footer.xml
index 5a1e5c439724a..5c77d16f2b361 100644
--- a/packages/SystemUI/res/layout/status_bar_notification_footer.xml
+++ b/packages/SystemUI/res/layout/status_bar_notification_footer.xml
@@ -30,9 +30,11 @@
style="@style/TextAppearance.NotificationSectionHeaderButton"
android:id="@+id/manage_text"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="40dp"
android:layout_gravity="start"
+ android:background="@drawable/notif_footer_btn_background"
android:focusable="true"
+ android:textColor="@color/notif_pill_text"
android:contentDescription="@string/manage_notifications_history_text"
android:text="@string/manage_notifications_history_text"
/>
@@ -40,8 +42,9 @@
style="@style/TextAppearance.NotificationSectionHeaderButton"
android:id="@+id/dismiss_text"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="40dp"
android:layout_gravity="end"
+ android:background="@drawable/notif_footer_btn_background"
android:focusable="true"
android:contentDescription="@string/accessibility_clear_all"
android:text="@string/clear_all_notifications_text"
diff --git a/packages/SystemUI/res/values-night/colors.xml b/packages/SystemUI/res/values-night/colors.xml
index d571f2f174978..150e58b4e99e7 100644
--- a/packages/SystemUI/res/values-night/colors.xml
+++ b/packages/SystemUI/res/values-night/colors.xml
@@ -33,6 +33,9 @@
@*android:color/notification_primary_text_color_dark
+ @android:color/system_neutral1_800
+ @android:color/system_neutral1_50
+
@color/GM2_grey_500
@color/GM2_grey_300
@color/GM2_grey_200
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index a773b2242eaab..c18ab14579ce2 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -151,8 +151,8 @@
#00000000
@*android:color/notification_default_color
- #99ffffff
-
+ @android:color/system_neutral2_100
+ @android:color/system_neutral1_900
?android:attr/colorAccent
#1F000000
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 2393b749b64ef..f036be032f6ec 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -19,6 +19,8 @@
48dp
+ 3dp
+
-12dp
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java
index 3ec8c23747189..4ed5056866f28 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java
@@ -93,6 +93,13 @@ public class FooterView extends StackScrollerDecorView {
@Override
protected void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
+ mDismissButton.setBackground(
+ getResources().getDrawable(R.drawable.notif_footer_btn_background));
+ mDismissButton.setTextColor(getResources().getColor(R.color.notif_pill_text));
+ mManageButton.setBackground(
+ getResources().getDrawable(R.drawable.notif_footer_btn_background));
+ mManageButton.setTextColor(getResources().getColor(R.color.notif_pill_text));
+ mManageButton = findViewById(R.id.manage_text);
mDismissButton.setText(R.string.clear_all_notifications_text);
mDismissButton.setContentDescription(
mContext.getString(R.string.accessibility_clear_all));
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
index 55a27b2b00525..c3ccba4c37713 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
@@ -1291,9 +1291,14 @@ public class NotificationContentView extends FrameLayout {
}
}
}
-
- if (existing != null && entry.getSbn().getNotification().isColorized()) {
- existing.overrideBackgroundTintColor(entry.getSbn().getNotification().color);
+ if (existing != null) {
+ if (entry.getSbn().getNotification().isColorized()) {
+ existing.setBackgroundTintColor(
+ entry.getSbn().getNotification().color, true);
+ } else {
+ existing.setBackgroundTintColor(
+ entry.getRow().getCurrentBackgroundTint(), false);
+ }
}
return existing;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
index f72d2ae191d14..6e78059f694ec 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java
@@ -32,7 +32,6 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ShortcutManager;
import android.content.res.ColorStateList;
-import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Rect;
@@ -74,6 +73,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
+import com.android.internal.graphics.ColorUtils;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.statusbar.IStatusBarService;
@@ -130,6 +130,9 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
private int mRevealCy;
private int mRevealR;
+ private boolean mColorized;
+ private int mTint;
+
private boolean mResetting;
private NotificationViewWrapper mWrapper;
private Consumer mOnVisibilityChangedListener;
@@ -143,35 +146,63 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
mRemoteInputManager = Dependency.get(NotificationRemoteInputManager.class);
mStatusBarManagerService = IStatusBarService.Stub.asInterface(
ServiceManager.getService(Context.STATUS_BAR_SERVICE));
+ TypedArray ta = getContext().getTheme().obtainStyledAttributes(new int[]{
+ com.android.internal.R.attr.colorAccent,
+ com.android.internal.R.attr.colorBackgroundFloating,
+ });
+ mTint = ta.getColor(0, 0);
+ ta.recycle();
}
/**
* The remote view needs to adapt to colorized notifications when set
+ * It overrides the background of itself as well as all of its childern
* @param color colorized notification color
*/
- public void overrideBackgroundTintColor(int color) {
- mEditText.setBackgroundTintColor(color);
- final boolean dark = !ContrastColorUtil.isColorLight(color);
- int[][] states = new int[][] {
- new int[] {android.R.attr.state_enabled},
- new int[] {},
+ public void setBackgroundTintColor(int color, boolean colorized) {
+ if (colorized == mColorized && color == mTint) return;
+ mColorized = colorized;
+ mTint = color;
+ final int[][] states = new int[][]{
+ new int[]{com.android.internal.R.attr.state_enabled},
+ new int[]{},
};
+ final int[] colors;
+ if (colorized) {
+ final boolean dark = !ContrastColorUtil.isColorLight(color);
+ final int finalColor = dark
+ ? Color.WHITE
+ : Color.BLACK;
+ colors = new int[]{
+ finalColor,
+ finalColor & 0x4DFFFFFF // %30 opacity
+ };
+ mEditText.setUniformBackgroundTintColor(color);
+ mEditText.setUniformForegroundColor(finalColor);
- final int finalColor = dark
- ? Color.WHITE
- : Color.BLACK;
-
- int[] colors = new int[] {
- finalColor,
- finalColor & 0x4DFFFFFF // %30 opacity
- };
-
- final ColorStateList tint = new ColorStateList(states, colors);
+ } else {
+ mEditText.setTextColor(mContext.getColor(R.color.remote_input_text));
+ mEditText.setHintTextColor(mContext.getColorStateList(R.color.remote_input_hint));
+ TypedArray ta = getContext().getTheme().obtainStyledAttributes(new int[]{
+ com.android.internal.R.attr.colorAccent,
+ com.android.internal.R.attr.colorBackgroundFloating,
+ });
+ int colorAccent = ta.getColor(0, 0);
+ int colorBackgroundFloating = ta.getColor(1, 0);
+ ta.recycle();
+ mEditText.setTextBackgroundColors(colorAccent, colorBackgroundFloating);
+ colors = new int[]{
+ colorAccent,
+ colorBackgroundFloating & 0x4DFFFFFF // %30 opacity
+ };
+ }
+ mEditText.setBackgroundColor(color);
+ final ColorStateList tint = new ColorStateList(states, colors);
mSendButton.setImageTintList(tint);
mProgressBar.setProgressTintList(tint);
mProgressBar.setIndeterminateTintList(tint);
mProgressBar.setSecondaryProgressTintList(tint);
- mEditText.setForegroundColor(finalColor);
+ setBackgroundColor(color);
}
@Override
@@ -326,7 +357,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
reveal.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
- setVisibility(INVISIBLE);
+ setVisibility(GONE);
if (mWrapper != null) {
mWrapper.setRemoteInputVisible(false);
}
@@ -334,7 +365,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
});
reveal.start();
} else {
- setVisibility(INVISIBLE);
+ setVisibility(GONE);
if (mWrapper != null) {
mWrapper.setRemoteInputVisible(false);
}
@@ -398,12 +429,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
}
}
- @Override
- public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- mEditText.updateCornerRadius(heightMeasureSpec / 2);
- }
-
/** Populates the text field of the remote input with the given content. */
public void setEditTextContent(@Nullable CharSequence editTextContent) {
mEditText.setText(editTextContent);
@@ -700,40 +725,15 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
boolean mShowImeOnInputConnection;
private LightBarController mLightBarController;
private InputMethodManager mInputMethodManager;
- private int mColor = Notification.COLOR_DEFAULT;
UserHandle mUser;
- private int mStokeWidth;
public RemoteEditText(Context context, AttributeSet attrs) {
super(context, attrs);
mLightBarController = Dependency.get(LightBarController.class);
- mTextBackground = createBackground(context, attrs);
+ mTextBackground = (GradientDrawable)
+ context.getDrawable(R.drawable.remote_input_view_text_bg).mutate();
mBackgroundColor = new ColorDrawable();
mBackground = new LayerDrawable(new Drawable[] {mBackgroundColor, mTextBackground});
- float density = context.getResources().getDisplayMetrics().density;
- mStokeWidth = (int) (2 * density);
- setDefaultColors();
- }
-
- private void setDefaultColors() {
- Resources.Theme theme = getContext().getTheme();
- TypedArray ta = theme.obtainStyledAttributes(
- new int[]{android.R.attr.colorAccent,
- com.android.internal.R.attr.colorBackgroundFloating});
- mTextBackground.setStroke(mStokeWidth,
- ta.getColor(0, Notification.COLOR_DEFAULT));
- mColor = ta.getColor(1, Notification.COLOR_DEFAULT);
- mTextBackground.setColor(mColor);
- }
-
- private GradientDrawable createBackground(Context context, AttributeSet attrs) {
- float density = context.getResources().getDisplayMetrics().density;
- int padding = (int) (12 * density);
- GradientDrawable d = new GradientDrawable();
- d.setShape(GradientDrawable.RECTANGLE);
- d.setPadding(padding, padding, padding, padding);
- d.setCornerRadius(padding);
- return d;
}
void setSupportedMimeTypes(@Nullable Collection mimeTypes) {
@@ -796,16 +796,17 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
}
}
- protected void setBackgroundTintColor(int color) {
+ protected void setUniformBackgroundTintColor(int color) {
mBackgroundColor.setColor(color);
mTextBackground.setColor(color);
}
- protected void setForegroundColor(int color) {
- mTextBackground.setStroke(mStokeWidth, color);
+ protected void setUniformForegroundColor(int color) {
+ int stroke = getContext().getResources()
+ .getDimensionPixelSize(R.dimen.remote_input_view_text_stroke);
+ mTextBackground.setStroke(stroke, color);
setTextColor(color);
- // %60
- setHintTextColor(color & 0x99FFFFFF);
+ setHintTextColor(ColorUtils.setAlphaComponent(color, 0x99));
setTextCursorDrawable(null);
}
@@ -896,10 +897,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
setSelection(getText().length());
}
- void updateCornerRadius(float radius) {
- mTextBackground.setCornerRadius(radius);
- }
-
void setInnerFocusable(boolean focusable) {
setFocusableInTouchMode(focusable);
setFocusable(focusable);
@@ -935,5 +932,12 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
}
return remainingItems;
}
+
+ protected void setTextBackgroundColors(int strokeColor, int textBackground) {
+ mTextBackground.setColor(textBackground);
+ int stroke = getContext().getResources()
+ .getDimensionPixelSize(R.dimen.remote_input_view_text_stroke);
+ mTextBackground.setStroke(stroke, strokeColor);
+ }
}
}