pull/49/head
kunfei 5 years ago
parent 9f8a55a902
commit 766648c10b
  1. 4
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt
  2. 9
      app/src/main/res/drawable/ic_menu.xml
  3. 25
      app/src/main/res/drawable/ic_toc.xml
  4. 9
      app/src/main/res/drawable/ic_visibility_off.xml
  5. 70
      app/src/main/res/layout/dialog_read_aloud.xml
  6. 2
      app/src/main/res/layout/view_read_menu.xml

@ -105,7 +105,6 @@ class ReadAloudDialog : DialogFragment() {
iv_other_config.onClick { iv_other_config.onClick {
ReadAloudConfigDialog().show(childFragmentManager, "readAloudConfigDialog") ReadAloudConfigDialog().show(childFragmentManager, "readAloudConfigDialog")
} }
iv_menu.onLongClick { callBack?.openChapterList(); true }
iv_stop.onClick { ReadAloud.stop(requireContext()); dismiss() } iv_stop.onClick { ReadAloud.stop(requireContext()); dismiss() }
iv_play_pause.onClick { callBack?.onClickReadAloud() } iv_play_pause.onClick { callBack?.onClickReadAloud() }
iv_play_prev.onClick { ReadAloud.prevParagraph(requireContext()) } iv_play_prev.onClick { ReadAloud.prevParagraph(requireContext()) }
@ -115,6 +114,8 @@ class ReadAloudDialog : DialogFragment() {
} }
iv_play_next.onClick { ReadAloud.nextParagraph(requireContext()) } iv_play_next.onClick { ReadAloud.nextParagraph(requireContext()) }
iv_play_next.onLongClick { ReadBook.moveToNextChapter(true); true } iv_play_next.onLongClick { ReadBook.moveToNextChapter(true); true }
fabToc.onClick { callBack?.openChapterList() }
fabBack.onClick { callBack?.finish() }
} }
private fun upPlayState() { private fun upPlayState() {
@ -137,5 +138,6 @@ class ReadAloudDialog : DialogFragment() {
fun showMenu() fun showMenu()
fun openChapterList() fun openChapterList()
fun onClickReadAloud() fun onClickReadAloud()
fun finish()
} }
} }

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z" />
</vector>

@ -1,26 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:width="24dp"
android:height="24dp" android:height="24dp"
android:viewportWidth="24" android:viewportWidth="24.0"
android:viewportHeight="24"> android:viewportHeight="24.0">
<path <path
android:fillColor="#595757" android:fillColor="#FF000000"
android:pathData="M5.939,4v0.97H4v13.334C4,19.239,4.762,20,5.697,20h12.606C19.239,20,20,19.239,20,18.304V4H5.939z M5.454,18.304V6.424h0.485v11.88C5.939,18.57,5.454,18.57,5.454,18.304z M18.547,18.304c0,0.133-0.109,0.242-0.243,0.242H7.369 c0.012-0.08,0.024-0.159,0.024-0.242V5.454h11.153V18.304z" /> android:pathData="M3,9h14L17,7L3,7v2zM3,13h14v-2L3,11v2zM3,17h14v-2L3,15v2zM19,17h2v-2h-2v2zM19,7v2h2L21,7h-2zM19,13h2v-2h-2v2z" />
<path
android:fillColor="#595757"
android:pathData="M 9.09 11.061 H 16.849 V 11.97 H 9.09 V 11.061 Z" />
<path
android:fillColor="#595757"
android:pathData="M 9.09 13 H 16.849 V 13.909 H 9.09 V 13 Z" />
<path
android:fillColor="#595757"
android:pathData="M 9.09 7.182 H 16.849 V 8.091 H 9.09 V 7.182 Z" />
<path
android:fillColor="#595757"
android:pathData="M 9.09 9.12 H 16.849 V 10.03 H 9.09 V 9.12 Z" />
<path
android:fillColor="#595757"
android:pathData="M 9.09 14.939 H 16.849 V 15.848 H 9.09 V 14.939 Z" />
</vector> </vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,7c2.76,0 5,2.24 5,5 0,0.65 -0.13,1.26 -0.36,1.83l2.92,2.92c1.51,-1.26 2.7,-2.89 3.43,-4.75 -1.73,-4.39 -6,-7.5 -11,-7.5 -1.4,0 -2.74,0.25 -3.98,0.7l2.16,2.16C10.74,7.13 11.35,7 12,7zM2,4.27l2.28,2.28 0.46,0.46C3.08,8.3 1.78,10.02 1,12c1.73,4.39 6,7.5 11,7.5 1.55,0 3.03,-0.3 4.38,-0.84l0.42,0.42L19.73,22 21,20.73 3.27,3 2,4.27zM7.53,9.8l1.55,1.55c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.66 1.34,3 3,3 0.22,0 0.44,-0.03 0.65,-0.08l1.55,1.55c-0.67,0.33 -1.41,0.53 -2.2,0.53 -2.76,0 -5,-2.24 -5,-5 0,-0.79 0.2,-1.53 0.53,-2.2zM11.84,9.02l3.15,3.15 0.02,-0.16c0,-1.66 -1.34,-3 -3,-3l-0.17,0.01z" />
</vector>

@ -3,16 +3,73 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabToc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:contentDescription="@string/chapter_list"
android:src="@drawable/ic_toc"
android:tint="@color/tv_text_default"
android:tooltipText="@string/auto_next_page"
app:backgroundTint="@color/background_menu"
app:elevation="2dp"
app:fabSize="mini"
app:pressedTranslationZ="2dp"
tools:ignore="UnusedAttribute" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
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" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/background_menu" android:background="@color/background_menu"
android:orientation="vertical" android:padding="16dp"
android:padding="10dp"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal">
android:padding="8dp">
<ImageView <ImageView
android:id="@+id/iv_menu" android:id="@+id/iv_menu"
@ -22,7 +79,7 @@
android:layout_marginRight="8dp" android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/menu" android:contentDescription="@string/menu"
android:src="@drawable/ic_chapter_list" android:src="@drawable/ic_menu"
android:tint="@color/tv_text_default" /> android:tint="@color/tv_text_default" />
<View <View
@ -99,7 +156,6 @@
android:orientation="horizontal" android:orientation="horizontal"
android:padding="8dp"> android:padding="8dp">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
@ -169,3 +225,5 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout>

@ -238,7 +238,7 @@
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:contentDescription="@string/chapter_list" android:contentDescription="@string/chapter_list"
android:src="@drawable/ic_chapter_list" android:src="@drawable/ic_toc"
app:tint="@color/tv_text_default" app:tint="@color/tv_text_default"
tools:ignore="NestedWeights" /> tools:ignore="NestedWeights" />

Loading…
Cancel
Save