From 56910ffbc311e49cde78d10f47160fcb4fa15baa Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 23 Feb 2020 19:08:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/book/read/page/ContentView.kt | 5 ----- .../legado/app/ui/book/read/page/PageView.kt | 21 ------------------- 2 files changed, 26 deletions(-) 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