From cb667da70bdddb05fd05a102234f0ab61c6e7515 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Tue, 18 May 2021 16:53:02 -0400 Subject: [PATCH] Fix size of RemoteInputView to for a11y Fixes: 164065068 Fixes: 186590902 Test: talkback inspection of targets, etc. Change-Id: I594c9bd0ddccfa436fd8346361afe0449c001710 --- .../drawable/remote_input_view_text_bg.xml | 4 +-- packages/SystemUI/res/layout/remote_input.xml | 32 ++++++++++--------- .../statusbar/policy/RemoteInputView.java | 15 ++------- 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/packages/SystemUI/res/drawable/remote_input_view_text_bg.xml b/packages/SystemUI/res/drawable/remote_input_view_text_bg.xml index 5d374a98ae481..535b35497b5c5 100644 --- a/packages/SystemUI/res/drawable/remote_input_view_text_bg.xml +++ b/packages/SystemUI/res/drawable/remote_input_view_text_bg.xml @@ -21,10 +21,10 @@ android:width="@dimen/remote_input_view_text_stroke" android:color="?android:attr/colorAccent"/> + android:top="0dp"/> diff --git a/packages/SystemUI/res/layout/remote_input.xml b/packages/SystemUI/res/layout/remote_input.xml index a909d0d4d3c24..a5b2f80a31587 100644 --- a/packages/SystemUI/res/layout/remote_input.xml +++ b/packages/SystemUI/res/layout/remote_input.xml @@ -28,18 +28,18 @@ android:id="@+id/remote_input_content" android:orientation="vertical" android:clipToPadding="false" - android:layout_marginEnd="20dp" - android:layout_marginStart="20dp" + android:layout_marginEnd="0dp" + android:layout_marginStart="16dp" android:layout_marginTop="5dp" android:layout_marginBottom="16dp" android:layout_weight="1"> 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 c3b9c7bf89f24..ca5d6df4f0a72 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java @@ -35,7 +35,6 @@ import android.graphics.BlendMode; import android.graphics.Color; import android.graphics.PorterDuff; import android.graphics.Rect; -import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.GradientDrawable; import android.net.Uri; import android.os.Bundle; @@ -228,8 +227,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene alternateTextColor = ta.getColor(3, backgroundColor); } } - mEditText.setAllColors(backgroundColor, editBgColor, - accentColor, textColor, hintTextColor); final ColorStateList accentTint = new ColorStateList(new int[][]{ new int[]{com.android.internal.R.attr.state_enabled}, new int[]{}, @@ -237,6 +234,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene accentColor, accentColor & 0x4DFFFFFF // %30 opacity }); + mEditText.setAllColors(accentColor, textColor, hintTextColor); mContentBackground.setColor(editBgColor); mContentBackground.setStroke(stroke, accentTint); mDelete.setImageTintList(ColorStateList.valueOf(alternateTextColor)); @@ -875,7 +873,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene private final OnReceiveContentListener mOnReceiveContentListener = this::onReceiveContent; private RemoteInputView mRemoteInputView; - private ColorDrawable mBackground; boolean mShowImeOnInputConnection; private LightBarController mLightBarController; private InputMethodManager mInputMethodManager; @@ -885,8 +882,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene public RemoteEditText(Context context, AttributeSet attrs) { super(context, attrs); mLightBarController = Dependency.get(LightBarController.class); - - mBackground = new ColorDrawable(); } void setSupportedMimeTypes(@Nullable Collection mimeTypes) { @@ -1045,9 +1040,6 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene if (focusable) { requestFocus(); - setBackground(mBackground); - } else { - setBackground(null); } } @@ -1062,10 +1054,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene return remainingItems; } - protected void setAllColors(int backgroundColor, int editBackgroundColor, - int accentColor, int textColor, int hintTextColor) { - setBackgroundColor(editBackgroundColor); - mBackground.setColor(editBackgroundColor); + protected void setAllColors(int accentColor, int textColor, int hintTextColor) { setTextColor(textColor); setHintTextColor(hintTextColor); getTextCursorDrawable().setColorFilter(accentColor, PorterDuff.Mode.SRC_IN);