Skip to content

Commit

Permalink
android: add intents for ReaderAction (e.g.: org.coolreader.cmd.PAGE_UP)
Browse files Browse the repository at this point in the history
  • Loading branch information
teleshoes committed Mar 13, 2022
1 parent c108b68 commit 725039b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions android/src/org/coolreader/CoolReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,16 @@ private boolean processIntent(Intent intent) {
if (uri != null) {
fileToOpen = filePathFromUri(uri);
}
} else {
for (ReaderAction ra: ReaderAction.AVAILABLE_ACTIONS) {
String raIntentName = "org.coolreader.cmd." + ra.id;
if (raIntentName.equals(intent.getAction())) {
mReaderView.onCommand(ra.cmd, ra.param, null);
return true;
}
}
}

if (fileToOpen == null && intent.getExtras() != null) {
log.d("extras=" + intent.getExtras());
fileToOpen = intent.getExtras().getString(OPEN_FILE_PARAM);
Expand Down

0 comments on commit 725039b

Please sign in to comment.