Skip to content
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

Added context menu option when text is selected. #935

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions omniNotes/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@
<data android:scheme="hashtag" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.PROCESS_TEXT" />

<category android:name="android.intent.category.DEFAULT" />

<data android:mimeType="text/plain" />
</intent-filter>

</activity>

<!-- Gallery -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ private void handleIntents() {

// Handles third party apps requests of sharing
if (IntentChecker
.checkAction(i, Intent.ACTION_SEND, Intent.ACTION_SEND_MULTIPLE, INTENT_GOOGLE_NOW)
.checkAction(i, Intent.ACTION_SEND, Intent.ACTION_SEND_MULTIPLE, Intent.ACTION_PROCESS_TEXT, INTENT_GOOGLE_NOW)
&& i.getType() != null) {

afterSavedReturnsToList = false;
Expand All @@ -537,7 +537,13 @@ private void handleIntents() {
}

// Text content
String content = i.getStringExtra(Intent.EXTRA_TEXT);
String content = null;
if (Intent.ACTION_PROCESS_TEXT.equals(i.getAction())){
content = i.getStringExtra(Intent.EXTRA_PROCESS_TEXT).toString();
} else {
content = i.getStringExtra(Intent.EXTRA_TEXT);
}

if (content != null) {
noteTmp.setContent(content);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@ private boolean receivedIntent(Intent i) {
|| ACTION_WIDGET_TAKE_PHOTO.equals(i.getAction())
|| ((Intent.ACTION_SEND.equals(i.getAction())
|| Intent.ACTION_SEND_MULTIPLE.equals(i.getAction())
|| INTENT_GOOGLE_NOW.equals(i.getAction()))
|| INTENT_GOOGLE_NOW.equals(i.getAction())
|| Intent.ACTION_PROCESS_TEXT.equals(i.getAction()))
&& i.getType() != null)
|| i.getAction().contains(ACTION_NOTIFICATION_CLICK);
}
Expand Down