Renamed setting

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

@ -73,8 +73,9 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
this.contacts = hasPermission(Manifest.permission.READ_CONTACTS); this.contacts = hasPermission(Manifest.permission.READ_CONTACTS);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); 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); getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
if (!this.getClass().equals(ActivityMain.class)) { if (!this.getClass().equals(ActivityMain.class)) {

@ -173,6 +173,12 @@ public class ApplicationEx extends Application {
editor.putInt("default_snooze", hours); editor.putInt("default_snooze", hours);
editor.remove("notify_snooze_duration"); 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) if (version < BuildConfig.VERSION_CODE)

@ -63,7 +63,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
private Spinner spOpenPgp; private Spinner spOpenPgp;
private SwitchCompat swEncrypt; private SwitchCompat swEncrypt;
private SwitchCompat swAutoDecrypt; private SwitchCompat swAutoDecrypt;
private SwitchCompat swNoHistory; private SwitchCompat swSecure;
private Button btnBiometrics; private Button btnBiometrics;
private Spinner spBiometricsTimeout; private Spinner spBiometricsTimeout;
private Button btnPin; private Button btnPin;
@ -73,7 +73,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
private final static String[] RESET_OPTIONS = new String[]{ private final static String[] RESET_OPTIONS = new String[]{
"disable_tracking", "display_hidden", "disable_tracking", "display_hidden",
"openpgp_provider", "encrypt_default", "auto_decrypt", "openpgp_provider", "encrypt_default", "auto_decrypt",
"no_history", "secure",
"biometrics", "pin", "biometrics_timeout" "biometrics", "pin", "biometrics_timeout"
}; };
@ -92,7 +92,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
spOpenPgp = view.findViewById(R.id.spOpenPgp); spOpenPgp = view.findViewById(R.id.spOpenPgp);
swEncrypt = view.findViewById(R.id.swEncrypt); swEncrypt = view.findViewById(R.id.swEncrypt);
swAutoDecrypt = view.findViewById(R.id.swAutoDecrypt); swAutoDecrypt = view.findViewById(R.id.swAutoDecrypt);
swNoHistory = view.findViewById(R.id.swNoHistory); swSecure = view.findViewById(R.id.swSecure);
btnBiometrics = view.findViewById(R.id.btnBiometrics); btnBiometrics = view.findViewById(R.id.btnBiometrics);
spBiometricsTimeout = view.findViewById(R.id.spBiometricsTimeout); spBiometricsTimeout = view.findViewById(R.id.spBiometricsTimeout);
btnPin = view.findViewById(R.id.btnPin); 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 @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { 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(); restart();
} }
}); });
@ -267,7 +267,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
swEncrypt.setChecked(prefs.getBoolean("encrypt_default", false)); swEncrypt.setChecked(prefs.getBoolean("encrypt_default", false));
swAutoDecrypt.setChecked(prefs.getBoolean("auto_decrypt", 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); boolean biometrics = prefs.getBoolean("biometrics", false);
btnBiometrics.setText(biometrics btnBiometrics.setText(biometrics

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

@ -329,7 +329,7 @@
<string name="title_advanced_display_hidden">Display hidden message texts</string> <string name="title_advanced_display_hidden">Display hidden message texts</string>
<string name="title_advanced_openpgp">OpenPGP provider</string> <string name="title_advanced_openpgp">OpenPGP provider</string>
<string name="title_advanced_auto_decrypt">Automatically decrypt messages</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_biometrics_timeout">Biometric authentication timeout</string>
<string name="title_advanced_pin">PIN</string> <string name="title_advanced_pin">PIN</string>

Loading…
Cancel
Save