Fix n/p chapters strings + action for n/p chapter

This commit is contained in:
Jays2Kings 2021-03-30 22:51:38 -04:00
parent 4999231dfc
commit d0738f5b00
2 changed files with 28 additions and 2 deletions

View File

@ -357,6 +357,22 @@ class ReaderActivity :
} }
} }
binding.readerNav.leftChapter.setOnClickListener {
if (viewer is R2LPagerViewer) {
presenter.loadNextChapter()
} else {
presenter.loadPreviousChapter()
}
}
binding.readerNav.rightChapter.setOnClickListener {
if (viewer !is R2LPagerViewer) {
presenter.loadNextChapter()
} else {
presenter.loadPreviousChapter()
}
}
// Init listeners on bottom menu // Init listeners on bottom menu
binding.readerNav.pageSeekbar.setOnSeekBarChangeListener( binding.readerNav.pageSeekbar.setOnSeekBarChangeListener(
object : SimpleSeekBarListener() { object : SimpleSeekBarListener() {
@ -511,6 +527,16 @@ class ReaderActivity :
viewer = newViewer viewer = newViewer
binding.viewerContainer.addView(newViewer.getView()) binding.viewerContainer.addView(newViewer.getView())
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (newViewer is R2LPagerViewer) {
binding.readerNav.leftChapter.tooltipText = getString(R.string.next_chapter)
binding.readerNav.rightChapter.tooltipText = getString(R.string.previous_chapter)
} else {
binding.readerNav.leftChapter.tooltipText = getString(R.string.previous_chapter)
binding.readerNav.rightChapter.tooltipText = getString(R.string.next_chapter)
}
}
binding.navigationOverlay.isLTR = !(viewer is L2RPagerViewer) binding.navigationOverlay.isLTR = !(viewer is L2RPagerViewer)
binding.viewerContainer.setBackgroundColor( binding.viewerContainer.setBackgroundColor(
if (viewer is WebtoonViewer) { if (viewer is WebtoonViewer) {

View File

@ -303,8 +303,8 @@
<string name="webtoon_style">webtoon style</string> <string name="webtoon_style">webtoon style</string>
<string name="next_page">Next page</string> <string name="next_page">Next page</string>
<string name="previous_page">Previous page</string> <string name="previous_page">Previous page</string>
<string name="next_chapter">Next page</string> <string name="next_chapter">Next chapter</string>
<string name="previous_chapter">Previous page</string> <string name="previous_chapter">Previous chapter</string>
<!-- Reader settings --> <!-- Reader settings -->
<string name="fullscreen">Fullscreen</string> <string name="fullscreen">Fullscreen</string>