am ee986895: am e34fef3b: Don\'t stack toasts for every user press
* commit 'ee9868955b11f44c37970fa9309928d11d199ec2': Don't stack toasts for every user press
This commit is contained in:
@@ -4859,15 +4859,12 @@
|
||||
<!-- Exting lock-to-app indication. -->
|
||||
<string name="lock_to_app_exit">Screen unpinned</string>
|
||||
|
||||
<!-- Lock-to-app checkbox for lock on exit -->
|
||||
<string name="lock_to_app_use_screen_lock">Ask for %1$s before unpinning</string>
|
||||
|
||||
<!-- Lock-to-app unlock pin string -->
|
||||
<string name="lock_to_app_unlock_pin">PIN</string>
|
||||
<string name="lock_to_app_unlock_pin">Ask for PIN before unpinning</string>
|
||||
<!-- Lock-to-app unlock pattern string -->
|
||||
<string name="lock_to_app_unlock_pattern">unlock pattern</string>
|
||||
<string name="lock_to_app_unlock_pattern">Ask for unlock pattern before unpinning</string>
|
||||
<!-- Lock-to-app unlock password string -->
|
||||
<string name="lock_to_app_unlock_password">password</string>
|
||||
<string name="lock_to_app_unlock_password">Ask for password before unpinning</string>
|
||||
|
||||
<!-- [CHAR_LIMIT=NONE] Battery saver: Feature description -->
|
||||
<string name="battery_saver_description">To help improve battery life, battery saver reduces your device’s performance and limits vibration and most background data. Email, messaging, and other apps that rely on syncing may not update unless you open them.\n\nBattery saver turns off automatically when your device is charging</string>
|
||||
|
||||
@@ -622,7 +622,6 @@
|
||||
<java-symbol type="id" name="lock_to_app_checkbox" />
|
||||
<java-symbol type="string" name="lock_to_app_start" />
|
||||
<java-symbol type="string" name="lock_to_app_exit" />
|
||||
<java-symbol type="string" name="lock_to_app_use_screen_lock" />
|
||||
<java-symbol type="string" name="lock_to_app_unlock_pin" />
|
||||
<java-symbol type="string" name="lock_to_app_unlock_pattern" />
|
||||
<java-symbol type="string" name="lock_to_app_unlock_password" />
|
||||
|
||||
@@ -34,6 +34,7 @@ public class LockTaskNotify {
|
||||
private final Context mContext;
|
||||
private final H mHandler;
|
||||
private AccessibilityManager mAccessibilityManager;
|
||||
private Toast mLastToast;
|
||||
|
||||
public LockTaskNotify(Context context) {
|
||||
mContext = context;
|
||||
@@ -52,7 +53,11 @@ public class LockTaskNotify {
|
||||
if (!isLocked && mAccessibilityManager.isEnabled()) {
|
||||
text = mContext.getString(R.string.lock_to_app_toast_accessible);
|
||||
}
|
||||
Toast.makeText(mContext, text, Toast.LENGTH_LONG).show();
|
||||
if (mLastToast != null) {
|
||||
mLastToast.cancel();
|
||||
}
|
||||
mLastToast = Toast.makeText(mContext, text, Toast.LENGTH_LONG);
|
||||
mLastToast.show();
|
||||
}
|
||||
|
||||
public void show(boolean starting) {
|
||||
|
||||
@@ -102,8 +102,7 @@ public class LockToAppRequestDialog implements OnClickListener {
|
||||
if (unlockStringId != 0) {
|
||||
String unlockString = mContext.getString(unlockStringId);
|
||||
mCheckbox = (CheckBox) mDialog.findViewById(R.id.lock_to_app_checkbox);
|
||||
mCheckbox.setText(mContext.getString(R.string.lock_to_app_use_screen_lock,
|
||||
unlockString));
|
||||
mCheckbox.setText(unlockString);
|
||||
|
||||
// Remember state.
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user