From 766648c10be895647b4a6df91434d5b4025fdd57 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 30 Nov 2019 21:25:11 +0800 Subject: [PATCH] up --- .../ui/book/read/config/ReadAloudDialog.kt | 4 +- app/src/main/res/drawable/ic_menu.xml | 9 + app/src/main/res/drawable/ic_toc.xml | 27 +- .../main/res/drawable/ic_visibility_off.xml | 9 + app/src/main/res/layout/dialog_read_aloud.xml | 310 +++++++++++------- app/src/main/res/layout/view_read_menu.xml | 2 +- 6 files changed, 211 insertions(+), 150 deletions(-) create mode 100644 app/src/main/res/drawable/ic_menu.xml create mode 100644 app/src/main/res/drawable/ic_visibility_off.xml diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt index dad85212f..a20ac2efe 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt @@ -105,7 +105,6 @@ class ReadAloudDialog : DialogFragment() { iv_other_config.onClick { ReadAloudConfigDialog().show(childFragmentManager, "readAloudConfigDialog") } - iv_menu.onLongClick { callBack?.openChapterList(); true } iv_stop.onClick { ReadAloud.stop(requireContext()); dismiss() } iv_play_pause.onClick { callBack?.onClickReadAloud() } iv_play_prev.onClick { ReadAloud.prevParagraph(requireContext()) } @@ -115,6 +114,8 @@ class ReadAloudDialog : DialogFragment() { } iv_play_next.onClick { ReadAloud.nextParagraph(requireContext()) } iv_play_next.onLongClick { ReadBook.moveToNextChapter(true); true } + fabToc.onClick { callBack?.openChapterList() } + fabBack.onClick { callBack?.finish() } } private fun upPlayState() { @@ -137,5 +138,6 @@ class ReadAloudDialog : DialogFragment() { fun showMenu() fun openChapterList() fun onClickReadAloud() + fun finish() } } \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_menu.xml b/app/src/main/res/drawable/ic_menu.xml new file mode 100644 index 000000000..8a6004bd4 --- /dev/null +++ b/app/src/main/res/drawable/ic_menu.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_toc.xml b/app/src/main/res/drawable/ic_toc.xml index 62bb997db..c64161dc1 100644 --- a/app/src/main/res/drawable/ic_toc.xml +++ b/app/src/main/res/drawable/ic_toc.xml @@ -1,26 +1,9 @@ - - + android:viewportWidth="24.0" + android:viewportHeight="24.0"> - - - - - - \ No newline at end of file + android:fillColor="#FF000000" + android:pathData="M3,9h14L17,7L3,7v2zM3,13h14v-2L3,11v2zM3,17h14v-2L3,15v2zM19,17h2v-2h-2v2zM19,7v2h2L21,7h-2zM19,13h2v-2h-2v2z" /> + diff --git a/app/src/main/res/drawable/ic_visibility_off.xml b/app/src/main/res/drawable/ic_visibility_off.xml new file mode 100644 index 000000000..c71061582 --- /dev/null +++ b/app/src/main/res/drawable/ic_visibility_off.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/dialog_read_aloud.xml b/app/src/main/res/layout/dialog_read_aloud.xml index 753e36c8e..5cc10c6c3 100644 --- a/app/src/main/res/layout/dialog_read_aloud.xml +++ b/app/src/main/res/layout/dialog_read_aloud.xml @@ -3,168 +3,226 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/background_menu" - android:orientation="vertical" - android:padding="10dp"> + xmlns:app="http://schemas.android.com/apk/res-auto" + android:orientation="vertical"> - - - - - - - - - - - - + android:layout_height="wrap_content"> - - - - - - - - - - - + + + android:layout_weight="1" /> - + android:layout_margin="10dp" + android:contentDescription="@string/to_backstage" + android:src="@drawable/ic_visibility_off" + android:tint="@color/tv_text_default" + android:tooltipText="@string/replace_rule_title" + app:backgroundTint="@color/background_menu" + app:elevation="2dp" + app:fabSize="mini" + app:pressedTranslationZ="2dp" + tools:ignore="UnusedAttribute" /> + + - + + + + + + + + + + + + + + + + + + + + - + + + android:max="60" /> - + android:text="@string/timer_m" /> + - + + + android:layout_height="wrap_content" + android:orientation="vertical"> + + + + + + + + + + + diff --git a/app/src/main/res/layout/view_read_menu.xml b/app/src/main/res/layout/view_read_menu.xml index 54f9a686a..d23bc2248 100644 --- a/app/src/main/res/layout/view_read_menu.xml +++ b/app/src/main/res/layout/view_read_menu.xml @@ -238,7 +238,7 @@ android:layout_height="0dp" android:layout_weight="1" android:contentDescription="@string/chapter_list" - android:src="@drawable/ic_chapter_list" + android:src="@drawable/ic_toc" app:tint="@color/tv_text_default" tools:ignore="NestedWeights" />