feat(app): 增加模拟追读功能

This commit is contained in:
Yaoliang
2024-07-10 09:28:10 +08:00
parent f48a87a948
commit 6d0a8699ce
25 changed files with 382 additions and 23 deletions
@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/background"
android:gravity="center"
android:padding="20dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@color/background"
android:gravity="center"
android:orientation="horizontal"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="2dp"
android:text="@string/switch_on"
android:textColor="@color/primaryText"
android:textSize="16sp"
tools:ignore="RtlHardcoded"
android:minWidth="88dp" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="53dp"
android:layout_height="match_parent"
android:gravity="center_vertical">
<androidx.appcompat.widget.SwitchCompat
android:layout_height="wrap_content"
android:id="@+id/sr_enabled"
android:layout_weight="1"
android:gravity="start|center_vertical"
style="@style/Widget.AppCompat.CompoundButton.Switch"
android:layout_width="match_parent"
android:width="20dp" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="65dp"
android:background="@color/background"
android:orientation="horizontal"
android:padding="16dp"
android:gravity="start|center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/start_from"
android:textColor="@color/primaryText"
android:textSize="16sp"
android:gravity="center_vertical"
android:minWidth="100dp" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<EditText
android:layout_width="match_parent"
android:layout_height="49dp"
android:inputType="none"
android:ems="10"
android:id="@+id/start_date"
android:hint="Select date"
android:layout_weight="1"
android:clickable="true"
android:textSize="16sp"
android:layout_marginRight="68dp" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="63dp"
android:gravity="center_horizontal|left"
android:padding="16dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="100dp"
android:layout_height="match_parent"
android:minWidth="100dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="2dp"
android:text="@string/start"
android:textColor="@color/primaryText"
android:textSize="16sp"
tools:ignore="RtlHardcoded" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"
android:text="@string/chapter"
android:textColor="@color/primaryText"
android:textSize="16sp"
tools:ignore="RtlHardcoded" />
</LinearLayout>
<EditText
android:id="@+id/edit_start"
android:layout_width="47dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/bg_edit"
android:hint="@string/start"
android:importantForAutofill="no"
android:inputType="number"
android:lines="1"
android:maxLength="5"
android:minWidth="60dp"
android:paddingLeft="5dp"
android:paddingTop="4dp"
android:paddingRight="5dp"
android:paddingBottom="4dp"
android:textColor="@color/primaryText"
android:textCursorDrawable="@drawable/shape_text_cursor"
android:textSize="14sp"
tools:ignore="TouchTargetSizeCheck,TextContrastCheck" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="end">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="25dp"
android:layout_marginRight="5dp"
android:text="@string/daily_chapters"
android:textColor="@color/primaryText"
android:textSize="16sp" />
<EditText
android:id="@+id/edit_num"
android:layout_width="42dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/bg_edit"
android:hint="3"
android:importantForAutofill="no"
android:inputType="number"
android:lines="1"
android:maxLength="5"
android:minWidth="60dp"
android:paddingLeft="5dp"
android:paddingTop="4dp"
android:paddingRight="5dp"
android:paddingBottom="4dp"
android:textColor="@color/primaryText"
android:textCursorDrawable="@drawable/shape_text_cursor"
android:textSize="14sp"
tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck,TextContrastCheck"
android:textAlignment="center" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
+5
View File
@@ -49,6 +49,11 @@
android:title="@string/bookmark_add"
app:showAsAction="never" />
<item
android:id="@+id/menu_simulated_reading"
android:title="@string/simulated_reading"
app:showAsAction="never" />
<item
android:id="@+id/menu_edit_content"
android:title="@string/edit_content"
+5 -1
View File
@@ -683,7 +683,7 @@
<string name="alouding_disable">The selected text cannot be spoken in full text speech</string>
<string name="read_body_to_lh">Extend to cutout</string>
<string name="toc_updateing">Updating Chapters</string>
<string name="media_button_on_exit_title">Headset buttons are always available</string>
<string name="media_button_on_exit_summary">Headset buttons are available even exit the app.</string>
<string name="contributors">Contributors</string>
@@ -1148,4 +1148,8 @@
<string name="keep_swipe_tip">继续滑动以加载下一章…</string>
<string name="enable_optimize_render">启用绘制优化</string>
<string name="ignore_battery_permission_rationale">阅读需要请求后台权限以保持服务正常运行</string>
<string name="simulated_reading">Lectura Ficticia</string>
<string name="switch_on">Enc/Apag</string>
<string name="start_from">Comenzar</string>
<string name="daily_chapters">Cap. al día</string>
</resources>
@@ -1151,4 +1151,8 @@
<string name="keep_swipe_tip">继续滑动以加载下一章…</string>
<string name="enable_optimize_render">启用绘制优化</string>
<string name="ignore_battery_permission_rationale">阅读需要请求后台权限以保持服务正常运行</string>
<string name="simulated_reading">模擬追読</string>
<string name="switch_on">スイッチ</string>
<string name="start_from">開始日</string>
<string name="daily_chapters">日更の章数</string>
</resources>
@@ -1151,4 +1151,8 @@
<string name="keep_swipe_tip">继续滑动以加载下一章…</string>
<string name="enable_optimize_render">启用绘制优化</string>
<string name="ignore_battery_permission_rationale">阅读需要请求后台权限以保持服务正常运行</string>
<string name="simulated_reading">Leitura Fingida</string>
<string name="switch_on">Lig/Desl</string>
<string name="start_from">Começar</string>
<string name="daily_chapters">Cap. por dia</string>
</resources>
+4
View File
@@ -1147,4 +1147,8 @@ Còn </string>
<string name="keep_swipe_tip">继续滑动以加载下一章…</string>
<string name="enable_optimize_render">启用绘制优化</string>
<string name="ignore_battery_permission_rationale">阅读需要请求后台权限以保持服务正常运行</string>
<string name="simulated_reading">Đọc giả lập</string>
<string name="switch_on">Bật</string>
<string name="start_from">Bắt đầu</string>
<string name="daily_chapters">Chương/ngày</string>
</resources>
@@ -1148,4 +1148,8 @@
<string name="keep_swipe_tip">继续滑动以加载下一章…</string>
<string name="enable_optimize_render">启用绘制优化</string>
<string name="ignore_battery_permission_rationale">阅读需要请求后台权限以保持服务正常运行</string>
<string name="simulated_reading">模擬追讀</string>
<string name="switch_on">開關</string>
<string name="start_from">起始日期</string>
<string name="daily_chapters">日更章數</string>
</resources>
@@ -1150,4 +1150,8 @@
<string name="keep_swipe_tip">继续滑动以加载下一章…</string>
<string name="enable_optimize_render">启用绘制优化</string>
<string name="ignore_battery_permission_rationale">阅读需要请求后台权限以保持服务正常运行</string>
<string name="simulated_reading">模擬追讀</string>
<string name="switch_on">開關</string>
<string name="start_from">起始日期</string>
<string name="daily_chapters">日更章數</string>
</resources>
+4
View File
@@ -1150,4 +1150,8 @@
<string name="keep_swipe_tip">继续滑动以加载下一章…</string>
<string name="enable_optimize_render">启用绘制优化</string>
<string name="ignore_battery_permission_rationale">阅读需要请求后台权限以保持服务正常运行</string>
<string name="simulated_reading">模拟追读</string>
<string name="switch_on">开关</string>
<string name="start_from">开始日期</string>
<string name="daily_chapters">日更章数</string>
</resources>
+4
View File
@@ -1151,4 +1151,8 @@
<string name="keep_swipe_tip">Keep swiping to load the next chapter…</string>
<string name="enable_optimize_render">启用绘制优化</string>
<string name="ignore_battery_permission_rationale">阅读需要请求后台权限以保持服务正常运行</string>
<string name="simulated_reading">Simulated Reading</string>
<string name="switch_on">Switch</string>
<string name="start_from">Start from</string>
<string name="daily_chapters">Daily Chapters</string>
</resources>