diff options
| author | 2021-05-26 22:08:19 +0000 | |
|---|---|---|
| committer | 2021-05-26 22:08:19 +0000 | |
| commit | 1d5eb2545c913db6e8e04dbc11f5fa8600fe2407 (patch) | |
| tree | bbf090a250510f42200931bb0125d3001e85a142 | |
| parent | c074433e3b6043c1863e4ed903092650cd2c3c0e (diff) | |
| parent | 9c72d6ee0abfb3708cd540a39215eec11869dfd7 (diff) | |
Merge "Visual changes to tap-again toast." into sc-dev
4 files changed, 20 insertions, 17 deletions
diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml index 09d46856dec8..fb39d3e4027d 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded.xml @@ -137,11 +137,12 @@ systemui:layout_constraintRight_toRightOf="parent" systemui:layout_constraintBottom_toBottomOf="parent" android:layout_marginBottom="20dp" - android:paddingLeft="20dp" - android:paddingRight="20dp" - android:paddingTop="10dp" - android:paddingBottom="10dp" - android:elevation="10dp" + android:paddingHorizontal="16dp" + android:minHeight="44dp" + android:elevation="4dp" + android:background="@drawable/rounded_bg_full" + android:gravity="center" + android:text="@string/tap_again" android:visibility="gone" /> </com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 01d0dde6da5e..db3fae6fa491 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -1062,6 +1062,9 @@ <!-- Shows to explain the double tap interaction with notifications: After tapping a notification on Keyguard, this will explain users to tap again to launch a notification. [CHAR LIMIT=60] --> <string name="notification_tap_again">Tap again to open</string> + <!-- Asks for a second tap as confirmation on an item that normally requires one tap. [CHAR LIMIT=60] --> + <string name="tap_again">Tap again</string> + <!-- Message shown when lock screen is tapped or face authentication fails. [CHAR LIMIT=60] --> <string name="keyguard_unlock">Swipe up to open</string> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainView.java index 9856795c8903..52e0e8a7a0cb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainView.java @@ -23,7 +23,6 @@ import android.animation.ObjectAnimator; import android.content.Context; import android.util.AttributeSet; import android.view.View; -import android.widget.FrameLayout; import android.widget.TextView; import androidx.annotation.NonNull; @@ -35,24 +34,24 @@ import com.android.wm.shell.animation.Interpolators; /** * View to show a toast-like popup on the notification shade and quick settings. */ -public class TapAgainView extends FrameLayout { +public class TapAgainView extends TextView { + private TextView mTextView; + public TapAgainView( @NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); - updateBgColor(); } @Override protected void onFinishInflate() { super.onFinishInflate(); - - TextView text = new TextView(mContext); - text.setText(R.string.notification_tap_again); - addView(text); + updateColor(); } - void updateBgColor() { - setBackgroundResource(R.drawable.rounded_bg_full); + void updateColor() { + int textColor = getResources().getColor(R.color.notif_pill_text, mContext.getTheme()); + setTextColor(textColor); + setBackground(getResources().getDrawable(R.drawable.rounded_bg_full, mContext.getTheme())); } /** Make the view visible. */ diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainViewController.java index bb53bad7df70..0c5502bac8fc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TapAgainViewController.java @@ -44,17 +44,17 @@ public class TapAgainViewController extends ViewController<TapAgainView> { final ConfigurationListener mConfigurationListener = new ConfigurationListener() { @Override public void onOverlayChanged() { - mView.updateBgColor(); + mView.updateColor(); } @Override public void onUiModeChanged() { - mView.updateBgColor(); + mView.updateColor(); } @Override public void onThemeChanged() { - mView.updateBgColor(); + mView.updateColor(); } }; |