diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt index 1b2692333..abb2b82c4 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt @@ -16,7 +16,6 @@ import java.util.* class ContentView(context: Context) : FrameLayout(context) { - var callBack: CallBack? = null private var pageSize: Int = 0 init { @@ -135,8 +134,4 @@ class ContentView(context: Context) : FrameLayout(context) { val selectedText: String get() = content_text_view.selectedText - interface CallBack { - fun scrollToLine(line: Int) - fun scrollToLast() - } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt index 6dc9c15a0..a0c6c962a 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt @@ -16,7 +16,6 @@ import io.legado.app.utils.getPrefInt class PageView(context: Context, attrs: AttributeSet) : FrameLayout(context, attrs), - ContentView.CallBack, DataSource { var callBack: CallBack @@ -39,7 +38,6 @@ class PageView(context: Context, attrs: AttributeSet) : setWillNotDraw(false) pageFactory = TextPageFactory(this) upPageAnim(context.getPrefInt(PreferKey.pageAnim)) - curPage.callBack = this } override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { @@ -199,25 +197,6 @@ class PageView(context: Context, attrs: AttributeSet) : return ReadBook.durChapterIndex > 0 } - override fun scrollToLine(line: Int) { - if (isScrollDelegate) { - ReadBook.textChapter()?.let { - val pageIndex = it.getPageIndex(line) - curPage.setPageIndex(pageIndex) - callBack.setPageIndex(pageIndex) - } - } - } - - override fun scrollToLast() { - if (isScrollDelegate) { - ReadBook.textChapter()?.let { - callBack.setPageIndex(it.lastIndex()) - curPage.setPageIndex(it.lastIndex()) - } - } - } - interface CallBack { val isInitFinish: Boolean