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. 310
      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 {
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()
}
}

@ -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"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#595757"
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" />
<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" />
android:fillColor="#FF000000"
android:pathData="M3,9h14L17,7L3,7v2zM3,13h14v-2L3,11v2zM3,17h14v-2L3,15v2zM19,17h2v-2h-2v2zM19,7v2h2L21,7h-2zM19,13h2v-2h-2v2z" />
</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,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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="8dp">
<ImageView
android:id="@+id/iv_menu"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/menu"
android:src="@drawable/ic_chapter_list"
android:tint="@color/tv_text_default" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_play_prev"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/prev_sentence"
android:src="@drawable/ic_skip_previous"
android:tint="@color/tv_text_default" />
<ImageView
android:id="@+id/iv_play_pause"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/audio_play"
android:src="@drawable/ic_play_24dp"
android:tint="@color/tv_text_default" />
<ImageView
android:id="@+id/iv_stop"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/stop"
android:src="@drawable/ic_stop_black_24dp"
android:tint="@color/tv_text_default" />
<ImageView
android:id="@+id/iv_play_next"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/next_sentence"
android:src="@drawable/ic_skip_next"
android:tint="@color/tv_text_default" />
android:layout_height="wrap_content">
<View
<Space
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_other_config"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/other_setting"
android:src="@drawable/ic_settings"
android:tint="@color/tv_text_default" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="8dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/ic_time_add_24dp"
android:tint="@color/tv_text_default" />
<io.legado.app.lib.theme.view.ATESeekBar
android:id="@+id/seek_timer"
<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"
android:max="60" />
android:layout_weight="1" />
<TextView
android:id="@+id/tv_timer"
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/timer_m" />
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>
<View
android:layout_width="match_parent"
android:layout_height="0.8dp"
android:background="@color/divider" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/background_menu"
android:padding="16dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_tts_SpeechRate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_menu"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/menu"
android:src="@drawable/ic_menu"
android:tint="@color/tv_text_default" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_play_prev"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/prev_sentence"
android:src="@drawable/ic_skip_previous"
android:tint="@color/tv_text_default" />
<ImageView
android:id="@+id/iv_play_pause"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/audio_play"
android:src="@drawable/ic_play_24dp"
android:tint="@color/tv_text_default" />
<ImageView
android:id="@+id/iv_stop"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/stop"
android:src="@drawable/ic_stop_black_24dp"
android:tint="@color/tv_text_default" />
<ImageView
android:id="@+id/iv_play_next"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/next_sentence"
android:src="@drawable/ic_skip_next"
android:tint="@color/tv_text_default" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_other_config"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/other_setting"
android:src="@drawable/ic_settings"
android:tint="@color/tv_text_default" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="8dp">
<TextView
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/ic_time_add_24dp"
android:tint="@color/tv_text_default" />
<io.legado.app.lib.theme.view.ATESeekBar
android:id="@+id/seek_timer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="@string/read_aloud_speed"
android:textColor="@color/tv_text_default"
android:textSize="14sp" />
android:max="60" />
<io.legado.app.lib.theme.view.ATESwitch
android:id="@+id/cb_tts_follow_sys"
<TextView
android:id="@+id/tv_timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:contentDescription="@string/flow_sys"
android:text="@string/flow_sys"
tools:ignore="RtlHardcoded" />
android:text="@string/timer_m" />
</LinearLayout>
<io.legado.app.lib.theme.view.ATESeekBar
android:id="@+id/seek_tts_SpeechRate"
<View
android:layout_width="match_parent"
android:layout_height="0.8dp"
android:background="@color/divider" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:max="45" />
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_tts_SpeechRate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:padding="8dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="@string/read_aloud_speed"
android:textColor="@color/tv_text_default"
android:textSize="14sp" />
<io.legado.app.lib.theme.view.ATESwitch
android:id="@+id/cb_tts_follow_sys"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:contentDescription="@string/flow_sys"
android:text="@string/flow_sys"
tools:ignore="RtlHardcoded" />
</LinearLayout>
<io.legado.app.lib.theme.view.ATESeekBar
android:id="@+id/seek_tts_SpeechRate"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:max="45" />
</LinearLayout>
</LinearLayout>

@ -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" />

Loading…
Cancel
Save