Renamed setting

pull/168/head
M66B 5 years ago
parent 4981b569b5
commit fe9ca75d9a

@ -73,8 +73,9 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
this.contacts = hasPermission(Manifest.permission.READ_CONTACTS);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean no_history = prefs.getBoolean("no_history", false);
if (no_history)
boolean secure = prefs.getBoolean("secure", false);
if (secure)
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
if (!this.getClass().equals(ActivityMain.class)) {

@ -173,6 +173,12 @@ public class ApplicationEx extends Application {
editor.putInt("default_snooze", hours);
editor.remove("notify_snooze_duration");
}
} else if (version < 819) {
if (prefs.contains("no_history")) {
editor.putBoolean("secure", prefs.getBoolean("no_history", false));
editor.remove("no_history");
}
}
if (version < BuildConfig.VERSION_CODE)

@ -63,7 +63,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
private Spinner spOpenPgp;
private SwitchCompat swEncrypt;
private SwitchCompat swAutoDecrypt;
private SwitchCompat swNoHistory;
private SwitchCompat swSecure;
private Button btnBiometrics;
private Spinner spBiometricsTimeout;
private Button btnPin;
@ -73,7 +73,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
private final static String[] RESET_OPTIONS = new String[]{
"disable_tracking", "display_hidden",
"openpgp_provider", "encrypt_default", "auto_decrypt",
"no_history",
"secure",
"biometrics", "pin", "biometrics_timeout"
};
@ -92,7 +92,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
spOpenPgp = view.findViewById(R.id.spOpenPgp);
swEncrypt = view.findViewById(R.id.swEncrypt);
swAutoDecrypt = view.findViewById(R.id.swAutoDecrypt);
swNoHistory = view.findViewById(R.id.swNoHistory);
swSecure = view.findViewById(R.id.swSecure);
btnBiometrics = view.findViewById(R.id.btnBiometrics);
spBiometricsTimeout = view.findViewById(R.id.spBiometricsTimeout);
btnPin = view.findViewById(R.id.btnPin);
@ -154,10 +154,10 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
}
});
swNoHistory.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
swSecure.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("no_history", checked).commit(); // apply won't work here
prefs.edit().putBoolean("secure", checked).commit(); // apply won't work here
restart();
}
});
@ -267,7 +267,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
swEncrypt.setChecked(prefs.getBoolean("encrypt_default", false));
swAutoDecrypt.setChecked(prefs.getBoolean("auto_decrypt", false));
swNoHistory.setChecked(prefs.getBoolean("no_history", false));
swSecure.setChecked(prefs.getBoolean("secure", false));
boolean biometrics = prefs.getBoolean("biometrics", false);
btnBiometrics.setText(biometrics

@ -103,18 +103,18 @@
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swNoHistory"
android:id="@+id/swSecure"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_recents"
android:text="@string/title_advanced_secure"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAutoDecrypt"
app:switchPadding="12dp" />
<TextView
android:id="@+id/tvNoHistoryHint"
android:id="@+id/tvSecureHint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="48dp"
@ -123,7 +123,7 @@
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swNoHistory" />
app:layout_constraintTop_toBottomOf="@id/swSecure" />
<TextView
android:id="@+id/tvBiometrics"
@ -136,7 +136,7 @@
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNoHistoryHint" />
app:layout_constraintTop_toBottomOf="@id/tvSecureHint" />
<Button
android:id="@+id/btnBiometrics"

@ -329,7 +329,7 @@
<string name="title_advanced_display_hidden">Display hidden message texts</string>
<string name="title_advanced_openpgp">OpenPGP provider</string>
<string name="title_advanced_auto_decrypt">Automatically decrypt messages</string>
<string name="title_advanced_recents">Hide FairEmail from screen with recent apps</string>
<string name="title_advanced_secure">Hide from recent apps screen and prevent taking screenshots</string>
<string name="title_advanced_biometrics_timeout">Biometric authentication timeout</string>
<string name="title_advanced_pin">PIN</string>

Loading…
Cancel
Save