Merge "Visual changes to tap-again toast." into sc-dev am: 1d5eb2545c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14738293 Change-Id: I1024a53ce3de5f2cedd6ae946a8bba39c299b87a
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user