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

bug(android): Keyboard is flashing behind the Keyboard picker menu after clicking the Info icon #8868

Closed
1 of 8 tasks
bharanidharanj opened this issue May 29, 2023 · 2 comments · Fixed by #10017
Closed
1 of 8 tasks

Comments

@bharanidharanj
Copy link

bharanidharanj commented May 29, 2023

Describe the bug

I noticed that the keyboard background is blinking every time whenever I click the keyboard info icon in the Keyboard Picker menu.

Reproduce the bug

  1. Install Keyman 17.0.113-alpha build.
  2. Open Keyman In-App.
  3. Download and install Khmer Angkor keyboard.
  4. Long press the globe key to open the Keyboard picker menu.
  5. Click the Info (i) icon against the Central Khmer (Khmer, Cambodia..) label name.
  6. Here, I noticed that the Keyman app which is running behind the Keyboard picker menu is blinking.

I have attached the video file for reference.

keyboardblinking.mp4

Expected behavior

Clicking the Info icon in Keyboard picker menu should not affect the Keyman keyboard background.

Related issues

#8007

Keyman apps

  • Keyman for Android
  • Keyman for iPhone and iPad
  • Keyman for Linux
  • Keyman for macOS
  • Keyman for Windows
  • Keyman Developer
  • KeymanWeb
  • Other - give details at bottom of form

Keyman version

17.0.113-alpah build

Operating system

Android 5.0, 9.0, 12.0

Device

Redmi Note 8 Pro, API 31 emulator

Target application

No response

Browser

No response

Keyboard name

No response

Keyboard version

No response

Language name

No response

Additional context

No response

@bharanidharanj bharanidharanj changed the title bug(android): Keyman background is blinking If I click the keyboard info icon using Keyboard picker menu bug(android): Keyboard is flashing behind the Keyboard picker menu after clicking the Info icon May 29, 2023
@jahorton
Copy link
Contributor

jahorton commented May 30, 2023

See also: #8007. It's the same sort of flicker seen there.

@mcdurdin mcdurdin added this to the 17.0 milestone Jun 6, 2023
@mcdurdin mcdurdin modified the milestones: 17.0, A17S25 Aug 4, 2023
@mcdurdin mcdurdin modified the milestones: A17S25, A17S26 Nov 13, 2023
@jahorton
Copy link
Contributor

jahorton commented Nov 16, 2023

After fixing #8534 and synchronizing all pending entries in the JS queue as they come in, I did an analysis of all the re-layout calls for the keyboard for three cases. I'll log the entries and relevant call-stack data below:

App Load

First setLayoutParams call:

  • initKeyboard:631, KMManager (com.keyman.engine)
    • page hasn't even had a -chance- to load yet.
    • have not yet connected:
      • WebView client
      • JS interface object
      • no loadKeyboard() call yet
        • which doesn't even try to directly load the user's kbd.
  • initialize:410, KMManager (com.keyman.engine)

Second:

  • during creation of the MAIN app view. It's a big stack that's not terribly informative otherwise.
  • Is triggered as a result of:
    • onCreate:191, MainActivity (com.tavultesoft.kmapro)

But way, way down the line as part of Android-internal stuff.

Third:

  • onConfigurationChanged:750, KMManager (com.keyman.engine)
  • onResume:272, MainActivity (com.tavultesoft.kmapro)

Fourth:

  • onConfigurationChanged:419, KMKeyboard (com.keyman.engine)
  • onConfigurationChanged:751, KMManager (com.keyman.engine)
  • onResume:272, MainActivity (com.tavultesoft.kmapro)

** Main app screen finally appears, Get Started shows. **

Fifth:

  • registerLexicalModel:1335, KMManager (com.keyman.engine)
    • have not inspected the properties of the params or the sources at this stage.
    • Upon drill-down, is dependent upon the state of KMKeyboard.java, field currentBanner.
    • No clear, direct update of its state by registerLexicalModel, though.
  • registerAssociatedLexicalModel:1399, KMManager (com.keyman.engine)
  • pageLoaded:105, KMKeyboardWebViewClient (com.keyman.engine)
    • is after the setKeyboard call, but synchronous.
  • shouldOverrideUrlLoading:139, KMKeyboardWebViewClient (com.keyman.engine)
  • onPageFinished:63, KMKeyboardWebViewClient (com.keyman.engine)

Sixth:

(System keyboard) is active; the actual desired keyboard hasn't shown yet.

  • shouldOverrideUrlLoading:179, KMKeyboardWebViewClient (com.keyman.engine)
    • branch: refreshBannerHeight
    • this branch sets the previously-noted currentBanner just before triggering the Android-side re-layout.
  • onPageFinished:63, KMKeyboardWebViewClient (com.keyman.engine)
    • Appears to be triggered by the page:
      url: file:///data/user/0/com.tavultesoft.kmapro.debug/app_data/keyboard.html#refreshBannerHeight-2+change=active
    • Thus... the webview hasn't visibly updated, but the model loaded.
      • ... and it's the model's load that triggered the final check.
      • triggered by android-host.js, onStateChange, a handler that detects when the prediction mode changes within Web.

There is no seventh.

Keyboard with predictions -> keyboard without predictions

sil_euro_latin -> sil_ipa

First:

  • shouldOverrideUrlLoading:179, KMKeyboardWebViewClient (com.keyman.engine)
    • branch: refreshBannerHeight
  • onPageFinished:63, KMKeyboardWebViewClient (com.keyman.engine)

And that's it!

Keyboard without predictions -> keyboard with predictions

sil_ipa -> sil_euro_latin

First:

  • registerLexicalModel:1336, KMManager (com.keyman.engine)
  • registerAssociatedLexicalModel:1401, KMManager (com.keyman.engine)
  • switchToNextKeyboard:1614, KMManager (com.keyman.engine)
  • doGlobeKeyShortpressAction:568, KMManager (com.keyman.engine)
  • ... (triggered by globe-key press)

Second:

  • shouldOverrideUrlLoading:179, KMKeyboardWebViewClient (com.keyman.engine)
  • onPageFinished:63, KMKeyboardWebViewClient (com.keyman.engine)

Note: no device rotations were performed during this investigation; I imagine that's covered by onConfigurationChanged, but am presently not 100% sure about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants