Merge "Visual changes to tap-again toast." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1d5eb2545c
@@ -137,11 +137,12 @@
|
|||||||
systemui:layout_constraintRight_toRightOf="parent"
|
systemui:layout_constraintRight_toRightOf="parent"
|
||||||
systemui:layout_constraintBottom_toBottomOf="parent"
|
systemui:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp"
|
||||||
android:paddingLeft="20dp"
|
android:paddingHorizontal="16dp"
|
||||||
android:paddingRight="20dp"
|
android:minHeight="44dp"
|
||||||
android:paddingTop="10dp"
|
android:elevation="4dp"
|
||||||
android:paddingBottom="10dp"
|
android:background="@drawable/rounded_bg_full"
|
||||||
android:elevation="10dp"
|
android:gravity="center"
|
||||||
|
android:text="@string/tap_again"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
/>
|
/>
|
||||||
</com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer>
|
</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] -->
|
<!-- 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>
|
<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] -->
|
<!-- Message shown when lock screen is tapped or face authentication fails. [CHAR LIMIT=60] -->
|
||||||
<string name="keyguard_unlock">Swipe up to open</string>
|
<string name="keyguard_unlock">Swipe up to open</string>
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import android.animation.ObjectAnimator;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.FrameLayout;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
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.
|
* 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(
|
public TapAgainView(
|
||||||
@NonNull Context context, @Nullable AttributeSet attrs) {
|
@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
updateBgColor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onFinishInflate() {
|
protected void onFinishInflate() {
|
||||||
super.onFinishInflate();
|
super.onFinishInflate();
|
||||||
|
updateColor();
|
||||||
TextView text = new TextView(mContext);
|
|
||||||
text.setText(R.string.notification_tap_again);
|
|
||||||
addView(text);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateBgColor() {
|
void updateColor() {
|
||||||
setBackgroundResource(R.drawable.rounded_bg_full);
|
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. */
|
/** Make the view visible. */
|
||||||
|
|||||||
@@ -44,17 +44,17 @@ public class TapAgainViewController extends ViewController<TapAgainView> {
|
|||||||
final ConfigurationListener mConfigurationListener = new ConfigurationListener() {
|
final ConfigurationListener mConfigurationListener = new ConfigurationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onOverlayChanged() {
|
public void onOverlayChanged() {
|
||||||
mView.updateBgColor();
|
mView.updateColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUiModeChanged() {
|
public void onUiModeChanged() {
|
||||||
mView.updateBgColor();
|
mView.updateColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onThemeChanged() {
|
public void onThemeChanged() {
|
||||||
mView.updateBgColor();
|
mView.updateColor();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user