Fixed typo in reader chapter sheet

This commit is contained in:
Jay 2020-05-08 15:15:50 -04:00
parent 27b68f5afb
commit 8986de3db4
2 changed files with 5 additions and 5 deletions

View file

@ -557,13 +557,13 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
if (config?.showNewChapter == false) { if (config?.showNewChapter == false) {
systemUi?.show() systemUi?.show()
} }
} else if (chapters_bottom_sheet.shouldCollaspe && chapters_bottom_sheet.sheetBehavior.isExpanded()) { } else if (chapters_bottom_sheet.shouldCollapse && chapters_bottom_sheet.sheetBehavior.isExpanded()) {
chapters_bottom_sheet.sheetBehavior?.collapse() chapters_bottom_sheet.sheetBehavior?.collapse()
} }
if (chapters_bottom_sheet.selectedChapterId != page.chapter.chapter.id) { if (chapters_bottom_sheet.selectedChapterId != page.chapter.chapter.id) {
chapters_bottom_sheet.refreshList() chapters_bottom_sheet.refreshList()
} }
chapters_bottom_sheet.shouldCollaspe = true chapters_bottom_sheet.shouldCollapse = true
// Set seekbar progress // Set seekbar progress
page_seekbar.max = pages.lastIndex page_seekbar.max = pages.lastIndex

View file

@ -32,7 +32,7 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr
lateinit var presenter: ReaderPresenter lateinit var presenter: ReaderPresenter
var adapter: FastAdapter<ReaderChapterItem>? = null var adapter: FastAdapter<ReaderChapterItem>? = null
private val itemAdapter = ItemAdapter<ReaderChapterItem>() private val itemAdapter = ItemAdapter<ReaderChapterItem>()
var shouldCollaspe = true var shouldCollapse = true
var selectedChapterId = -1L var selectedChapterId = -1L
fun setup(activity: ReaderActivity) { fun setup(activity: ReaderActivity) {
@ -68,7 +68,7 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr
override fun onStateChanged(p0: View, state: Int) { override fun onStateChanged(p0: View, state: Int) {
if (state == BottomSheetBehavior.STATE_COLLAPSED) { if (state == BottomSheetBehavior.STATE_COLLAPSED) {
shouldCollaspe = true shouldCollapse = true
sheetBehavior?.isHideable = false sheetBehavior?.isHideable = false
(chapter_recycler.layoutManager as LinearLayoutManager).scrollToPositionWithOffset( (chapter_recycler.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(
adapter?.getPosition(presenter.getCurrentChapter()?.chapter?.id ?: 0L) ?: 0, adapter?.getPosition(presenter.getCurrentChapter()?.chapter?.id ?: 0L) ?: 0,
@ -86,7 +86,7 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr
chapter_recycler.adapter = adapter chapter_recycler.adapter = adapter
adapter?.onClickListener = { _, _, item, _ -> adapter?.onClickListener = { _, _, item, _ ->
if (item.chapter.id != presenter.getCurrentChapter()?.chapter?.id) { if (item.chapter.id != presenter.getCurrentChapter()?.chapter?.id) {
shouldCollaspe = false shouldCollapse = false
presenter.loadChapter(item.chapter) presenter.loadChapter(item.chapter)
} }
true true