mirror of
https://github.com/beemdevelopment/Aegis
synced 2024-09-06 16:03:30 +00:00
Rename some things related to plaintext backup warning
This commit is contained in:
parent
681326839c
commit
c58b773878
|
@ -7,8 +7,6 @@ import android.net.Uri;
|
|||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import com.beemdevelopment.aegis.ui.views.EntryHolder;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.beemdevelopment.aegis.util.JsonUtils;
|
||||
|
@ -376,26 +374,20 @@ public class Preferences {
|
|||
}
|
||||
|
||||
public void setIsPlaintextBackupWarningNeeded(boolean needed) {
|
||||
if (isPlaintextBackupWarningNeeded() != needed) {
|
||||
_prefs.edit().putBoolean("pref_plaintext_backup_warning_needed", needed).apply();
|
||||
}
|
||||
_prefs.edit().putBoolean("pref_plaintext_backup_warning_needed", needed).apply();
|
||||
}
|
||||
|
||||
public boolean isPlaintextBackupWarningNeeded() {
|
||||
if (canShowPlaintextBackupWarning()) {
|
||||
return _prefs.getBoolean("pref_plaintext_backup_warning_needed", false);
|
||||
}
|
||||
return false;
|
||||
return !isPlaintextBackupWarningDisabled()
|
||||
&& _prefs.getBoolean("pref_plaintext_backup_warning_needed", false);
|
||||
}
|
||||
|
||||
public void setCanShowPlaintextBackupWarning(boolean canShow) {
|
||||
if (canShowPlaintextBackupWarning() != canShow) {
|
||||
_prefs.edit().putBoolean("pref_can_show_plaintext_backup_warning", canShow).apply();
|
||||
}
|
||||
public void setIsPlaintextBackupWarningDisabled(boolean disabled) {
|
||||
_prefs.edit().putBoolean("pref_plaintext_backup_warning_disabled", disabled).apply();
|
||||
}
|
||||
|
||||
public boolean canShowPlaintextBackupWarning() {
|
||||
return _prefs.getBoolean("pref_can_show_plaintext_backup_warning", true);
|
||||
public boolean isPlaintextBackupWarningDisabled() {
|
||||
return _prefs.getBoolean("pref_plaintext_backup_warning_disabled", false);
|
||||
}
|
||||
|
||||
public boolean isPinKeyboardEnabled() {
|
||||
|
|
|
@ -825,7 +825,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
}
|
||||
|
||||
private void showPlaintextExportWarningOptions() {
|
||||
View view = LayoutInflater.from(this).inflate(R.layout.dialog_plaintext_warning_options, null);
|
||||
View view = LayoutInflater.from(this).inflate(R.layout.dialog_plaintext_warning, null);
|
||||
|
||||
AlertDialog dialog = new AlertDialog.Builder(this)
|
||||
.setTitle(R.string.backup_plaintext_export_warning)
|
||||
|
@ -834,7 +834,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.create();
|
||||
|
||||
CheckBox checkBox = view.findViewById(R.id.checkbox_dont_show_plaintext_warning_again);
|
||||
CheckBox checkBox = view.findViewById(R.id.checkbox_plaintext_warning);
|
||||
checkBox.setChecked(false);
|
||||
|
||||
dialog.setOnShowListener(d -> {
|
||||
|
@ -843,7 +843,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
btnPos.setOnClickListener(l -> {
|
||||
dialog.dismiss();
|
||||
|
||||
_prefs.setCanShowPlaintextBackupWarning(!checkBox.isChecked());
|
||||
_prefs.setIsPlaintextBackupWarningDisabled(checkBox.isChecked());
|
||||
_prefs.setIsPlaintextBackupWarningNeeded(false);
|
||||
|
||||
updateErrorBar();
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
android:text="@string/backup_plaintext_warning_explanation" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkbox_dont_show_plaintext_warning_again"
|
||||
android:id="@+id/checkbox_plaintext_warning"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
Loading…
Reference in a new issue