mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 01:35:09 +01:00
Save reader progress when activity is paused
This commit is contained in:
parent
1978b9a62e
commit
14ec89f654
@ -493,6 +493,11 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
|
|||||||
please_wait.startAnimation(AnimationUtils.loadAnimation(this, R.anim.fade_in_long))
|
please_wait.startAnimation(AnimationUtils.loadAnimation(this, R.anim.fade_in_long))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
presenter.saveProgress()
|
||||||
|
super.onPause()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called from the presenter whenever a new [viewerChapters] have been set. It delegates the
|
* Called from the presenter whenever a new [viewerChapters] have been set. It delegates the
|
||||||
* method to the current viewer, but also set the subtitle on the toolbar.
|
* method to the current viewer, but also set the subtitle on the toolbar.
|
||||||
|
@ -391,6 +391,8 @@ class ReaderPresenter(
|
|||||||
saveChapterHistory(fromChapter)
|
saveChapterHistory(fromChapter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun saveProgress() = getCurrentChapter()?.let { onChapterChanged(it) }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves this [chapter] progress (last read page and whether it's read).
|
* Saves this [chapter] progress (last read page and whether it's read).
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user