Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Avoid showing Zh-TW and Zh-CN keyboard candidate view when typing symbols. #3507

Merged
merged 2 commits into from
Jun 22, 2020

Conversation

daoshengmu
Copy link
Contributor

Fixes #3506.

When typing symbols, we can just use AUTO_COMPOSE mode.

I was trying to make Zh-CN and JPN keyboard have the same behavior when typing symbols, using AUTO_COMPOSE instead of SHOW_CANDIDATES. But, JPN keyboard will show when inserting /。The only way possible is fixing their code book to avoid it, but it is not worth to do. IMO, We can still rely on their code book to feed our data, iOS JPN keyboard uses the same behavior either.

@daoshengmu daoshengmu requested a review from keianhzo June 16, 2020 01:53
@daoshengmu daoshengmu self-assigned this Jun 16, 2020
@bluemarvin bluemarvin added this to the #11 polish milestone Jun 17, 2020
Copy link
Contributor

@keianhzo keianhzo left a comment

Choose a reason for hiding this comment

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

@daoshengmu This PR makes the Zh-CN and Zh-TW differ in the way they show candidates for symbols. Pinyin shows the candidate view for symbols and Zhuyin doesn't. For what I see in the GBoard for both Pinyin and Zhuyin showing the symbols keyboard hides the candidate view automatically, maybe we should unify that also in our Chinese keyboards? Japanese on the other side composes and keeps the candidate view opened when adding symbols.

Also I'm getting a crash in the Zhuyin keyboard when typing characters and adding a symbol after that:

java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference
        at org.mozilla.vrbrowser.ui.widgets.KeyboardWidget.updateCandidates(KeyboardWidget.java:4)
        at org.mozilla.vrbrowser.ui.widgets.KeyboardWidget.handleText(KeyboardWidget.java:20)
        at org.mozilla.vrbrowser.ui.widgets.KeyboardWidget.onKey(KeyboardWidget.java:34)
        at org.mozilla.vrbrowser.ui.views.CustomKeyboardView.detectAndSendKey(CustomKeyboardView.java:20)
        at org.mozilla.vrbrowser.ui.views.CustomKeyboardView.onModifiedTouchEvent(CustomKeyboardView.java:61)
        at org.mozilla.vrbrowser.ui.views.CustomKeyboardView.onTouchEvent(CustomKeyboardView.java:15)
        at android.view.View.dispatchTouchEvent(View.java:13415)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3060)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2755)
        at org.mozilla.vrbrowser.ui.widgets.UIWidget.handleTouchEvent(UIWidget.java:1)
        at org.mozilla.vrbrowser.input.MotionEventGenerator.generateEvent(MotionEventGenerator.java:8)
        at org.mozilla.vrbrowser.input.MotionEventGenerator.generateEvent(MotionEventGenerator.java:1)
        at org.mozilla.vrbrowser.input.MotionEventGenerator.dispatch(MotionEventGenerator.java:36)
        at org.mozilla.vrbrowser.VRBrowserActivity.lambda$handleMotionEvent$21$VRBrowserActivity(VRBrowserActivity.java:8)
        at org.mozilla.vrbrowser.-$$Lambda$VRBrowserActivity$m-PcHRm-UE8sfHU3H9lbI4GkhBc.run(Unknown Source:14)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

@daoshengmu daoshengmu force-pushed the zhTWKeyboardCandidate branch from 2adc9fe to db26bbb Compare June 18, 2020 18:46
@daoshengmu
Copy link
Contributor Author

It should be solved. I have made Zh-CN and Zh-TW have consistent behaviors.

@daoshengmu daoshengmu changed the title Avoid showing Zh-TW keyboard candidate view when typing symbols. Avoid showing Zh-TW and Zh-CN keyboard candidate view when typing symbols. Jun 18, 2020
@daoshengmu daoshengmu added the QA Attention QA label Jun 18, 2020
@daoshengmu daoshengmu force-pushed the zhTWKeyboardCandidate branch from db26bbb to 432e989 Compare June 18, 2020 19:11
@daoshengmu daoshengmu requested a review from keianhzo June 18, 2020 19:11
@daoshengmu daoshengmu force-pushed the zhTWKeyboardCandidate branch from 432e989 to ef3bc2f Compare June 18, 2020 19:36
Copy link
Contributor

@keianhzo keianhzo left a comment

Choose a reason for hiding this comment

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

Looks consistent now

@keianhzo keianhzo merged commit 77deb30 into master Jun 22, 2020
@keianhzo keianhzo deleted the zhTWKeyboardCandidate branch June 22, 2020 08:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Attention QA
Projects
None yet
3 participants