Skip to content

fix(android): Update KMSample1 layout when changing orientation#14678

Merged
darcywong00 merged 1 commit intomasterfrom
fix/android/sample1-rotation
Sep 4, 2025
Merged

fix(android): Update KMSample1 layout when changing orientation#14678
darcywong00 merged 1 commit intomasterfrom
fix/android/sample1-rotation

Conversation

@darcywong00
Copy link
Copy Markdown
Contributor

Fixes #14677

This updates the KMSample1 app with several of the fixes in the Keyman for Android app for handling device orientation changes. (notably part of #8704)

The text area also needs to be resized to accommodate banner/keyboard dimensions which are different between portrait and landscape orientation.

User Testing

Setup - Install the PR build of KMSample1 on an Android device/emulator

  • TEST_ROTATION - Verifies text area not covered when rotating device
  1. Start KMSample1 with the device in portrait orientation
  2. Verify text area visible and keyboard and suggestions work
  3. Rotate the device to landscape
  4. Verify text area visible and keyboard and suggestions work]

@darcywong00 darcywong00 added this to the A19S11 milestone Sep 3, 2025
@github-project-automation github-project-automation bot moved this to Todo in Keyman Sep 3, 2025
@keymanapp-test-bot keymanapp-test-bot bot added has-user-test user-test-required User tests have not been completed labels Sep 3, 2025
@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot bot commented Sep 3, 2025

@Nnyny
Copy link
Copy Markdown
Contributor

Nnyny commented Sep 3, 2025

Test Results

Before testing:
- Install KMSample1 from Build #19.0.112-alpha-test-14678 on API 34

  • TEST_ROTATION (PASSED): notes
  1. Launch KMSample 1
  2. Messages: data/user/... and error on keyboard...
  3. Verify the keyboard and dictionary are working fine
  4. Rotate to landscape
  5. Verify the keyboard and dictionary are working fine

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Sep 3, 2025
getTheme().resolveAttribute(android.R.attr.actionBarSize, outValue, true);
int actionBarHeight = getResources().getDimensionPixelSize(outValue.resourceId);

// *** TO DO: Try to check if status bar is visible, set statusBarHeight to 0 if it is not visible ***
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There an issue for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That TODO has been around since the original version 2.8

// *** TO DO: Try to check if status bar is visible, set statusBarHeight to 0 if it is not visible ***
int statusBarHeight = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0)
statusBarHeight = getResources().getDimensionPixelSize(resourceId);

Tracking as #14682

@darcywong00 darcywong00 merged commit cee2368 into master Sep 4, 2025
8 checks passed
@darcywong00 darcywong00 deleted the fix/android/sample1-rotation branch September 4, 2025 00:34
@github-project-automation github-project-automation bot moved this from Todo to Done in Keyman Sep 4, 2025
@keyman-server
Copy link
Copy Markdown
Collaborator

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

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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

bug(android): KMSample1 text area obstructed when rotating to landscape

4 participants