termux-app
termux-app copied to clipboard
Add support for apps supporting PROCESS_TEXT intents.
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_TEXTintent 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 PR :) ).
Here's a demo of selecting text, and opening it in Google Translate, then in Wikipedia:
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.