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)

View File

@ -1275,6 +1275,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvViewportHeight" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swIgnoreFormattedSize"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_ignore_formatted_size"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etViewportHeight"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swShowRecent"
android:layout_width="0dp"
@ -1284,7 +1296,7 @@
android:text="@string/title_advanced_show_recent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etViewportHeight"
app:layout_constraintTop_toBottomOf="@id/swIgnoreFormattedSize"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat

View File

@ -933,6 +933,7 @@
<string name="title_advanced_browser_zoom" translatable="false">Use browser zoom</string>
<string name="title_advanced_fake_dark" translatable="false">Fake dark</string>
<string name="title_advanced_viewport_height" translatable="false">Viewport height</string>
<string name="title_advanced_ignore_formatted_size" translatable="false">Ignore formatted size</string>
<string name="title_advanced_show_recent" translatable="false">Show recent flag</string>
<string name="title_advanced_modseq" translatable="false">MODSEQ</string>
<string name="title_advanced_preamble" translatable="false">Preamble</string>