feat: Implement Spen integration for enhanced stylus support

TY Alexander!
This commit is contained in:
Clebio
2024-05-16 22:15:10 -03:00
parent bbdf1c756e
commit b8283acd0d
3 changed files with 36 additions and 0 deletions

View File

@@ -100,6 +100,12 @@
<intent-filter>
<action android:name="${applicationId}.action.READ_MANGA" />
</intent-filter>
<intent-filter>
<action android:name="com.samsung.android.support.REMOTE_ACTION" />
</intent-filter>
<meta-data
android:name="com.samsung.android.support.REMOTE_ACTION"
android:resource="@xml/remote_action"/>
</activity>
<activity
android:name="org.koitharu.kotatsu.search.ui.SearchActivity"

View File

@@ -36,6 +36,17 @@ class ReaderControlDelegate(
}
fun onKeyDown(keyCode: Int): Boolean = when (keyCode) {
KeyEvent.KEYCODE_R -> {
listener.switchPageBy(1)
true
}
KeyEvent.KEYCODE_L -> {
listener.switchPageBy(-1)
true
}
KeyEvent.KEYCODE_VOLUME_UP -> if (settings.isReaderVolumeButtonsEnabled) {
listener.switchPageBy(-1)
true

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<remote-actions version="1.2">
<action
id="next_filter"
label="@string/prev_page"
priority="1"
trigger_key="L">
<preference name="gesture" value="swipe_left"/>
</action>
<action
id="prev_filter"
label="@string/next_page"
priority="2"
trigger_key="R">
<preference name="gesture" value="swipe_right"/>
</action>
</remote-actions>