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 - Refactor AvaloniaInputConnection #16490

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

emmauss
Copy link
Contributor

@emmauss emmauss commented Jul 26, 2024

What does the pull request do?

Rewrite parts of AndroidInputConnection to respond to android input more accurately. This implementation is based on compose's InputConnection implementation.

What is the current behavior?

Our current implementation is compatible with GBoard due to its low use of composition apis. But not with some other keyboards, like SwiftKey, that makes extensive use of text composition and prediction. As such, words were being skipped or misplaced in those keyboards.

What is the updated/expected behavior with this PR?

A command queue is now being used to batch ime edits. Each command corresponds to an ime action that would affect the text buffer, like composition, commit, and selection updates. If a batch edit is active(common for composition keyboard like SwiftKey), only when batch edit ends would updates be run on the buffer.
Commands that are run affect the text buffer directly, and updates are forwarded to TextInputMethodClient immediately.

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

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #16392

@avaloniaui-bot
Copy link

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

@emmauss emmauss force-pushed the android-input-connection-refactor branch from c2d1072 to df5e9e4 Compare July 29, 2024 08:31
@avaloniaui-bot
Copy link

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

@maxkatz6 maxkatz6 added enhancement backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Aug 1, 2024
@maxkatz6 maxkatz6 added this pull request to the merge queue Aug 1, 2024
@maxkatz6 maxkatz6 removed this pull request from the merge queue due to a manual request Aug 1, 2024
@maxkatz6 maxkatz6 merged commit 20fe710 into master Aug 1, 2024
12 checks passed
@maxkatz6 maxkatz6 deleted the android-input-connection-refactor branch August 1, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch enhancement os-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextBox input from SwiftKey not consistent with other applications
4 participants