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

fix(android): Always display HTML banner when suggestions aren't available #9696

Merged
merged 53 commits into from Nov 17, 2023

Conversation

darcywong00
Copy link
Contributor

@darcywong00 darcywong00 commented Oct 6, 2023

Follows #9591 in fixing #9573

With the move to web-based popup key longpresses, Keyman for Android needs to display an image HTML banner for keyboards w/o suggestions. This allows the popup keys to then be displayed in the banner.

Change to KeymanWeb
* On Android device, default to image banner with a black banner "theme".

Change to Keyman Engine for Android

  • Specify a fallback black/gray banner so Keyboard apps will always have a region for popup key longpresses.
  • KMManager.setHTMLBanner() allows developers to pass an HTML blob to use for the banner.

Change to Keyman for Android

  • Use the Keyman theme (with tri-color band) for both in-app and system keyboard
  • Add BannerController helper to apply banner theming

Change to FV for Android

  • Use the FV theme (with gold band) for system keyboard

TODO

  • I'm having issues getting KeymanWeb to display the specified image banner theme on first load. (In-app keyboard banner specified a white banner in MainActivity and system keyboard banner specified a Keyman banner in SystemKeyboard). Thanks to @jahorton for helping me resolve this
  • Apply Android tablet theme
  • Apply FV theme

Current limitations
I'm using the Keyman landscape png as generated by https://elmah.io/tools/base64-image-encoder/
There's notificable distortion as the Android app doesn't do computations like the iOS image banner.
Perhaps this can all be moved to KeymanWeb?

This is now resolved using svg within the HTML blob.

Original Screenshots

(edited) These are all obsolete with the svg/html refactor

In-app keyboard

white image banner when suggestions not available
inapp white banner after toggles

System keyboard

Keyman banner when suggestions not available
system keyman after toggles

Keyman banner in landscape
system keyman landscape

KMSample2

Test app with Tamil dictionary temporarily disabled to show custom light-blue theme

image

FV for Android

image

User Testing

