|
|
@ -221,18 +221,22 @@ class PageView(context: Context, attrs: AttributeSet) : |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun scrollToLine(line: Int) { |
|
|
|
override fun scrollToLine(line: Int) { |
|
|
|
|
|
|
|
if (isScrollDelegate()) { |
|
|
|
callback?.textChapter()?.let { |
|
|
|
callback?.textChapter()?.let { |
|
|
|
val pageIndex = it.getPageIndex(line) |
|
|
|
val pageIndex = it.getPageIndex(line) |
|
|
|
curPage?.setPageIndex(pageIndex) |
|
|
|
curPage?.setPageIndex(pageIndex) |
|
|
|
callback?.setPageIndex(pageIndex) |
|
|
|
callback?.setPageIndex(pageIndex) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun scrollToLast() { |
|
|
|
override fun scrollToLast() { |
|
|
|
|
|
|
|
if (isScrollDelegate()) { |
|
|
|
callback?.textChapter()?.let { |
|
|
|
callback?.textChapter()?.let { |
|
|
|
callback?.setPageIndex(it.lastIndex()) |
|
|
|
callback?.setPageIndex(it.lastIndex()) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
interface CallBack { |
|
|
|
interface CallBack { |
|
|
|
fun chapterSize(): Int |
|
|
|
fun chapterSize(): Int |
|
|
|