-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
android: add intents for some reader actions (e.g.: pageUp/pageDown/ttsPlay) #327
Conversation
5c39404
to
fca90bb
Compare
@teleshoes , can you more detailed explain which way you use that intents? |
sure. i call the second-most-important usage to me: i do the same thing with a keyboard shortcut from my laptop; i ssh to my phone, start coolreader, and call the most important usage to me is a very specific problem: |
Very interesting! |
my phone is a Sony Xperia XZ2 Compact, running SailfishOS the keyevent listener is a sailfish-specific utility i wrote that basically wraps |
I see. Will try to install waydroid onto my ubuntu 21.10 to see how it is works, maybe I'll implement your idea in my CR fork, but I'd do it in another way - your idea was quite good - you may iterate through ReaderAction.AVAILABLE_ACTIONS, |
i suggest: out of curiousity, what does knownreader do? |
Almost the same, but everything was somehow polished and evolved, you can take freshiest (apk) release from 4pda theme (not from theme header, but from some last (mine) messages) and check it yourself. |
TTS autostop!!! what a great feature! definitely pulling this into my branch, one way or another. i will skip the motion sensor part tho. i can just hit play every 30min until i actually fall asleep. edit: the second play button you added, is that the one that ignores the autostop? or the one that enforces it |
If you want to discuss KR's features - it is better to do in 4pda theme or in KR's github discussions tab |
return true; | ||
} else if ("org.coolreader.TTS_PLAY".equals(intent.getAction())) { | ||
mReaderView.onCommand(ReaderCommand.DCMD_TTS_PLAY, 0, null); | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it via:
for (ReaderAction ra: ReaderAction.AVAILABLE_ACTIONS) {
String acname = "org.knownreder." + StrUtils.getNonEmptyStr(ra.id, true);
if (acname.equals(intentAction)) {
mReaderView.onCommand(ra.cmd, ra.param, null);
return true;
}
}
I think this is more convient solution
9f79b67
to
fca90bb
Compare
closing in favor of generic impl in #329 |
so, i use the intents in this PR for a bunch of things. i use half-press of my camera button in SFOS to turn pages in coolreader in waydroid.
i think it might be nice to expose (all/many/some) reader commands via intents or a service.