Avalonia
Avalonia copied to clipboard
[Android] Support `PerformContextMenuAction`
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
https://github.com/AvaloniaUI/Avalonia/assets/43789618/ed788058-6278-4203-bd82-2ea8255d3e9d
What is the updated/expected behavior with this PR?
App will react when press copy/paste/cut/select-all button on IME now
https://github.com/AvaloniaUI/Avalonia/assets/43789618/cb52adbe-4f79-4611-828c-649ec33a1c2c
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
- [ ] Added unit tests (if possible)?
- [ ] Added XML documentation to any related classes?
- [ ] Consider submitting a PR to https://github.com/AvaloniaUI/avalonia-docs with user documentation
Breaking changes
Obsoletions / Deprecations
Fixed issues
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]
@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.
All this should go through the TextInputMethodClient so y we need to add some API for inserting and deleting
So I should wait for the API changed?
any updates?
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
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]
When will this be contained in the Release? (In the 11.1.0 rc)
@Tangent-90 it will be in 11.1.1 release.
@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.