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

Add support for apps supporting PROCESS_TEXT intents. #3720

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

caarmen
Copy link

@caarmen caarmen commented Dec 2, 2023

In the context menu that appears when a user selects text, add a new submenu which includes third-party activities which handle the PROCESS_TEXT intent. This will allow processing the selected text in other apps.

Some links about this type of interaction with other apps:

Since the text selection menu is customized in termux, if we want the text selection menu to include this functionality, we have to add it ourselves (this PR :) ).

Here's a demo of selecting text, and opening it in Google Translate, then in Wikipedia:

process_text.webm

In the context menu that appears when a user selects text, add a new submenu which includes third-party activities which handle the `PROCESS_TEXT` intent. This will allow processing the selected text in other apps.

Some links about this type of interaction with other apps:
* Manifest config required to work on Android 30+: https://developer.android.com/training/package-visibility/use-cases
* `PROCESS_TEXT` intent action: https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT)
* Blog post by Ian Lake on how to make an app appear in the system text selection menu: https://medium.com/androiddevelopers/custom-text-selection-actions-with-action-process-text-191f792d2999

Since the text selection menu is customized in termux, if we want the text selection menu to include this functionality, we have to add it ourselves (this commit :) ).
@agnostic-apollo
Copy link
Member

Thanks for the pull, this looks good and mergable in essence. Will have to test it and will merge with the others before next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants