dialog_read_aloud.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. xmlns:tools="http://schemas.android.com/tools"
  5. android:id="@+id/root_view"
  6. android:layout_width="match_parent"
  7. android:layout_height="wrap_content"
  8. android:orientation="vertical"
  9. android:paddingHorizontal="16dp"
  10. android:paddingBottom="8dp">
  11. <LinearLayout
  12. android:layout_width="match_parent"
  13. android:layout_height="wrap_content"
  14. android:orientation="vertical"
  15. android:gravity="center"
  16. android:paddingBottom="8dp"
  17. android:paddingHorizontal="16dp">
  18. <com.google.android.material.bottomsheet.BottomSheetDragHandleView
  19. android:layout_width="wrap_content"
  20. android:layout_height="wrap_content"
  21. android:layout_gravity="center_horizontal" />
  22. <TextView
  23. android:id="@+id/bottom_sheet_title"
  24. android:layout_width="wrap_content"
  25. android:layout_height="wrap_content"
  26. android:text="朗读设置"
  27. android:textSize="18sp"
  28. android:textStyle="bold" />
  29. </LinearLayout>
  30. <com.google.android.material.button.MaterialButtonGroup
  31. android:layout_width="match_parent"
  32. android:layout_height="wrap_content"
  33. android:gravity="center"
  34. android:orientation="horizontal"
  35. android:layout_marginVertical="6dp">
  36. <com.google.android.material.button.MaterialButton
  37. android:id="@+id/iv_play_prev"
  38. style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
  39. android:layout_width="wrap_content"
  40. android:layout_height="48dp"
  41. android:contentDescription="@string/prev_sentence"
  42. android:tooltipText="@string/prev_sentence"
  43. app:icon="@drawable/ic_skip_previous"
  44. tools:ignore="UnusedAttribute" />
  45. <com.google.android.material.button.MaterialButton
  46. android:id="@+id/iv_play_pause"
  47. style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
  48. android:layout_width="48dp"
  49. android:layout_height="48dp"
  50. android:layout_marginHorizontal="6dp"
  51. android:contentDescription="@string/audio_play"
  52. android:tooltipText="@string/audio_play"
  53. app:icon="@drawable/ic_play"
  54. tools:ignore="UnusedAttribute" />
  55. <com.google.android.material.button.MaterialButton
  56. android:id="@+id/iv_stop"
  57. style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
  58. android:layout_width="48dp"
  59. android:layout_height="48dp"
  60. android:layout_marginEnd="6dp"
  61. android:contentDescription="@string/stop"
  62. android:tooltipText="@string/stop"
  63. app:icon="@drawable/ic_stop_black_24dp"
  64. tools:ignore="UnusedAttribute" />
  65. <com.google.android.material.button.MaterialButton
  66. android:id="@+id/iv_play_next"
  67. style="@style/Widget.Material3Expressive.Button.TonalButton"
  68. android:layout_width="wrap_content"
  69. android:layout_height="48dp"
  70. android:contentDescription="@string/next_sentence"
  71. android:text="@string/next_sentence"
  72. app:icon="@drawable/ic_skip_next"
  73. tools:ignore="UnusedAttribute" />
  74. </com.google.android.material.button.MaterialButtonGroup>
  75. <LinearLayout
  76. android:layout_width="match_parent"
  77. android:layout_height="wrap_content"
  78. android:orientation="horizontal"
  79. android:gravity="center_vertical"
  80. android:layout_marginVertical="6dp">
  81. <io.legato.kazusa.lib.theme.view.ThemeSlider
  82. android:id="@+id/seek_timer"
  83. android:layout_width="0dp"
  84. android:layout_height="wrap_content"
  85. android:layout_weight="1"
  86. android:valueFrom="0.0"
  87. android:valueTo="180.0"
  88. android:stepSize="1.0" />
  89. <com.google.android.material.button.MaterialButton
  90. android:id="@+id/iv_timer"
  91. style="@style/Widget.Material3.Button.IconButton.Outlined"
  92. android:layout_width="wrap_content"
  93. android:layout_height="wrap_content"
  94. android:layout_marginStart="12dp"
  95. android:contentDescription="@string/set_timer"
  96. app:icon="@drawable/ic_time_add_24dp" />
  97. </LinearLayout>
  98. <com.google.android.material.button.MaterialButtonGroup
  99. android:layout_width="match_parent"
  100. android:layout_height="wrap_content"
  101. android:orientation="horizontal"
  102. android:weightSum="3"
  103. android:layout_marginVertical="6dp"
  104. android:layout_marginHorizontal="3dp">
  105. <!-- 上一章按钮 -->
  106. <com.google.android.material.button.MaterialButton
  107. android:id="@+id/tv_pre"
  108. style="@style/Widget.Material3Expressive.Button.OutlinedButton"
  109. android:layout_width="0dp"
  110. android:layout_height="match_parent"
  111. android:textColor="?attr/colorPrimary"
  112. android:layout_weight="1"
  113. android:layout_marginEnd="8dp"
  114. android:minHeight="36dp"
  115. android:text="@string/previous_chapter"
  116. android:textSize="14sp"/>
  117. <!-- 计时器文本按钮 -->
  118. <com.google.android.material.button.MaterialButton
  119. android:id="@+id/btn_timer"
  120. style="@style/Widget.Material3Expressive.Button.TonalButton"
  121. android:layout_width="0dp"
  122. android:layout_height="match_parent"
  123. android:layout_marginHorizontal="6dp"
  124. android:layout_weight="1"
  125. android:padding="0dp"
  126. android:text="@string/timer_m" />
  127. <!-- 下一章按钮 -->
  128. <com.google.android.material.button.MaterialButton
  129. android:id="@+id/tv_next"
  130. style="@style/Widget.Material3Expressive.Button.OutlinedButton"
  131. android:layout_width="0dp"
  132. android:layout_height="wrap_content"
  133. android:textColor="?attr/colorPrimary"
  134. android:layout_weight="1"
  135. android:layout_marginStart="6dp"
  136. android:text="@string/next_chapter"
  137. android:textSize="14sp" />
  138. </com.google.android.material.button.MaterialButtonGroup>
  139. <LinearLayout
  140. android:layout_width="match_parent"
  141. android:layout_height="wrap_content"
  142. android:orientation="vertical">
  143. <LinearLayout
  144. android:id="@+id/ll_tts_SpeechRate"
  145. android:layout_width="match_parent"
  146. android:layout_height="wrap_content"
  147. android:layout_gravity="center_vertical"
  148. android:orientation="horizontal"
  149. android:padding="8dp">
  150. <TextView
  151. android:id="@+id/tv_tts_speed"
  152. android:layout_width="wrap_content"
  153. android:layout_height="wrap_content"
  154. android:layout_gravity="center"
  155. android:text="@string/read_aloud_speed"
  156. android:textSize="14sp" />
  157. <TextView
  158. android:id="@+id/tv_tts_speed_value"
  159. android:layout_width="wrap_content"
  160. android:layout_height="wrap_content"
  161. android:layout_gravity="center"
  162. android:paddingHorizontal="3dp"
  163. android:textSize="14sp" />
  164. <Space
  165. android:layout_width="0dp"
  166. android:layout_height="1dp"
  167. android:layout_gravity="center"
  168. android:layout_weight="1" />
  169. <io.legato.kazusa.lib.theme.view.ThemeSwitch
  170. android:id="@+id/cb_tts_follow_sys"
  171. android:layout_width="wrap_content"
  172. android:layout_height="wrap_content"
  173. android:layout_gravity="center_vertical"
  174. android:contentDescription="@string/flow_sys"
  175. android:text="@string/flow_sys"
  176. tools:ignore="RtlHardcoded,TouchTargetSizeCheck" />
  177. </LinearLayout>
  178. <LinearLayout
  179. android:layout_width="match_parent"
  180. android:layout_height="wrap_content"
  181. android:orientation="horizontal"
  182. android:gravity="center_vertical"
  183. android:paddingVertical="8dp">
  184. <com.google.android.material.button.MaterialButton
  185. android:id="@+id/iv_tts_speech_reduce"
  186. style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
  187. android:layout_width="48dp"
  188. android:layout_height="48dp"
  189. android:contentDescription="@string/tts_speech_reduce"
  190. android:tooltipText="@string/tts_speech_reduce"
  191. app:icon="@drawable/ic_reduce"
  192. tools:ignore="UnusedAttribute" />
  193. <!-- 滑动条 (保持不变) -->
  194. <io.legato.kazusa.lib.theme.view.ThemeSlider
  195. android:id="@+id/seek_tts_speechRate"
  196. android:layout_width="0dp"
  197. android:layout_height="wrap_content"
  198. android:layout_weight="1"
  199. android:valueFrom="0"
  200. android:valueTo="45"
  201. android:stepSize="1"/>
  202. <com.google.android.material.button.MaterialButton
  203. android:id="@+id/iv_tts_speech_add"
  204. style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
  205. android:layout_width="48dp"
  206. android:layout_height="48dp"
  207. android:contentDescription="@string/tts_speech_add"
  208. android:tooltipText="@string/tts_speech_add"
  209. app:icon="@drawable/ic_add"
  210. tools:ignore="UnusedAttribute" />
  211. </LinearLayout>
  212. </LinearLayout>
  213. <LinearLayout
  214. android:layout_width="match_parent"
  215. android:layout_height="wrap_content"
  216. android:layout_marginTop="8dp"
  217. android:baselineAligned="false"
  218. android:orientation="horizontal">
  219. <!--目录按钮-->
  220. <LinearLayout
  221. android:id="@+id/ll_catalog"
  222. android:layout_width="60dp"
  223. android:layout_height="wrap_content"
  224. android:background="?attr/selectableItemBackgroundBorderless"
  225. android:clickable="true"
  226. android:contentDescription="@string/chapter_list"
  227. android:focusable="true"
  228. android:orientation="vertical"
  229. android:paddingBottom="7dp">
  230. <androidx.appcompat.widget.AppCompatImageView
  231. android:id="@+id/iv_catalog"
  232. android:layout_width="match_parent"
  233. android:layout_height="0dp"
  234. android:layout_weight="1"
  235. android:adjustViewBounds="true"
  236. android:contentDescription="@string/chapter_list"
  237. android:maxHeight="20dp"
  238. android:src="@drawable/ic_toc"
  239. tools:ignore="NestedWeights" />
  240. <TextView
  241. android:id="@+id/tv_catalog"
  242. android:layout_width="wrap_content"
  243. android:layout_height="wrap_content"
  244. android:layout_gravity="center_horizontal"
  245. android:layout_marginTop="3dp"
  246. android:ellipsize="middle"
  247. android:singleLine="true"
  248. android:text="@string/chapter_list"
  249. android:textSize="12sp" />
  250. </LinearLayout>
  251. <View
  252. android:layout_width="0dp"
  253. android:layout_height="match_parent"
  254. android:layout_weight="2" />
  255. <!--调节按钮-->
  256. <LinearLayout
  257. android:id="@+id/ll_main_menu"
  258. android:layout_width="60dp"
  259. android:layout_height="wrap_content"
  260. android:background="?attr/selectableItemBackgroundBorderless"
  261. android:clickable="true"
  262. android:contentDescription="@string/read_aloud"
  263. android:focusable="true"
  264. android:orientation="vertical"
  265. android:paddingBottom="7dp"
  266. tools:ignore="TextSizeCheck">
  267. <androidx.appcompat.widget.AppCompatImageView
  268. android:id="@+id/iv_main_menu"
  269. android:layout_width="match_parent"
  270. android:layout_height="0dp"
  271. android:layout_weight="1"
  272. android:adjustViewBounds="true"
  273. android:contentDescription="@string/main_menu"
  274. android:maxHeight="20dp"
  275. android:src="@drawable/ic_menu"
  276. tools:ignore="NestedWeights" />
  277. <TextView
  278. android:id="@+id/tv_main_menu"
  279. android:layout_width="wrap_content"
  280. android:layout_height="wrap_content"
  281. android:layout_gravity="center_horizontal"
  282. android:layout_marginTop="3dp"
  283. android:ellipsize="middle"
  284. android:singleLine="true"
  285. android:text="@string/main_menu"
  286. android:textSize="12sp" />
  287. </LinearLayout>
  288. <View
  289. android:layout_width="0dp"
  290. android:layout_height="match_parent"
  291. android:layout_weight="2" />
  292. <!--界面按钮-->
  293. <LinearLayout
  294. android:id="@+id/ll_to_backstage"
  295. android:layout_width="60dp"
  296. android:layout_height="wrap_content"
  297. android:background="?attr/selectableItemBackgroundBorderless"
  298. android:clickable="true"
  299. android:contentDescription="@string/to_backstage"
  300. android:focusable="true"
  301. android:orientation="vertical"
  302. android:paddingBottom="7dp">
  303. <androidx.appcompat.widget.AppCompatImageView
  304. android:id="@+id/iv_to_backstage"
  305. android:layout_width="match_parent"
  306. android:layout_height="0dp"
  307. android:layout_weight="1"
  308. android:adjustViewBounds="true"
  309. android:contentDescription="@string/to_backstage"
  310. android:maxHeight="20dp"
  311. android:src="@drawable/ic_visibility_off"
  312. tools:ignore="NestedWeights" />
  313. <TextView
  314. android:id="@+id/tv_to_backstage"
  315. android:layout_width="wrap_content"
  316. android:layout_height="wrap_content"
  317. android:layout_gravity="center_horizontal"
  318. android:layout_marginTop="3dp"
  319. android:ellipsize="middle"
  320. android:singleLine="true"
  321. android:text="@string/to_backstage"
  322. android:textSize="12sp" />
  323. </LinearLayout>
  324. <View
  325. android:layout_width="0dp"
  326. android:layout_height="match_parent"
  327. android:layout_weight="2" />
  328. <!--设置按钮-->
  329. <LinearLayout
  330. android:id="@+id/ll_setting"
  331. android:layout_width="60dp"
  332. android:layout_height="wrap_content"
  333. android:background="?attr/selectableItemBackgroundBorderless"
  334. android:clickable="true"
  335. android:contentDescription="@string/setting"
  336. android:focusable="true"
  337. android:orientation="vertical"
  338. android:paddingBottom="7dp">
  339. <androidx.appcompat.widget.AppCompatImageView
  340. android:id="@+id/iv_setting"
  341. android:layout_width="match_parent"
  342. android:layout_height="0dp"
  343. android:layout_weight="1"
  344. android:adjustViewBounds="true"
  345. android:contentDescription="@string/aloud_config"
  346. android:maxHeight="20dp"
  347. android:src="@drawable/ic_settings"
  348. tools:ignore="NestedWeights" />
  349. <TextView
  350. android:id="@+id/tv_setting"
  351. android:layout_width="wrap_content"
  352. android:layout_height="wrap_content"
  353. android:layout_gravity="center_horizontal"
  354. android:layout_marginTop="3dp"
  355. android:ellipsize="middle"
  356. android:singleLine="true"
  357. android:text="@string/setting"
  358. android:textSize="12sp" />
  359. </LinearLayout>
  360. </LinearLayout>
  361. </LinearLayout>