-
-
Notifications
You must be signed in to change notification settings - Fork 379
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
Major rework of input logic, connection handling and state management #1822
Conversation
Not optimized for performance yet, some features are broken in this commit. See the following commits for improvements in the changes of this commit.
Base for further work on the split and input cache expected caching
but keep logic separate in an abstract and a normal class
Wow, that lag in input seems to have been fixed! Even on debug builds, it works fast even right after installation or force close! That was a pretty major issue, and it feels great that it's now fixed.
|
Thanks for testing it out! Great to hear that it works more smoothly now, that's one of the major goals of this rework. Regarding the issues you mentioned: The last pushed commits have fixed the glide phantom space behavior, on a new line there's now no additional space appended. However the shift key logic in general is a bit buggy and needs some tweaking, I think though that I will fix this in beta02. |
which results from the keyboard. Fast cursor movement from the editor currently is still a laggy experience.
This PR aims to improve the way internal key events are processed, how the text of the editor is cached and how the state of the input logic is managed. A lot of testing and re-evaluation has gone into this rework, and there's still some things to do to fix up bugs and other issues.
Major changes
Minimum API level raised from 23 to 24
(Android 6 --> Android 7)
This step was hard to decide because I had to carefully weigh in the effect of discontinuing support for devices running Android 6. I only have limited data (bug reports and GPlay) for device distribution, but going from that only a tiny tiny fraction of my user base is still on Android 6, so I decided that the benefits outweigh the drawbacks of raising the minimum API level by far.
Why was there even the need to consider this step?
Well simple answer: FlorisBoard now makes use (and will even more in the future) of the
android.icu.text
platform package, which exposes the system installed ICU module to the app via Java APIs. This allows me to easily analyze complex Unicode strings and find word and character boundaries, something which is really important for correct input behavior and for the upcoming word suggestions. While with most APIs there's a simple workaround by usingif..else
statements for lower API levels, forandroid.icu.text
however there's sadly no easy way to substitute its feature set on devices prior to Android 7.Editor caching
To improve input performance, FlorisBoard now caches the input for rich input connections locally (currently 256 characters around the cursor + any selected text) and predicts the new cache state for many user actions. If the selection update callback metadata matches with the prediction it means we do not have to re-fetch the editor text and thus save a lot of IPC-roundtrip time, which, depending on the app, can be massive.
Input event dispatcher changes
The input event dispatcher has been reworked to remove the async channel logic entirely. This logic was a common source of state bugs and other weird state mismatches and has been replaced by a concurrent model for managing active keys and their repeating/long press actions.
Other changes / fixes
Closes #374
Closes #524
Closes #637
Closes #828
Closes #1036
Closes #1037
Closes #1541
Closes #1617
Closes #1712
Closes #1733
Closes #1792