Skip to content

Commit

Permalink
Merge pull request #812 from NWuensche/handleLongLines
Browse files Browse the repository at this point in the history
Pre-wrap Lines by default, setting to change to overflow
  • Loading branch information
tcitworld authored Aug 26, 2019
2 parents 27d64ce + 56c95e9 commit 72c47ed
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/src/main/assets/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/assets/solarized.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/java/fr/gaulupeau/apps/Poche/data/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@

<string name="pref_name_ui_article_textAlignment_justify">Textausrichtung: Blocksatz</string>
<string name="pref_desc_ui_article_textAlignment_justify">Streckt die Textzeilen, so dass jede Zeile die gleiche Breite hat (wie in Zeitungen)</string>
<string name="pref_name_ui_article_handlePreformattedText">Umgang mit langen Textzeilen</string>
<string name="pref_desc_ui_article_handlePreformattedText">Standardoption im Umgang mit vorformatiertem Text, welcher nicht vollständig auf das Display passt.</string>
<string-array name="pref_option_handlePreformattedText">
<item>Scroll innerhalb des Fensters (overflow)</item>
<item>Breche Zeilen um (pre-wrap)</item>
</string-array>
<string name="pref_name_ui_readingSpeed">Lesegeschwindigkeit</string>
<string name="pref_desc_ui_readingSpeed">Deine Lesegeschwindigkeit (gemessen in Wörtern pro Minute). Zum Berechnen der geschätzten Lesezeit genutzt.</string>
<string name="pref_name_ui_keepScreenOn">Bildschirm während Lesens anlassen</string>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="pref_option_handlePreformattedText_values" translatable="false">
<item>pre-overflow</item>
<item>pre-prewrap</item>
</string-array>
<string-array name="pref_option_readingSpeed_values" translatable="false">
<item>100</item>
<item>150</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings-preference-keys.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<string name="pref_key_ui_article_fontSize" translatable="false">ui.article.fontSize</string>
<string name="pref_key_ui_article_fontSerif" translatable="false">ui.article.fontSerif</string>
<string name="pref_key_ui_article_textAlignment_justify" translatable="false">ui.article.textAlignment.justify</string>
<string name="pref_key_ui_article_handlePreformattedText" translatable="false">ui.article.handlePreformattedText</string>
<string name="pref_key_ui_readingSpeed" translatable="false">ui.readingSpeed</string>
<string name="pref_key_ui_keepScreenOn" translatable="false">ui.keepScreenOn</string>
<string name="pref_key_ui_lists_sortOrder" translatable="false">ui.lists.sortOrder</string>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@
<string name="pref_desc_ui_article_fontSerif">Serif font for articles</string>
<string name="pref_name_ui_article_textAlignment_justify">Text alignment: Justify</string>
<string name="pref_desc_ui_article_textAlignment_justify">Stretches lines to equal width (like in newspapers)</string>
<string name="pref_name_ui_article_handlePreformattedText">Handling Long Preformatted Text</string>
<string name="pref_desc_ui_article_handlePreformattedText">How To handle preformatted text that is too long to show completely.</string>
<string-array name="pref_option_handlePreformattedText">
<item>Scroll inside window (overflow)</item>
<item>Break lines (pre-wrap)</item>
</string-array>
<string name="pref_name_ui_article_fullscreen">Fullscreen Article View</string>
<string name="pref_desc_ui_article_fullscreen">Hides system and app bars when reading articles</string>
<string name="pref_name_ui_readingSpeed">Reading speed</string>
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
<ListPreference
android:key="@string/pref_key_ui_article_handlePreformattedText"
android:title="@string/pref_name_ui_article_handlePreformattedText"
android:summary="@string/pref_desc_ui_article_handlePreformattedText"
android:dialogTitle="@string/pref_name_ui_article_handlePreformattedText"
android:entries="@array/pref_option_handlePreformattedText"
android:entryValues="@array/pref_option_handlePreformattedText_values"
android:defaultValue="pre-overflow"/>
<fr.gaulupeau.apps.Poche.ui.preferences.IntListPreference
android:key="@string/pref_key_ui_readingSpeed"
android:title="@string/pref_name_ui_readingSpeed"
Expand Down

0 comments on commit 72c47ed

Please sign in to comment.