Save reader progress when activity is paused (#7121)
(cherry picked from commit f1ab34e27cbd8f26f87e34238af0863d4650b960) (cherry picked from commit 93226248865ea8d32324189cd5a25afc4e717739)
This commit is contained in:
parent
3ec11cb81f
commit
9e31806e5c
@ -324,6 +324,11 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
|
||||
super.onSaveInstanceState(outState)
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
presenter.saveProgress()
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
/**
|
||||
* Set menu visibility again on activity resume to apply immersive mode again if needed.
|
||||
* Helps with rotations.
|
||||
|
@ -558,6 +558,10 @@ class ReaderPresenter(
|
||||
}
|
||||
}
|
||||
|
||||
fun saveProgress() {
|
||||
getCurrentChapter()?.let { onChapterChanged(it) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from the activity to preload the given [chapter].
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user