From dd5df930223abc0947a09640a51a5ace22e38b74 Mon Sep 17 00:00:00 2001 From: Dacer Date: Thu, 14 Jan 2021 23:06:11 +0900 Subject: [PATCH] add support for S Pen remote actions --- app/src/main/AndroidManifest.xml | 10 +++++++- .../app/ui/book/read/ReadBookActivity.kt | 8 +++++++ app/src/main/res/xml/spen_remote_actions.xml | 23 +++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/xml/spen_remote_actions.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 35207bcbc..4fe52b196 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -150,7 +150,15 @@ + android:launchMode="singleTask"> + + + + + + { + binding.readView.pageDelegate?.keyTurnPage(PageDirection.PREV) + return true + } + keyCode == KeyEvent.KEYCODE_PAGE_DOWN -> { + binding.readView.pageDelegate?.keyTurnPage(PageDirection.NEXT) + return true + } keyCode == KeyEvent.KEYCODE_SPACE -> { binding.readView.pageDelegate?.keyTurnPage(PageDirection.NEXT) return true diff --git a/app/src/main/res/xml/spen_remote_actions.xml b/app/src/main/res/xml/spen_remote_actions.xml new file mode 100644 index 000000000..f38cfebe8 --- /dev/null +++ b/app/src/main/res/xml/spen_remote_actions.xml @@ -0,0 +1,23 @@ + + + + + + + + + \ No newline at end of file