diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 1c79c0785e..9c45818e03 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -284,6 +284,7 @@ public class AdapterMessage extends RecyclerView.Adapter= Build.VERSION_CODES.TIRAMISU) { - tvBody.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL_FAST); - tvBody.setBreakStrategy(LineBreaker.BREAK_STRATEGY_HIGH_QUALITY); + if (hyphenation && + Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) + tvBody.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NORMAL); // Default before Q + else + tvBody.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) + tvBody.setBreakStrategy(LineBreaker.BREAK_STRATEGY_HIGH_QUALITY); } wvBody = vsBody.findViewById(R.id.wvBody); pbBody = vsBody.findViewById(R.id.pbBody); @@ -7036,6 +7041,7 @@ public class AdapterMessage extends RecyclerView.Adapter adapterView, View view, int position, long id) { @@ -1457,6 +1467,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swOverrideWidth.setChecked(prefs.getBoolean("override_width", false)); swContrast.setChecked(prefs.getBoolean("contrast", false)); + swHyphenation.setChecked(prefs.getBoolean("hyphenation", false)); String display_font = prefs.getString("display_font", ""); List fonts = StyleHelper.getFonts(getContext()); diff --git a/app/src/main/res/layout/fragment_options_display.xml b/app/src/main/res/layout/fragment_options_display.xml index c576f3ec47..794247a3fa 100644 --- a/app/src/main/res/layout/fragment_options_display.xml +++ b/app/src/main/res/layout/fragment_options_display.xml @@ -1656,6 +1656,17 @@ app:layout_constraintTop_toBottomOf="@id/tvOverrideWidthHint" app:switchPadding="12dp" /> + + + app:layout_constraintTop_toBottomOf="@id/swHyphenation" /> Default message text zoom: %1$s %% Zoom original messages to fit the screen Disable fixed widths in original messages + Use automatic hyphenation Use high contrast for message text Use monospaced font for message text by default Use monospaced font for preformatted text