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/app): Toggle keyboard update notifications for landscape and tablets #7832

Merged
merged 1 commit into from
Nov 30, 2022

Conversation

darcywong00
Copy link
Contributor

@darcywong00 darcywong00 commented Nov 28, 2022

Fixes #6731

Previously, the Keyman notification of keyboard updates could appear on 3 form factors:

  • phone (portrait orientation) - notification on overflow menu
  • phone (landscape orientation) - notification on menu
  • tablet (> 600dp, either orientation) - notification on menu

The landscape and tablet layouts had a complexity of a dynamic layout "update_count_view" which turned out to be un-clickable.

This PR removes the usage of "update_count_view", and toggles the update icon when updates are available. (This removes the feature of a dynamic count of updates available). The minor loss in feature should be acceptable since long-term we plan to just automatically download keyboard/dictionary updates as they're available (#7171).

User Testing

Setup - For each group, use the Android device and orientation as specified in the test.

  1. On the device, download the old version 1.0 of sil_nko Keyman keyboard
  2. Install the PR build of Keyman for Android

GROUP_PHONE_PORTRAIT - Verifies update installs for phone in portrait orientation
GROUP_PHONE_LANDSCAPE - Verifies update installs for phone in landscape orientation. Note - Keyman always starts up in portrait orientation, so you may need to re-orient the device back and forth to get Keyman in landscape orientation
GROUP_TABLET_LANDSCAPE - Verifies update installs for tablet (either orientation)

TEST_KEYBOARD_UPDATE

  1. Launch Keyman for Android and dismiss the "Get Started" menu
  2. From the Keyman settings menu, install the version 1.0 of the sil_nko keyboard package (Install from local file).
  3. During installation of sil_nko, choose "Mandingo" language
  4. When sil_nko finishes installing, completely exit Keyman
  5. Relaunch Keyman for Android
  6. After a while, see if notifications appear about keyboard updates being available. If they don't appear, completely exit Keyman and try re-launching Keyman for Android.
  7. When there's notifications about Keyman updates being available, click the appropriate menu to "Install Updates"
    • phone portrait - icon from the overflow menu
    • phone landscape - icon on the top menu next to "Settings"
    • tablet - icon on the top menu next to "Settings"
  8. Verify Keyman prompts confirmation to download a keyboard update for sil_nko
  9. Accept the dialog
  10. Verify after a while, the keyboard updates in the background.
  11. Long-press the globe key to display the keyboard picker menu.
  12. Verify the version of sil_nko is now 1.1.

@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Nov 28, 2022

User Test Results

Test specification and instructions

  • ✅ GROUP_PHONE_PORTRAIT: - Verifies update installs for phone in portrait orientation

    1 tests PASSED
    • TEST_KEYBOARD_UPDATE (PASSED): Verified Update Install option for phone in portrait orientation and it is working as expected. (notes)
  • ✅ GROUP_PHONE_LANDSCAPE: - Verifies update installs for phone in landscape orientation. Note - Keyman always starts up in portrait orientation, so you may need to re-orient the device back and forth to get Keyman in landscape orientation

    1 tests PASSED
    • TEST_KEYBOARD_UPDATE (PASSED): Tested this in my Android Mobile device Ver 11.0 with the attached PR build and here is my observation: 1. Verified the Install Updates for phone in landscape orientation and it seems to be working as expected. (notes)
  • ✅ GROUP_TABLET_LANDSCAPE: - Verifies update installs for tablet (either orientation)

    1 tests PASSED
    • TEST_KEYBOARD_UPDATE (PASSED): Retested this in API 30 / Android 11.0 emulator (as per Darcy's suggestion) and here is my observation: 1. Tested this in Landscape orientation. 2. Not able to see the 'Install Update' option near the Settings option. 3. However, I noticed this option is available in the Keyboard menu. 4. By clicking on this would update the Keyboard version from 1.0 to 1.1. Note: In the Portrait orientation, I was able to see the 'Install Update' button near Settings button. (notes)

Test Artifacts

@bharanidharanj
Copy link

GROUP_PHONE_PORTRAIT: - Verifies update installs for phone in portrait orientation

  • TEST_KEYBOARD_UPDATE (PASSED): Verified Update Install option for phone in portrait orientation and it is working as expected.

@bharanidharanj
Copy link

GROUP_PHONE_LANDSCAPE: - Verifies update installs for phone in landscape orientation. Note - Keyman always starts up in portrait orientation, so you may need to re-orient the device back and forth to get Keyman in landscape orientation

  • TEST_KEYBOARD_UPDATE (PASSED): Tested this in my Android Mobile device Ver 11.0 with the attached PR build and here is my observation: 1. Verified the Install Updates for phone in landscape orientation and it seems to be working as expected.

@bharanidharanj
Copy link

Test Results

GROUP_TABLET_LANDSCAPE: - Verifies update installs for tablet (either orientation)

  • TEST_KEYBOARD_UPDATE (FAILED): Tested with the attached PR build in API 31 / Android 12.0 emulator and here is my observation: 1. After clicking the Install Updates icon from the Language menu, there was a confirmation dialog appeared on the Screen. 2. Clicking the Confirmation dialog leads to crash Keyman application.

@darcywong00
Copy link
Contributor Author

@bharanidharanj - the crash you experienced was related to Android S, and I've created issue #7843 to address that.

Can you retest with Android tablet using Android 11.0 (API 30)?

@keymanapp-test-bot retest GROUP_TABLET_LANDSCAPE

@bharanidharanj
Copy link

@bharanidharanj - the crash you experienced was related to Android S, and I've created issue #7843 to address that.

Can you retest with Android tablet using Android 11.0 (API 30)?

@keymanapp-test-bot retest GROUP_TABLET_LANDSCAPE

@darcywong00 Sure, I will retest it in Android 11.0 emulator.

@@ -452,6 +453,11 @@ public boolean onOptionsItemSelected(MenuItem item) {
KMManager.getUpdateTool().executeOpenUpdates();
// Dismiss icon
updateUpdateCountIndicator(0);
final MenuItem _keyboardupdate = menu.findItem(R.id.action_update_keyboards);
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible for menu to be uninitialized at this point?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The system should have called onCreateOptionsMenu() the first time menu is displayed

https://developer.android.com/reference/android/app/Activity#onCreateOptionsMenu(android.view.Menu)

@bharanidharanj
Copy link

GROUP_TABLET_LANDSCAPE: - Verifies update installs for tablet (either orientation)

  • TEST_KEYBOARD_UPDATE (PASSED): Retested this in API 30 / Android 11.0 emulator (as per Darcy's suggestion) and here is my observation: 1. Tested this in Landscape orientation. 2. Not able to see the 'Install Update' option near the Settings option. 3. However, I noticed this option is available in the Keyboard menu. 4. By clicking on this would update the Keyboard version from 1.0 to 1.1. Note: In the Portrait orientation, I was able to see the 'Install Update' button near Settings button.

..Landscape Orientation

..Portrait Orientation

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Nov 29, 2022
@darcywong00 darcywong00 merged commit e78f5fd into beta Nov 30, 2022
@darcywong00 darcywong00 deleted the fix/android/tablet-keyboard-update branch November 30, 2022 01:33
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 16.0.116-beta

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

Successfully merging this pull request may close these issues.

bug(android): "update pending" icon on tablets is not responsive
4 participants