Prevent crash

pull/212/head
M66B 2 years ago
parent 18926aeea5
commit 9b70485109

@ -639,6 +639,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
}
private void setOptions() {
try {
if (view == null || getContext() == null)
return;
@ -722,6 +723,9 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
swSwipeReply.setChecked(prefs.getBoolean("swipe_reply", false));
swMoveThreadSent.setChecked(prefs.getBoolean("move_thread_sent", false));
tvDefaultFolder.setText(prefs.getString("default_folder", null));
} catch (Throwable ex) {
Log.e(ex);
}
}
private void onDefaultFolder(Uri uri) {

@ -423,6 +423,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
}
private void setOptions() {
try {
if (view == null || getContext() == null)
return;
@ -463,6 +464,9 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
swSslHardenStrict.setEnabled(swSslHarden.isChecked());
swCertStrict.setChecked(prefs.getBoolean("cert_strict", !BuildConfig.PLAY_STORE_RELEASE));
swOpenSafe.setChecked(prefs.getBoolean("open_safe", false));
} catch (Throwable ex) {
Log.e(ex);
}
}
private static Intent getIntentConnectivity() {

@ -1394,6 +1394,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
private void setOptions() {
try {
if (view == null || getContext() == null)
return;
@ -1595,6 +1596,9 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swAuthenticationIndicator.setEnabled(swAuthentication.isChecked());
updateColor();
} catch (Throwable ex) {
Log.e(ex);
}
}
private void setNavigationBarColor(int color) {

@ -634,6 +634,7 @@ public class FragmentOptionsEncryption extends FragmentBase
}
private void setOptions() {
try {
if (view == null || getContext() == null)
return;
@ -677,6 +678,9 @@ public class FragmentOptionsEncryption extends FragmentBase
}
swCheckCertificate.setChecked(prefs.getBoolean("check_certificate", true));
} catch (Throwable ex) {
Log.e(ex);
}
}
private void testOpenPgp(String pkg) {

@ -1085,7 +1085,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
sbOpenAiTemperature.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
prefs.edit().putFloat("openai_temperature", progress / 10f).apply();
prefs.edit().putFloat("openai_temperature", (float) progress / 10f).apply();
}
@Override
@ -2320,6 +2320,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
private void setOptions() {
try {
if (view == null || getContext() == null)
return;
@ -2517,6 +2518,9 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
cursorWindowSize == null ? "?" : Helper.humanReadableByteCount(cursorWindowSize, false)));
cardDebug.setVisibility(swDebug.isChecked() || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
} catch (Throwable ex) {
Log.e(ex);
}
}
private void updateUsage() {

@ -801,6 +801,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
}
private void setOptions() {
try {
if (view == null || getContext() == null)
return;
@ -846,6 +847,9 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
swAlertOnce.setChecked(!prefs.getBoolean("alert_once", true));
enableOptions();
} catch (Throwable ex) {
Log.e(ex);
}
}
private void enableOptions() {

@ -550,6 +550,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
}
private void setOptions() {
try {
if (view == null || getContext() == null)
return;
@ -613,5 +614,8 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
String mnemonic = prefs.getString("wipe_mnemonic", null);
swMnemonic.setChecked(mnemonic != null);
tvMnemonic.setText(mnemonic);
} catch (Throwable ex) {
Log.e(ex);
}
}
}

@ -722,6 +722,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
}
private void setOptions() {
try {
if (view == null || getContext() == null)
return;
@ -823,6 +824,9 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
swReplyMove.setChecked(prefs.getBoolean("reply_move", false));
swReplyMoveInbox.setChecked(prefs.getBoolean("reply_move_inbox", true));
swReplyMoveInbox.setEnabled(swReplyMove.isChecked());
} catch (Throwable ex) {
Log.e(ex);
}
}
@Override

@ -594,6 +594,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
}
private void setOptions() {
try {
if (view == null || getContext() == null)
return;
@ -665,6 +666,9 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
swUseBlocklistPop.setChecked(prefs.getBoolean("use_blocklist_pop", false));
swUseBlocklistPop.setEnabled(swCheckBlocklist.isChecked());
rvBlocklist.setAlpha(swCheckBlocklist.isChecked() ? 1.0f : Helper.LOW_LIGHT);
} catch (Throwable ex) {
Log.e(ex);
}
}
public static class TimePickerFragment extends FragmentDialogBase implements TimePickerDialog.OnTimeSetListener {

Loading…
Cancel
Save