这是indexloc提供的服务,不要输入任何密码
Skip to content

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