From 565e2a86e42dc97ca72b4650173e3c1cc4d3fe6f Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 22 Aug 2019 17:55:24 +0800 Subject: [PATCH] up --- .../app/ui/readbook/ReadBookActivity.kt | 4 +- .../{ReadBottomMenu.kt => ReadMenu.kt} | 6 +- .../main/res/layout/activity_read_book.xml | 47 +-- .../main/res/layout/view_read_bottom_menu.xml | 326 --------------- app/src/main/res/layout/view_read_menu.xml | 370 ++++++++++++++++++ 5 files changed, 379 insertions(+), 374 deletions(-) rename app/src/main/java/io/legado/app/ui/readbook/{ReadBottomMenu.kt => ReadMenu.kt} (95%) delete mode 100644 app/src/main/res/layout/view_read_bottom_menu.xml create mode 100644 app/src/main/res/layout/view_read_menu.xml 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 b5a851298..760b285c4 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 @@ -27,6 +27,7 @@ import io.legado.app.ui.widget.page.TextChapter import io.legado.app.utils.* import kotlinx.android.synthetic.main.activity_read_book.* import kotlinx.android.synthetic.main.view_book_page.* +import kotlinx.android.synthetic.main.view_read_menu.* import kotlinx.android.synthetic.main.view_title_bar.* import kotlinx.coroutines.launch import org.jetbrains.anko.sdk27.listeners.onClick @@ -119,7 +120,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea tv_chapter_url.onClick { } - bottom_menu.setListener(object : ReadBottomMenu.Callback { + fl_menu.setListener(object : ReadMenu.Callback { override fun skipToPage(page: Int) { } @@ -260,6 +261,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea } viewModel.curTextChapter = ChapterProvider.getTextChapter(content_text_view, bookChapter, content) page_view.chapterLoadFinish() + } viewModel.durChapterIndex - 1 -> { viewModel.prevTextChapter = ChapterProvider.getTextChapter(content_text_view, bookChapter, content) diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBottomMenu.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt similarity index 95% rename from app/src/main/java/io/legado/app/ui/readbook/ReadBottomMenu.kt rename to app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt index b507675e7..ef58c8445 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBottomMenu.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt @@ -7,11 +7,11 @@ import android.widget.SeekBar import io.legado.app.R import io.legado.app.service.ReadAloudService import io.legado.app.utils.isNightTheme -import kotlinx.android.synthetic.main.view_read_bottom_menu.view.* +import kotlinx.android.synthetic.main.view_read_menu.view.* import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onLongClick -class ReadBottomMenu : FrameLayout { +class ReadMenu : FrameLayout { private var callback: Callback? = null @@ -26,7 +26,7 @@ class ReadBottomMenu : FrameLayout { ) init { - inflate(context, R.layout.view_read_bottom_menu, this) + inflate(context, R.layout.view_read_menu, this) if (context.isNightTheme) { fabNightTheme.setImageResource(R.drawable.ic_daytime) } else { diff --git a/app/src/main/res/layout/activity_read_book.xml b/app/src/main/res/layout/activity_read_book.xml index 7e72bc822..723bc9a00 100644 --- a/app/src/main/res/layout/activity_read_book.xml +++ b/app/src/main/res/layout/activity_read_book.xml @@ -15,52 +15,11 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/view_read_bottom_menu.xml b/app/src/main/res/layout/view_read_bottom_menu.xml deleted file mode 100644 index 1e6a091bb..000000000 --- a/app/src/main/res/layout/view_read_bottom_menu.xml +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/view_read_menu.xml b/app/src/main/res/layout/view_read_menu.xml new file mode 100644 index 000000000..27bdc85fc --- /dev/null +++ b/app/src/main/res/layout/view_read_menu.xml @@ -0,0 +1,370 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file