diff --git a/app/src/main/assets/dark.css b/app/src/main/assets/dark.css index cc300f351..606069a00 100755 --- a/app/src/main/assets/dark.css +++ b/app/src/main/assets/dark.css @@ -237,6 +237,14 @@ header.mbm { text-justify: none; } +.pre-overflow #article pre { + overflow: auto; +} + +.pre-prewrap #article pre { + white-space: pre-wrap; +} + #article blockquote *, #article pre * { background: inherit; } diff --git a/app/src/main/assets/main.css b/app/src/main/assets/main.css index d46ea66f1..7d9a0b873 100755 --- a/app/src/main/assets/main.css +++ b/app/src/main/assets/main.css @@ -226,6 +226,14 @@ header.mbm { text-justify: none; } +.pre-overflow #article pre { + overflow: auto; +} + +.pre-prewrap #article pre { + white-space: pre-wrap; +} + #article blockquote *, #article pre * { background: inherit; } diff --git a/app/src/main/assets/solarized.css b/app/src/main/assets/solarized.css index 8b4df51dd..065d4c373 100755 --- a/app/src/main/assets/solarized.css +++ b/app/src/main/assets/solarized.css @@ -241,6 +241,14 @@ header.mbm { text-justify: none; } +.pre-overflow #article pre { + overflow: auto; +} + +.pre-prewrap #article pre { + white-space: pre-wrap; +} + #article blockquote *, #article pre * { background: inherit; } diff --git a/app/src/main/java/fr/gaulupeau/apps/Poche/data/Settings.java b/app/src/main/java/fr/gaulupeau/apps/Poche/data/Settings.java index 20df8fe1b..56b7241d3 100644 --- a/app/src/main/java/fr/gaulupeau/apps/Poche/data/Settings.java +++ b/app/src/main/java/fr/gaulupeau/apps/Poche/data/Settings.java @@ -364,6 +364,14 @@ public void setArticleTextAlignmentJustify(boolean value) { setBoolean(R.string.pref_key_ui_article_textAlignment_justify, value); } + public String getHandlePreformattedTextOption() { + return getString(R.string.pref_key_ui_article_handlePreformattedText, "pre-overflow"); + } + + public void setHandlePreformattedTextOption(String value) { + setString(R.string.pref_key_ui_article_handlePreformattedText, value); + } + public boolean isFullscreenArticleView() { return getBoolean(R.string.pref_key_ui_article_fullscreen, false); } diff --git a/app/src/main/java/fr/gaulupeau/apps/Poche/ui/ReadArticleActivity.java b/app/src/main/java/fr/gaulupeau/apps/Poche/ui/ReadArticleActivity.java index a5fe772bc..a8b1ac557 100644 --- a/app/src/main/java/fr/gaulupeau/apps/Poche/ui/ReadArticleActivity.java +++ b/app/src/main/java/fr/gaulupeau/apps/Poche/ui/ReadArticleActivity.java @@ -689,6 +689,7 @@ private String getHtmlPage() { if(weightedFont) additionalClasses.add("weighted-font"); if(settings.isArticleFontSerif()) additionalClasses.add("serif-font"); if(settings.isArticleTextAlignmentJustify()) additionalClasses.add("text-align-justify"); + additionalClasses.add(settings.getHandlePreformattedTextOption()); String classAttr; if(!additionalClasses.isEmpty()) { diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 267bec43a..150b9c48f 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -246,6 +246,12 @@ Textausrichtung: Blocksatz Streckt die Textzeilen, so dass jede Zeile die gleiche Breite hat (wie in Zeitungen) + Umgang mit langen Textzeilen + Standardoption im Umgang mit vorformatiertem Text, welcher nicht vollständig auf das Display passt. + + Scroll innerhalb des Fensters (overflow) + Breche Zeilen um (pre-wrap) + Lesegeschwindigkeit Deine Lesegeschwindigkeit (gemessen in Wörtern pro Minute). Zum Berechnen der geschätzten Lesezeit genutzt. Bildschirm während Lesens anlassen diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index d20ae84c7..7eb65fad1 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -1,5 +1,9 @@ + + pre-overflow + pre-prewrap + 100 150 diff --git a/app/src/main/res/values/strings-preference-keys.xml b/app/src/main/res/values/strings-preference-keys.xml index 19abe2b53..8a15e1233 100644 --- a/app/src/main/res/values/strings-preference-keys.xml +++ b/app/src/main/res/values/strings-preference-keys.xml @@ -23,6 +23,7 @@ ui.article.fontSize ui.article.fontSerif ui.article.textAlignment.justify + ui.article.handlePreformattedText ui.readingSpeed ui.keepScreenOn ui.lists.sortOrder diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 70fdcff18..e9d10989b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -204,6 +204,12 @@ Serif font for articles Text alignment: Justify Stretches lines to equal width (like in newspapers) + Handling Long Preformatted Text + How To handle preformatted text that is too long to show completely. + + Scroll inside window (overflow) + Break lines (pre-wrap) + Fullscreen Article View Hides system and app bars when reading articles Reading speed diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index a9807368d..fc7bbef49 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -104,6 +104,14 @@ android:title="@string/pref_name_ui_article_textAlignment_justify" android:summary="@string/pref_desc_ui_article_textAlignment_justify" android:defaultValue="true"/> +