Skip to content

Commit 95d7542

Browse files
author
shebyimran@gmail.com
committed
added settings option for auto fullscreen
1 parent 767a183 commit 95d7542

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

app/src/main/java/fr/gaulupeau/apps/Poche/data/Settings.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,10 @@ public boolean isFullscreenArticleView() {
368368
return getBoolean(R.string.pref_key_ui_article_fullscreen, false);
369369
}
370370

371+
public boolean isAutoFullscreenArticleView() {
372+
return getBoolean(R.string.pref_key_ui_article_fullscreen_auto, true);
373+
}
374+
371375
public void setFullScreenArticleView(boolean value) {
372376
setBoolean(R.string.pref_key_ui_article_fullscreen, value);
373377
}

app/src/main/java/fr/gaulupeau/apps/Poche/ui/ReadArticleActivity.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ public void onCreate(Bundle savedInstanceState) {
220220

221221
// Hide status and action bar when scrolling down, show when scrolling up
222222
// TODO: change to a method compatible with API 14.
223-
// TODO: Maybe implement an option in the settings menu to enable this?
224-
if (Build.VERSION.SDK_INT >= 23) {
223+
if (Build.VERSION.SDK_INT >= 23 && settings.isAutoFullscreenArticleView()) {
225224
scrollView.setOnScrollChangeListener(new View.OnScrollChangeListener(){
226225
@Override
227226
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {

app/src/main/res/values/strings-preference-keys.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<string name="pref_key_ui_screenScrolling_smooth" translatable="false">ui.screenScrolling.smooth</string>
3636
<string name="pref_key_ui_misc_category" translatable="false">ui.misc.category</string>
3737
<string name="pref_key_ui_article_fullscreen" translatable="false">ui.article.fullscreen</string>
38+
<string name="pref_key_ui_article_fullscreen_auto" translatable="false">ui.article.fullscreen_auto</string>
3839
<string name="pref_key_ui_disableTouch_enabled" translatable="false">ui.disableTouch.enabled</string>
3940
<string name="pref_key_ui_disableTouch_lastState" translatable="false">ui.disableTouch.lastState</string>
4041
<string name="pref_key_ui_disableTouch_keyCode" translatable="false">ui.disableTouch.keyCode</string>

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@
198198
<string name="pref_desc_ui_article_textAlignment_justify">Stretches lines to equal width (like in newspapers)</string>
199199
<string name="pref_name_ui_article_fullscreen">Fullscreen Article View</string>
200200
<string name="pref_desc_ui_article_fullscreen">Hides system and app bars when reading articles</string>
201+
<string name="pref_name_ui_article_fullscreen_auto">Fullscreen Article View on Scroll</string>
202+
<string name="pref_desc_ui_article_fullscreen_auto">Hides/Shows system and app bars automatically scroll. Only works on Android 6.0 and above.</string>
201203
<string name="pref_name_ui_readingSpeed">Reading speed</string>
202204
<string name="pref_desc_ui_readingSpeed">Your reading speed (measured in words per minute). Used to calculate estimated reading time.</string>
203205
<string name="pref_name_ui_keepScreenOn">Keep screen on while reading</string>

app/src/main/res/xml/preferences.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@
150150
android:title="@string/pref_name_ui_article_fullscreen"
151151
android:summary="@string/pref_desc_ui_article_fullscreen"
152152
android:defaultValue="false"/>
153+
<CheckBoxPreference
154+
android:key="@string/pref_key_ui_article_fullscreen_auto"
155+
android:title="@string/pref_name_ui_article_fullscreen_auto"
156+
android:summary="@string/pref_desc_ui_article_fullscreen_auto"
157+
android:defaultValue="true"/>
153158
<CheckBoxPreference
154159
android:key="@string/pref_key_ui_disableTouch_enabled"
155160
android:title="@string/pref_name_ui_disableTouch_enabled"

0 commit comments

Comments
 (0)