Improve auto-show/hide toolbar#2292
Conversation
|
Do the |
|
|
||
| final SettingsValues settingsValues = mSettings.getCurrent(); | ||
| if (hasSuggestionStripView() && settingsValues.mAutoShowToolbar | ||
| && composingSpanEnd != - 1 && newSelStart != oldSelStart + 1 && newSelStart != oldSelStart - 1 && newSelStart != composingSpanEnd) { |
There was a problem hiding this comment.
The difference of 1 is how you detect typing? If so, you should also consider that keys can input multiple characters, and this is not only for customized layouts, but normal for some languages.
There was a problem hiding this comment.
Can you please give me an example to try?
There was a problem hiding this comment.
For example you have क्ष on the hindi compact layout, or a bunch of letters using combining marks on mansi north, e.g. е̄.
There was a problem hiding this comment.
Indeed failed. Interestingly, these multi-character keys result in two onUpdateSelection calls: one with composingSpanEnd == - 1, and another with newSelStart == oldSelStart, at least on my Android 16 device. So I fixed this by adding another condition.
Do you think this is robust enough? I guess this is another reason to make 1 optional as well.
There was a problem hiding this comment.
Interestingly, these multi-character keys result in two onUpdateSelection calls
This is because multiple chars results in InputLogic.onTextInput, which does first finishComposingText, and then commitText, while adding a single codepoint does setComposingText.
Thanks for noticing, I don't really like this inconsitency... noted for the planned RichInputConnection overhaul, if I ever find time for that.
Do you think this is robust enough?
Not sure yet. I'll go over it again, because I had some idea of not using onUpdateSelection at all, but need to find it in my heap of maybe-try-this notes.
I suspect 2. might be unwanted for some users, so better make it optional. 1. should be fine I think. |
|
I think 1 should also be optional. If I type an incorrect word and autocorrect doesn't work, I click on it to select the correct one from the suggestion bar. After this change, I'll have to expand the suggestion bar, which will slow down my typing. Btw, since you are improving the auto-show/hide toolbar, could you please take a look at these issues? #993 #1855 |
@Helium314, your call. Both of these seem to be fixed by this PR. |
# Conflicts: # app/src/main/java/helium314/keyboard/latin/WordComposer.java
Yes, and I now think this should either be a separate PR, or I should add a separate flag. Specifically:
My understanding of Originally, I was also setting I guess I should have documented all of this in the PR description.
This was uncalled for. |
|
Thanks for your explanation with
Sorry, indeed it was. |
|
I found a few problems:
One possible alternative to the The current toolbar showing on selection change might not be a good / robust approach. One alternative (not sure if better) could be to show if |
I checked and it doesn't work for me. |
Should any of this be optional?
Mostly fixes #2281.