|
|
@ -14,6 +14,7 @@ import io.legado.app.utils.getPrefInt |
|
|
|
class PageView(context: Context, attrs: AttributeSet) : |
|
|
|
class PageView(context: Context, attrs: AttributeSet) : |
|
|
|
FrameLayout(context, attrs), |
|
|
|
FrameLayout(context, attrs), |
|
|
|
PageDelegate.PageInterface, |
|
|
|
PageDelegate.PageInterface, |
|
|
|
|
|
|
|
ContentView.CallBack, |
|
|
|
DataSource { |
|
|
|
DataSource { |
|
|
|
|
|
|
|
|
|
|
|
private var callback: CallBack? = null |
|
|
|
private var callback: CallBack? = null |
|
|
@ -36,6 +37,7 @@ class PageView(context: Context, attrs: AttributeSet) : |
|
|
|
setWillNotDraw(false) |
|
|
|
setWillNotDraw(false) |
|
|
|
pageFactory = TextPageFactory.create(this) |
|
|
|
pageFactory = TextPageFactory.create(this) |
|
|
|
upPageAnim() |
|
|
|
upPageAnim() |
|
|
|
|
|
|
|
curPage?.callBack = this |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { |
|
|
|
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { |
|
|
@ -207,6 +209,10 @@ class PageView(context: Context, attrs: AttributeSet) : |
|
|
|
callback?.moveToPrevChapter() |
|
|
|
callback?.moveToPrevChapter() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun scrollToLine(line: Int) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
interface CallBack { |
|
|
|
interface CallBack { |
|
|
|
fun chapterSize(): Int |
|
|
|
fun chapterSize(): Int |
|
|
|
fun durChapterIndex(): Int |
|
|
|
fun durChapterIndex(): Int |
|
|
|