This should fix #144.
This commit is contained in:
parent
686ec5dd90
commit
059c2991fb
@ -25,6 +25,8 @@ import retrofit2.Response
|
|||||||
|
|
||||||
class ReaderActivity : AppCompatActivity() {
|
class ReaderActivity : AppCompatActivity() {
|
||||||
|
|
||||||
|
private var markOnScroll: Boolean = false
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
Scoop.getInstance().apply(this)
|
Scoop.getInstance().apply(this)
|
||||||
@ -39,7 +41,7 @@ class ReaderActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
val debugReadingItems = sharedPref.getBoolean("read_debug", false)
|
val debugReadingItems = sharedPref.getBoolean("read_debug", false)
|
||||||
val userIdentifier = sharedPref.getString("unique_id", "")
|
val userIdentifier = sharedPref.getString("unique_id", "")
|
||||||
val markOnScroll = sharedPref.getBoolean("mark_on_scroll", false)
|
markOnScroll = sharedPref.getBoolean("mark_on_scroll", false)
|
||||||
|
|
||||||
if (allItems.isEmpty()) {
|
if (allItems.isEmpty()) {
|
||||||
Crashlytics.setUserIdentifier(userIdentifier)
|
Crashlytics.setUserIdentifier(userIdentifier)
|
||||||
@ -130,12 +132,14 @@ class ReaderActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
super.onPause()
|
super.onPause()
|
||||||
pager.clearOnPageChangeListeners()
|
if (markOnScroll) {
|
||||||
|
pager.clearOnPageChangeListeners()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStop() {
|
override fun onSaveInstanceState(oldInstanceState: Bundle?) {
|
||||||
super.onStop()
|
super.onSaveInstanceState(oldInstanceState)
|
||||||
allItems = ArrayList()
|
oldInstanceState!!.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
private inner class ScreenSlidePagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) {
|
private inner class ScreenSlidePagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) {
|
||||||
|
Loading…
Reference in New Issue
Block a user