diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt index 5b33ef5b6..7322806bb 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt @@ -53,6 +53,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea setSupportActionBar(toolbar) initAnimation() initView() + page_view.callback = this viewModel.callBack = this viewModel.bookData.observe(this, Observer { title_bar.title = it.name }) viewModel.chapterListFinish.observe(this, Observer { bookLoadFinish() }) diff --git a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt index 732a85b49..fbd02d20b 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt @@ -57,6 +57,6 @@ class ContentView : FrameLayout { fun setContent(page: TextPage?) { content_text_view.text = page?.text - //bottom_status_bar draw index + tv_bottom_right.text = page?.index?.toString() } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt b/app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt index 31fb586b2..fdc94f27a 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/TextPageFactory.kt @@ -47,16 +47,18 @@ class TextPageFactory private constructor(dataSource: DataSource) : PageFactory< } override fun currentPage(): TextPage? { -// return dataSource.getCurrentChapter()?.page(index) - return TextPage(index, "index:$index") + return dataSource.getCurrentChapter()?.page(index) +// return TextPage(index, "index:$index") } override fun nextPage(): TextPage? { - return TextPage(index + 1, "index:${index + 1}") + return dataSource.getCurrentChapter()?.page(index + 1) +// return TextPage(index + 1, "index:${index + 1}") } override fun previousPage(): TextPage? { - return TextPage(index - 1, "index:${index - 1}") + return dataSource.getCurrentChapter()?.page(index - 1) +// return TextPage(index - 1, "index:${index - 1}") } diff --git a/app/src/main/res/layout/view_book_page.xml b/app/src/main/res/layout/view_book_page.xml index db1dd5bf9..3ffff8da2 100644 --- a/app/src/main/res/layout/view_book_page.xml +++ b/app/src/main/res/layout/view_book_page.xml @@ -8,27 +8,46 @@ app:divider="@drawable/ic_divider" app:showDividers="middle"> - + android:layout_height="wrap_content" + android:orientation="horizontal"> - + + + + + + + android:layout_weight="1" /> - + - + - + + + \ No newline at end of file