Setup - Install the PR build of the corresponding Android app on an Android device/emulator of SDK 21

  • TEST_KEYMAN_PHONE Verifies theme shows on in-app and system keyboard (when suggestion banner isn't used)
  1. Install Keyman for Android
  2. With the phone in Portrait orientation from the Keyman app, install a keyboard that doesn't use a dictionary (e.g. sil_ipa). Note, the shift key sometimes registers as a camera control in the emulator, so maybe search for ipa instead of sil_ipa.
  3. When the sil_ipa keyboard is installed, verify the suggestion banner is replaced with a white white banner
  4. Verify you can long-press keys on top row and they appear in the image banner
  5. From Keyman settings, enable Keyman as the default system keyboard.
  6. Rotate the device to landscape orientation
  7. Verify the Keyman banner on the keyboard fills the keyboard width.
  8. Rotate the device back to portrait orientation
  9. Launch a separate app (e.g. Google Chrome)
  10. In Google Chrome, select a text field and switch to Keyman sil_ipa keyboard
  11. Verify the sil_ipa keyboard shows a Keyman image banner
  12. Verify you can long-press keys on the top row and they appear in the image banner.

flex style

  • TEST_FV - Verifies theme on FirstVoices system keyboard (when suggestion banner isn't used)
  1. Install FirstVoices for Android
  2. With the phone in Portrait orientation from the FV app, install:
  • BC Coast --> Haisla (a keyboard that doesn't use a dictionary)
  • BC Coast --> SENCOTEN (a keyboard that does use a dictionary)
  1. From the FV app, set FV as the default system keyboard
  2. Launch a separate app (e.g. Google Chrome)
  3. In Google Chrome, select a text field and switch to the FV Haisla keyboard
  4. Verify the FV keyboard shows with a red FirstVoices banner
  5. Verify you can long-press keys on the top row and they appear in the image banner.
  6. Use the globe key to switch to the FV Sencoten keyboard
  7. Verify the FV keyboard shows suggestions

fv flex

@keymanapp-test-bot keymanapp-test-bot bot added the user-test-missing User tests have not yet been defined for the PR label Oct 6, 2023
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Oct 6, 2023

User Test Results

Test specification and instructions

  • TEST_KEYMAN_PHONE (PASSED): Retested with the attached PR build Keyman 17.0.212-alpha-test-9696 in an Android (ver 5.0) emulator (API 21) and here is my observation: 1. Installed sil_ipa keyboard. Verified that the suggestion banner is replaced with a white banner. Also, verified that the long-press keys on to row and they appeared in the image banner. 2. Changed to Landscape orientation and verified that the suggestion banner appeared as expected. 3. Set the Keyman as the system-wide and default keyboard. 4. Opened a browser window. Typed in the Search bar. Able to see the Keyman banner appears in the sil_ipa keyboard. (notes)
  • TEST_FV (PASSED): Tested with the attached PR build FirstVoices 17.0.212-alpha-test-9696 in an Android (ver 5.0) emulator (API 21) and here is my observation: 1. After setting FirstVoices keyboard as the system keyboard. 2. Opened the browser window. Clicked the Google Search bar. 3. Able to see the FirstVoices banner on the Haisla keyboard. 4. Switch to the Sencoten keyboard. 5. Verified the Suggestion bar appears on the top of the keyboard. (notes)

Test Artifacts

@mcdurdin mcdurdin modified the milestones: A17S23, A17S24 Oct 15, 2023
@github-actions github-actions bot added the oem/ label Oct 26, 2023
@darcywong00
Copy link
Contributor Author

@bharanidharanj caught that the banner doesn't refresh when KeymanWeb reloads. I've added a commit to fix Keyman and FV apps.

@keymanapp-test-bot retest TEST_KEYMAN_PHONE

@bharanidharanj
Copy link

@bharanidharanj caught that the banner doesn't refresh when KeymanWeb reloads. I've added a commit to fix Keyman and FV apps.

@keymanapp-test-bot retest TEST_KEYMAN_PHONE

@darcywong00 Okay, Thanks.

@bharanidharanj
Copy link

Test Results

  • TEST_KEYMAN_PHONE (FAILED): Retested with the updated build (Keyman 17.0.212-alpha-test-9696) in an Android 5.0 (API 21) emulator and I can reproduce this issue. (ie., Keyman banner is missing after swapping the keyboard using the globe key in the browser view)

  • TEST_FV (FAILED): Tested with the attached PR build FirstVoices 17.0.212-alpha-test-9696 in an Android (ver 5.0) emulator (API 21) and here is my observation: 1. After setting FirstVoices keyboard as the system keyboard, I opened the browser window. 2. Set Haisla FirstVoices keyboard as the system keyboard and noticed that the banner is missing on the OSK.

@keymanapp-test-bot keymanapp-test-bot bot added user-test-failed and removed user-test-required User tests have not been completed labels Nov 17, 2023
@darcywong00
Copy link
Contributor Author

@bharanidharanj - I cannot repro the blank banners you saw. Did find a typo and pushed an update.
Did you uninstall the previous apps and delete the previous apk's when you retest?

@keymanapp-test-bot retest

@keymanapp-test-bot keymanapp-test-bot bot added user-test-required User tests have not been completed and removed user-test-failed labels Nov 17, 2023
@bharanidharanj
Copy link

@bharanidharanj - I cannot repro the blank banners you saw. Did find a typo and pushed an update. Did you uninstall the previous apps and delete the previous apk's when you retest?

@keymanapp-test-bot retest

@darcywong00 Yes, Darcy. I have uninstalled the previous apps and deleted the previous apk files before the retest. I am getting this error (black banner) when I opened the keyman keyboard (as a system keyboard) in the browser view. Anyhow, I will retest it. Thanks.

@bharanidharanj
Copy link

Test Results

  • TEST_KEYMAN_PHONE (PASSED): Retested with the attached PR build Keyman 17.0.212-alpha-test-9696 in an Android (ver 5.0) emulator (API 21) and here is my observation: 1. Installed sil_ipa keyboard. Verified that the suggestion banner is replaced with a white banner. Also, verified that the long-press keys on to row and they appeared in the image banner. 2. Changed to Landscape orientation and verified that the suggestion banner appeared as expected. 3. Set the Keyman as the system-wide and default keyboard. 4. Opened a browser window. Typed in the Search bar. Able to see the Keyman banner appears in the sil_ipa keyboard.

keymanlongpress

  • TEST_FV (PASSED): Tested with the attached PR build FirstVoices 17.0.212-alpha-test-9696 in an Android (ver 5.0) emulator (API 21) and here is my observation: 1. After setting FirstVoices keyboard as the system keyboard. 2. Opened the browser window. Clicked the Google Search bar. 3. Able to see the FirstVoices banner on the Haisla keyboard. 4. Switch to the Sencoten keyboard. 5. Verified the Suggestion bar appears on the top of the keyboard.

..Haisla keyboard

..Sencoten keyboard

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Nov 17, 2023
@darcywong00 darcywong00 merged commit cb1b995 into master Nov 17, 2023
5 checks passed
@darcywong00 darcywong00 deleted the fix/android/image-banner branch November 17, 2023 10:54
@darcywong00 darcywong00 linked an issue Nov 17, 2023 that may be closed by this pull request
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 17.0.213-alpha

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

Successfully merging this pull request may close these issues.

change(android): Web-based popup key longpressses
5 participants