get rid of magic and inline strings
This commit is contained in:
parent
ce6f080e83
commit
485029c5c2
2 changed files with 4 additions and 2 deletions
|
@ -133,6 +133,7 @@ public class AccountSettings extends K9PreferenceActivity {
|
|||
private static final String PREFERENCE_TRASH_FOLDER = "trash_folder";
|
||||
private static final String PREFERENCE_ALWAYS_SHOW_CC_BCC = "always_show_cc_bcc";
|
||||
public static final String APG_DEPRECATION_DIALOG_TAG = "apgDeprecationDialog";
|
||||
public static final String APG_PROVIDER_PLACEHOLDER = "apg-placeholder";
|
||||
|
||||
|
||||
private Account mAccount;
|
||||
|
@ -710,12 +711,12 @@ public class AccountSettings extends K9PreferenceActivity {
|
|||
|
||||
mCryptoApp.setValue(String.valueOf(mAccount.getCryptoApp()));
|
||||
if (OpenPgpAppPreference.isApgInstalled(getApplicationContext())) {
|
||||
mCryptoApp.addLegacyProvider("apg-placeholder", "APG", R.drawable.ic_apg_small);
|
||||
mCryptoApp.addLegacyProvider(APG_PROVIDER_PLACEHOLDER, getString(R.string.apg), R.drawable.ic_apg_small);
|
||||
}
|
||||
mCryptoApp.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
String value = newValue.toString();
|
||||
if ("apg-placeholder".equals(value)) {
|
||||
if (APG_PROVIDER_PLACEHOLDER.equals(value)) {
|
||||
mCryptoApp.setValue("");
|
||||
mCryptoKey.setOpenPgpProvider("");
|
||||
showApgDeprecationDialog();
|
||||
|
|
|
@ -1212,5 +1212,6 @@ Please submit bug reports, contribute new features and ask questions at
|
|||
<string name="apg_deprecated_bullet_2">Contains unfixed security issues</string>
|
||||
<string name="apg_learn_more">You can <a href="https://k9mail.github.io/2017/01/13/Why-APG-is-no-longer-supported.html">click here</a> to learn more.</string>
|
||||
<string name="apg_deprecated_ok">Got it!</string>
|
||||
<string name="apg">APG</string>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue