Use a dedicated summary for 'never lock Briar' for proper English

parent 04ffff09
......@@ -460,7 +460,20 @@ public class SettingsFragment extends PreferenceFragmentCompat
int timeout = settings.getInt(PREF_SCREEN_LOCK_TIMEOUT,
Integer.valueOf(getString(
R.string.pref_lock_timeout_value_default)));
screenLockTimeout.setValue(String.valueOf(timeout));
String newValue = String.valueOf(timeout);
screenLockTimeout.setValue(newValue);
setScreenLockTimeoutSummary(newValue);
}
}
private void setScreenLockTimeoutSummary(String timeout) {
String never = getString(R.string.pref_lock_timeout_value_never);
if (timeout.equals(never)) {
screenLockTimeout
.setSummary(R.string.pref_lock_timeout_never_summary);
} else {
screenLockTimeout
.setSummary(R.string.pref_lock_timeout_summary);
}
}
......@@ -525,9 +538,10 @@ public class SettingsFragment extends PreferenceFragmentCompat
storeSettings(s);
} else if (preference == screenLockTimeout) {
Settings s = new Settings();
s.putInt(PREF_SCREEN_LOCK_TIMEOUT,
Integer.valueOf((String) newValue));
String value = (String) newValue;
s.putInt(PREF_SCREEN_LOCK_TIMEOUT, Integer.valueOf(value));
storeSettings(s);
setScreenLockTimeoutSummary(value);
} else if (preference == notifyPrivateMessages) {
Settings s = new Settings();
s.putBoolean(PREF_NOTIFY_PRIVATE, (Boolean) newValue);
......
......@@ -361,13 +361,15 @@
<string name="pref_lock_summary">Use the device\'s screen lock to protect Briar while signed in</string>
<string name="pref_lock_disabled_summary">Set up a screen lock for your device to protect Briar while signed in</string>
<string name="pref_lock_timeout_title">Screen Lock Inactivity Timeout</string>
<!-- The %s placeholder is replaces with the following time spans, e.g. after 5 Minutes -->
<string name="pref_lock_timeout_summary">When not using Briar, automatically lock it %s</string>
<string name="pref_lock_timeout_never">never</string>
<string name="pref_lock_timeout_1">after 1 Minute</string>
<string name="pref_lock_timeout_5">after 5 Minutes</string>
<string name="pref_lock_timeout_15">after 15 Minutes</string>
<string name="pref_lock_timeout_30">after 30 Minutes</string>
<string name="pref_lock_timeout_60">after 1 Hour</string>
<string name="pref_lock_timeout_never">never</string>
<string name="pref_lock_timeout_never_summary">Never lock Briar automatically</string>
<string name="change_password">Change password</string>
<string name="current_password">Current password</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment