Removed override width

This commit is contained in:
M66B 2023-07-14 15:26:04 +02:00
parent 045d961e9d
commit f3f640e0fa
6 changed files with 8 additions and 50 deletions

View File

@ -3127,10 +3127,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
HtmlHelper.highlightSearched(context, document, searched);
boolean overview_mode = prefs.getBoolean("overview_mode", false);
boolean override_width = prefs.getBoolean("override_width", false);
HtmlHelper.setViewport(document, overview_mode);
if (override_width)
HtmlHelper.overrideWidth(document);
if (inline || show_images)
HtmlHelper.embedInlineImages(context, message.id, document, show_images);
@ -4550,9 +4547,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
popupMenu.getMenu().add(Menu.NONE, R.string.title_fit_width, 2, R.string.title_fit_width)
.setCheckable(true)
.setChecked(prefs.getBoolean("overview_mode", false));
popupMenu.getMenu().add(Menu.NONE, R.string.title_disable_widths, 3, R.string.title_disable_widths)
.setCheckable(true)
.setChecked(prefs.getBoolean("override_width", false));
popupMenu.getMenu().add(Menu.NONE, R.string.title_monospaced_pre, 4, R.string.title_monospaced_pre)
.setCheckable(true)
.setChecked(prefs.getBoolean("monospaced_pre", false));
@ -4565,15 +4559,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
onActionOpenFull(message);
return true;
} else if (itemId == R.string.title_fit_width ||
itemId == R.string.title_disable_widths ||
itemId == R.string.title_monospaced_pre) {
boolean enabled = !item.isChecked();
item.setChecked(enabled);
if (itemId == R.string.title_fit_width)
prefs.edit().putBoolean("overview_mode", enabled).apply();
else if (itemId == R.string.title_disable_widths)
prefs.edit().putBoolean("override_width", enabled).apply();
else if (itemId == R.string.title_monospaced_pre)
prefs.edit().putBoolean("monospaced_pre", enabled).apply();
@ -7234,10 +7225,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (BuildConfig.DEBUG) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean overview_mode = prefs.getBoolean("overview_mode", false);
boolean override_width = prefs.getBoolean("override_width", false);
HtmlHelper.setViewport(d, overview_mode);
if (override_width)
HtmlHelper.overrideWidth(d);
}
d.head().prependElement("meta").attr("charset", "utf-8");

View File

@ -725,6 +725,11 @@ public class ApplicationEx extends Application
if (thread_sent_trash)
editor.putBoolean("move_thread_sent", true);
editor.remove("thread_sent_trash");
} else if (version < 2086) {
boolean override_width = prefs.getBoolean("override_width", false);
if (override_width)
editor.putBoolean("overview_mode", true);
editor.remove("override_width");
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG)

View File

@ -145,7 +145,7 @@ public class FragmentOptions extends FragmentBase {
"font_size_sender", "sender_ellipsize",
"subject_top", "subject_italic", "highlight_subject", "font_size_subject", "subject_ellipsize",
"keywords_header", "labels_header", "flags", "flags_background", "preview", "preview_italic", "preview_lines", "align_header",
"message_zoom", "overview_mode", "override_width", "addresses", "button_extra", "attachments_alt", "thumbnails",
"message_zoom", "overview_mode", "addresses", "button_extra", "attachments_alt", "thumbnails",
"contrast", "hyphenation", "display_font", "monospaced_pre",
"list_count", "bundled_fonts", "parse_classes",
"background_color", "text_color", "text_size", "text_font", "text_align", "text_titles", "text_separators",

View File

@ -164,7 +164,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private TextView tvMessageZoom;
private SeekBar sbMessageZoom;
private SwitchCompat swOverviewMode;
private SwitchCompat swOverrideWidth;
private SwitchCompat swContrast;
private SwitchCompat swHyphenation;
@ -214,7 +213,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
"keywords_header", "labels_header", "flags", "flags_background",
"preview", "preview_italic", "preview_lines", "align_header",
"addresses", "hide_attachments",
"message_zoom", "overview_mode", "override_width",
"message_zoom", "overview_mode",
"hyphenation", "display_font", "contrast", "monospaced_pre",
"text_separators",
"collapse_quotes", "image_placeholders", "inline_images", "button_extra",
@ -333,7 +332,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
tvMessageZoom = view.findViewById(R.id.tvMessageZoom);
sbMessageZoom = view.findViewById(R.id.sbMessageZoom);
swOverviewMode = view.findViewById(R.id.swOverviewMode);
swOverrideWidth = view.findViewById(R.id.swOverrideWidth);
swContrast = view.findViewById(R.id.swContrast);
swHyphenation = view.findViewById(R.id.swHyphenation);
tvHyphenationHint = view.findViewById(R.id.tvHyphenationHint);
@ -1185,13 +1183,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swOverrideWidth.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("override_width", checked).apply();
}
});
swContrast.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -1589,7 +1580,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
sbMessageZoom.setProgress(message_zoom - 50);
swOverviewMode.setChecked(prefs.getBoolean("overview_mode", false));
swOverrideWidth.setChecked(prefs.getBoolean("override_width", false));
swContrast.setChecked(prefs.getBoolean("contrast", false));
swHyphenation.setChecked(prefs.getBoolean("hyphenation", false));

View File

@ -1755,29 +1755,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swOverviewMode" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swOverrideWidth"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_override_width"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOverViewModeHint"
app:switchPadding="12dp" />
<TextView
android:id="@+id/tvOverrideWidthHint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_override_width_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swOverrideWidth" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swContrast"
android:layout_width="0dp"
@ -1786,7 +1763,7 @@
android:text="@string/title_advanced_contrast"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOverrideWidthHint"
app:layout_constraintTop_toBottomOf="@id/tvOverViewModeHint"
app:switchPadding="12dp" />
<TextView

View File

@ -614,7 +614,6 @@
<string name="title_advanced_thumbnails">Show image thumbnails after the message text</string>
<string name="title_advanced_message_text_zoom2">Default message text zoom: %1$s %%</string>
<string name="title_advanced_overview_mode">Zoom original messages to fit the screen</string>
<string name="title_advanced_override_width">Disable fixed widths in original messages</string>
<string name="title_advanced_hyphenation">Use automatic hyphenation</string>
<string name="title_advanced_contrast">Use high contrast for message text</string>
<string name="title_advanced_monospaced">Use monospaced font for message text by default</string>
@ -985,7 +984,6 @@
<string name="title_advanced_preview_lines_hint">Maximum %s characters in total</string>
<string name="title_advanced_preview_issue">Scrolling can be slow due to a bug in some Android versions when the number of lines is more than one</string>
<string name="title_advanced_overview_mode_hint">This can result in very small fonts</string>
<string name="title_advanced_override_width_hint">This can make messages narrower, but also look strange</string>
<string name="title_advanced_monospaced_pre_hint">Plain text only messages will be considered as preformatted</string>
<string name="title_advanced_placeholders_hint">This applies to reformatted messages only</string>
<string name="title_advanced_inline_hint">Inline images are images included in the message</string>