fix:三星Spen失效的问题,并添加上一章和下一章的操作选项 (#1583)

This commit is contained in:
fansan
2026-06-29 02:26:17 +08:00
committed by GitHub
parent eb0a0ff2ff
commit 4f25e6d73b
3 changed files with 78 additions and 0 deletions
+45
View File
@@ -44,7 +44,12 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
</intent-filter>
<meta-data
android:name="com.samsung.android.support.REMOTE_ACTION"
android:resource="@xml/spen_remote_actions" />
</activity>
<activity
android:name=".ui.main.Launcher0"
@@ -54,7 +59,12 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
</intent-filter>
<meta-data
android:name="com.samsung.android.support.REMOTE_ACTION"
android:resource="@xml/spen_remote_actions" />
</activity>
<!-- 图标1 -->
<activity
@@ -65,7 +75,12 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
</intent-filter>
<meta-data
android:name="com.samsung.android.support.REMOTE_ACTION"
android:resource="@xml/spen_remote_actions" />
</activity>
<!-- 图标2 -->
<activity
@@ -76,7 +91,12 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
</intent-filter>
<meta-data
android:name="com.samsung.android.support.REMOTE_ACTION"
android:resource="@xml/spen_remote_actions" />
</activity>
<!-- 图标3 -->
<activity
@@ -87,7 +107,12 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
</intent-filter>
<meta-data
android:name="com.samsung.android.support.REMOTE_ACTION"
android:resource="@xml/spen_remote_actions" />
</activity>
<!-- 图标4 -->
<activity
@@ -98,7 +123,12 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
</intent-filter>
<meta-data
android:name="com.samsung.android.support.REMOTE_ACTION"
android:resource="@xml/spen_remote_actions" />
</activity>
<!-- 图标5 -->
<activity
@@ -109,7 +139,12 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
</intent-filter>
<meta-data
android:name="com.samsung.android.support.REMOTE_ACTION"
android:resource="@xml/spen_remote_actions" />
</activity>
<!-- 图标6 -->
<activity
@@ -120,7 +155,12 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
</intent-filter>
<meta-data
android:name="com.samsung.android.support.REMOTE_ACTION"
android:resource="@xml/spen_remote_actions" />
</activity>
<!-- 主界面 -->
<activity
@@ -132,7 +172,12 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
</intent-filter>
<meta-data
android:name="com.samsung.android.support.REMOTE_ACTION"
android:resource="@xml/spen_remote_actions" />
</activity>
<activity
android:name=".ui.welcome.WelcomeActivity"
@@ -975,6 +975,20 @@ class ReadBookController(
handleKeyPage(PageDirection.NEXT, longPress)
return true
}
KeyEvent.KEYCODE_MEDIA_NEXT -> {
if (ReadBook.book != null) {
ReadBook.moveToNextChapter(true)
}
return true
}
KeyEvent.KEYCODE_MEDIA_PREVIOUS -> {
if (ReadBook.book != null) {
ReadBook.moveToPrevChapter(upContent = true, toLast = false)
}
return true
}
}
return false
}
@@ -11,6 +11,7 @@
trigger_key="PAGE_DOWN">
<preference name="gesture" value="click" />
</action>
<action
id="prev_page"
label="@string/prev_page"
@@ -20,4 +21,22 @@
trigger_key="PAGE_UP">
<preference name="gesture" value="double_click" />
</action>
<action
id="prev_chapter"
label="@string/previous_chapter"
priority="3"
repeatable="false"
trigger_key="MEDIA_PREVIOUS">
<preference name="gesture" value="move_left" />
</action>
<action
id="next_chapter"
label="@string/next_chapter"
priority="4"
repeatable="false"
trigger_key="MEDIA_NEXT">
<preference name="gesture" value="move_right" />
</action>
</remote-actions>