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

[Android] Support PerformContextMenuAction #15608

Merged

Conversation

ijklam
Copy link
Contributor

@ijklam ijklam commented May 4, 2024

What does the pull request do?

Support PerformContextMenuAction so that application can react on IME copy paste command

What is the current behavior?

App will not react when press copy/paste/cut/select all button on IME

Screenrecorder-2024-05-05-01-17-09-49.mp4

What is the updated/expected behavior with this PR?

App will react when press copy/paste/cut/select-all button on IME now

Screenrecorder-2024-05-05-01-20-50-906.mp4

How was the solution implemented (if it's not obvious)?

When press copy/paste/cut/select-all button, the Android IME will call BaseInputConnection.performContextMenuAction(int id) to make command work

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0048080-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6
Copy link
Member

maxkatz6 commented May 4, 2024

@Gillibald @emmauss don't we have a better API in the IME for that? If not, it might make sense to add, instead of creating fake hotkey input.

@Gillibald
Copy link
Contributor

Gillibald commented May 5, 2024

All this should go through the TextInputMethodClient so y we need to add some API for inserting and deleting

@ijklam
Copy link
Contributor Author

ijklam commented May 5, 2024

So I should wait for the API changed?

@ijklam
Copy link
Contributor Author

ijklam commented May 9, 2024

any updates?

@Gillibald
Copy link
Contributor

We need a common way of executing known context Manu action. Ideally an enum with known action names.

TextInputMethodClient will then expose ExecuteContextMenuAction or similar

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0048280-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added the backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch label May 10, 2024
@maxkatz6 maxkatz6 merged commit 7a7bee4 into AvaloniaUI:master May 10, 2024
10 checks passed
@ijklam
Copy link
Contributor Author

ijklam commented Jul 9, 2024

When will this be contained in the Release? (In the 11.1.0 rc)

@maxkatz6
Copy link
Member

maxkatz6 commented Jul 9, 2024

@Tangent-90 it will be in 11.1.1 release.

@ijklam
Copy link
Contributor Author

ijklam commented Aug 10, 2024

@Tangent-90 it will be in 11.1.1 release.

It is 11.1.2 now, but this and #15603 still not be released. Including these will improve the input expression on Android devices.

And I really need these features.

maxkatz6 pushed a commit that referenced this pull request Aug 12, 2024
* support PerformContextMenuAction

* update

* update to new api
@maxkatz6 maxkatz6 added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Aug 12, 2024
Copy link

@Luis804x Luis804x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎

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

Successfully merging this pull request may close these issues.

5 participants