Debug: ignore formatted size

This commit is contained in:
M66B
2024-04-22 07:28:43 +02:00
parent 9ce09e3e72
commit b97ae1882c
4 changed files with 30 additions and 1 deletions

View File

@@ -190,6 +190,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swBrowserZoom;
private SwitchCompat swFakeDark;
private EditText etViewportHeight;
private SwitchCompat swIgnoreFormattedSize;
private SwitchCompat swShowRecent;
private SwitchCompat swModSeq;
private SwitchCompat swPreamble;
@@ -283,6 +284,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"chunk_size", "thread_range",
"autoscroll_editor", "undo_manager",
"browser_zoom", "fake_dark",
"ignore_formatted_size",
"show_recent",
"use_modseq", "preamble", "uid_command", "perform_expunge", "uid_expunge",
"auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "use_top", "forget_top",
@@ -433,6 +435,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swBrowserZoom = view.findViewById(R.id.swBrowserZoom);
swFakeDark = view.findViewById(R.id.swFakeDark);
etViewportHeight = view.findViewById(R.id.etViewportHeight);
swIgnoreFormattedSize = view.findViewById(R.id.swIgnoreFormattedSize);
swShowRecent = view.findViewById(R.id.swShowRecent);
swModSeq = view.findViewById(R.id.swModSeq);
swPreamble = view.findViewById(R.id.swPreamble);
@@ -1339,6 +1342,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
swIgnoreFormattedSize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("ignore_formatted_size", checked).apply();
}
});
swShowRecent.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -2363,6 +2373,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
etViewportHeight.setText(Integer.toString(vh));
} else
etViewportHeight.setText(null);
swIgnoreFormattedSize.setChecked(prefs.getBoolean("ignore_formatted_size", false));
swShowRecent.setChecked(prefs.getBoolean("show_recent", false));
swModSeq.setChecked(prefs.getBoolean("use_modseq", true));
swPreamble.setChecked(prefs.getBoolean("preamble", false));

View File

@@ -449,6 +449,11 @@ public class HtmlHelper {
}
private static int getMaxFormatTextSize(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean ignore_formatted_size = prefs.getBoolean("ignore_formatted_size", false);
if (ignore_formatted_size)
return Integer.MAX_VALUE;
ActivityManager am = Helper.getSystemService(context, ActivityManager.class);
int mc = am.getMemoryClass();
if (mc >= 256)