Added setting to enable/disable the mark on swipe.

This commit is contained in:
Amine Bou 2017-12-05 21:40:54 +01:00
parent 297f797b97
commit 9458b1834b
4 changed files with 48 additions and 40 deletions

View File

@ -10,6 +10,8 @@
- Toolbar in reader activity.
- Marking items as read on scroll (with settings to enable/disable).
**1.5.4.22**
- You can now scroll through the loaded articles !

View File

@ -41,6 +41,7 @@ class ReaderActivity : AppCompatActivity() {
val debugReadingItems = sharedPref.getBoolean("read_debug", false)
val userIdentifier = sharedPref.getString("unique_id", "")
val markOnScroll = sharedPref.getBoolean("mark_on_scroll", false)
val api = SelfossApi(
this,
@ -59,6 +60,7 @@ class ReaderActivity : AppCompatActivity() {
pager.setPageTransformer(true, DepthPageTransformer())
(indicator as CircleIndicator).setViewPager(pager)
if (markOnScroll) {
pager.addOnPageChangeListener(object : ViewPager.SimpleOnPageChangeListener() {
var isLastItem = false
@ -101,8 +103,7 @@ class ReaderActivity : AppCompatActivity() {
}
}
})
}
}
override fun onPause() {

View File

@ -161,4 +161,5 @@
<string name="reader_action_more">Read more</string>
<string name="reader_action_open">Open in browser</string>
<string name="reader_action_share">Share</string>
<string name="pref_switch_actions_pager_scroll">Mark articles as read when scrolling between articles.</string>
</resources>

View File

@ -81,5 +81,9 @@
android:summaryOff="@string/pref_switch_actions_tap_off"
android:summaryOn="@string/pref_switch_actions_tap_on"
android:title="@string/pref_switch_actions_tap_title" />
<SwitchPreference
android:defaultValue="false"
android:key="mark_on_scroll"
android:title="@string/pref_switch_actions_pager_scroll" />
</PreferenceScreen>