Commit graph

1779 commits

Author SHA1 Message Date
Eberhard Beilharz
dc47e32b87 fix(android): address code review comments
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-09-22 06:08:50 +02:00
Eberhard Beilharz
a89dd1bed0 fix(android): fix setting font
PR #16146 introduced a problem with selecting a different font as
display font so that we always ended up with not setting the font.
This was caused by the font filenames now being a URL (which is necessary
because they get processed by the web engine). However, the Android code
checks for the existence of the font in order to create the typeface,
which only works for local paths.

This PR modifies and simplifies `KMKeyboard.getFontFilename` to return the
full path, renames `KMKeyboard.txtFont` and `KMKeyboard.oskFont` to make
it clearer that they contain a path and not a URL.

Also initialize `KMKeyboard.oskFontPath` with empty string instead of
`null`. This makes it consistent with` txtFontPath` and with the
documented behavior of `KMManager.getKeyboardOskFontFilename()` (which
returns `KMKeyboard.oskFontPath`).

Follows: #16146
Fixes: #16187
Build-bot: release:android
2026-09-22 06:08:48 +02:00
Marc Durdin
65b02ae75f fix(android): skip test on Windows that triggers androidx WebKit bug
Fixes: #16183
Test-bot: skip
2026-09-22 06:08:19 +02:00
Eberhard Beilharz
bdef84ebb4 fix(android): suppress error for fallback keyboard
Cherry-pick-of: #16146

We use SIL EuroLatin as fallback keyboard. If that is not installed,
previously we output an error which showed up as a toast for the user.
This change now outputs a warning instead of the error for the default
keyboard.

Also changed the KeyboardHarness test app to set a different keyoard as
default.
2026-09-21 10:14:52 -05:00
Eberhard Beilharz
9a04726d3a fix(android): fix typo 2026-09-21 10:10:06 -05:00
Eberhard Beilharz
ed21a0f780 fix(android): fix problem with fonts
The default fonts (DejaVueSans.ttf and keymanweb-osk.ttf) are located in
the root directory, not the package directory. This fixes the
KeyboardHarness test app.

Also some improvements with variable and function names to better match
what they do.
2026-09-21 10:10:06 -05:00
Eberhard Beilharz
8f3ce341f8 fix(android): fix failing test on Windows
On Windows the tests failed because the AppData directory doesn't yet
exist under an allowed app internal storage path. This change creates
the directory first when running tests.
2026-09-21 10:10:05 -05:00
Eberhard Beilharz
aee5620dbf fix(android): add tests for WebViewUtils.buildAssertUrl
Also fix `assertEquals` in that test file - the parameter ordering is
`expected, actual` but we had it the other way round which gives a
confusing message if the test fails.
2026-09-21 10:09:59 -05:00
Eberhard Beilharz
48b03579f3 chore(android): address code review comments
Co-authored-by: Marc Durdin <marc@durdin.net>
2026-09-21 10:04:41 -05:00
Eberhard Beilharz
1f3fabda78 fix(android): fix loading of keyboards on Android
This change moves to using `WebViewAssetLoader` for loading files from
the device instead of using file:// URLs. This fixes the blank keyboard
problem reported in #16096 for Android.

Also make `KMKeyboard.getKeyboardRoot()` private, and rename public
`Keyboard.getKeyboardPath()` to private `Keyboard.getKeyboardUrl()`.

Part-of: #16096
2026-09-21 10:04:38 -05:00
Eberhard Beilharz
3202632780 maint(android): update Android Target API to 36 🍒
This change updates the Android Target API to 36 to satisfy the upcoming
annual Play Store Aug 31 requirement. It updates Keyman for Android to
use API level 36 by changing the compileSdk and targetSdkVersion
properties to 36.

Also update `compileSdkVersion` and some reformatting in `README.md`.

Changes made by AI (Gemini 3 Flash Preview).

Fixes: #16279
Build-bot: release:android
Cherry-pick-of: #16280
2026-09-21 10:35:27 +02:00
Eberhard Beilharz
5883c9092f
chore(android): log legacy cloud keyboards 🍒
This adds a Sentry log if a user is still using legacy cloud keyboards.
We do this so that we will learn if there are still users out there
or if we can remove the code that deals with those keyboards.

Cherry-pick-of: #16237
Test-bot: skip
2026-07-14 18:13:52 +02:00
Darcy Wong
6cb9749256 fix(android): Refactor bottom inset calculations for inapp and system 2025-10-09 06:42:57 +07:00
Darcy Wong
94535521fd cherrypick(android): Apply bottom insets to system keyboard 2025-09-25 20:56:52 +07:00
Darcy Wong
51645c1e91 fix(android): Cl;eanup list layout in Engine and FirstVoices for edge to 2025-09-02 07:36:00 +07:00
Darcy Wong
3735b10a76 fix(android): Fix insets for in-app vs system keyboard 2025-08-29 08:05:00 +07:00
Darcy Wong
cbcb2cc2a2 fix(android): Update other activities for edge to edge 2025-08-25 09:44:36 +07:00
Darcy Wong
6d07af25b2 fix(android): Convert Keyman app layout to use ConstraintLayout 2025-08-25 09:44:35 +07:00
Darcy Wong
16ea45f9f7 fix(android): Update to Java 21 and Gradle dependencies 2025-08-25 09:00:06 +07:00
Darcy Wong
e2b5063f30 fix(android): Update Android Target API to 35 2025-08-22 11:26:44 +07:00
Darcy Wong
5aa99752c9
Merge pull request #14560 from keymanapp/fix/android/sentry-7
fix(android): Update sentry-android dependency to 7.22.6 for 16 KB page alignment 🍒 🏠
2025-08-21 07:45:42 +07:00
Darcy Wong
764aec33d0 fix(android): Update sentry-android to 7.22.6 2025-08-20 09:14:20 +07:00
Joshua Horton
08a69b95d5 change(android): check globalThis before polyfill 2025-08-19 08:35:16 -05:00
Joshua Horton
0e8f34a2b3 docs(android): add min Chrome version in polyfill doc 2025-08-19 08:35:16 -05:00
Joshua Horton
2cee36e86b fix(android): polyfill globalThis for API 28 devices
Fixes: #14450
Cherry-pick-of: #14541
2025-08-19 08:35:07 -05:00
Darcy Wong
7c3f91c415 fix(android): Get default sizes before initializing keyboard 2025-08-07 10:55:12 +07:00
Joshua Horton
261283d356 change(android): address PR review concerns 2025-05-21 08:08:24 +07:00
Joshua Horton
c193c3fe17 feat(android): log installed keyboard count 2025-05-21 08:08:24 +07:00
Joshua Horton
5116c3e749 feat(android): log active keyboard, model IDs with reported errors
Cherry-pick-of: #13983

To facilitate code investigation and issue repro attempts, we should log the
engine's current keyboard, language code, and model when reporting errors.

Fixes: KEYMAN-ANDROID-71V

(As this adds Sentry logging, I needed a reliable error with inspectable logs
for development.)

Test-bot: skip
2025-05-21 08:08:24 +07:00
Darcy Wong
b56a02fdf8 fix(android): Downgrade UnknownHostException error to info
Fixes KEYMAN-ANDROID-51P
2025-04-09 13:15:16 +07:00
Darcy Wong
0d2c001e48
Merge pull request #13681 from keymanapp/chore/common/crowdin-km
chore(android,mac,windows): update Crowdin strings for Khmer
2025-04-07 15:57:35 +07:00
Darcy Wong
8d012bb8a1 chore(android): Update crowdin strings for Khmer 2025-04-07 08:52:16 +07:00
Darcy Wong
9ff6858613 chore(android): Update crowdin strings for Czech 2025-04-07 08:41:03 +07:00
Darcy Wong
3bd69f182e fix(android): Adjust keyboard height for 10" tablet landscape 2025-04-04 08:36:05 +07:00
Darcy Wong
8cc35dfdf3 fix(android): Adjust keyboard and banner height for 7" tablet 2025-04-04 07:42:54 +07:00
Darcy Wong
de0e8faf0e fix(android): Add keyboard and banner dimensions for xhdpi portrait 2025-04-03 11:03:28 +07:00
Darcy Wong
3ee17bf421 chore(android): Merge remote-tracking branch 'origin/beta' into fix/android/banner-heights
# Keyman Conventional Commit suggestions:
#
# - Link to a Sentry issue with git trailer:
#     Fixes: _MODULE_-_ID_
# - Give credit to co-authors:
#     Co-authored-by: _Name_ <_email_>
# - Use imperative, present tense ('attach' not 'attaches', 'attached' etc)
# - Don't include a period at the end of the title
# - Always include a blank line before trailers
# - More: https://github.com/keymanapp/keyman/wiki/Pull-Request-and-Commit-workflow-notes
2025-04-03 09:46:46 +07:00
Darcy Wong
231d9e3b6b
Merge branch 'beta' into cherrypick/android/13578-adjust-keyboard-height 2025-04-03 09:44:29 +07:00
Darcy Wong
376fbc1515 fix(android): Add hdpi dimensions 2025-04-03 08:26:07 +07:00
Darcy Wong
a392242923 fix(android): Adjust baseline heights for landscape
values-land/dimens.xml tested with 5.1" WVGA emulator
2025-04-03 07:05:38 +07:00
Darcy Wong
4d4508d4c7
Merge pull request #13595 from keymanapp/chore/crowdin/mon
chore(common): Update crowdin strings for Mon
2025-04-02 10:38:41 +07:00
Darcy Wong
e894f79880
Merge pull request #13592 from keymanapp/fix/android/430dpi
fix(android): Add dimensions for 320+dpi phones in landscape
2025-04-02 08:41:00 +07:00
Darcy Wong
afbe3d00cf fix(android): Update the keyboard height
Per review comment
2025-04-01 14:56:25 +07:00
Marc Durdin
690d62ca3f fix(android): Move responsibility for setting keyboard height preference
Cherrypick of #13578 to beta

Moves responsibility for setting keyboard height preference into `applyKeyboardHeight()`
2025-04-01 14:10:55 +07:00
Darcy Wong
bbf249b64c chore(android): Remove whitespace 2025-04-01 10:16:08 +07:00
Darcy Wong
6547458a3c fix(android): Make banner smaller
Following review suggestion for banner not to be more than 1/4 of the main keyboard body.
2025-03-31 13:37:23 +07:00
Darcy Wong
39eebaa257 chore(common): Update crowdin strings for Mon 2025-03-28 09:15:42 +07:00
Darcy Wong
5871df98b6 fix(android): Modify dimens.xml for 320dpi device
User requested a taller default keyboard height for a Pixel 8a device in landscape (430dpi corresponding to xhdpi). The next tier xxhdpi is for 480+ dpi.

Reference
https://developer.android.com/guide/topics/resources/providing-resources.html#table2

Based on `values/sw600dp-land/dimens.xml`, create `values-land-xhdpi/dimens.xml`

This allows a taller landscape keyboard height.
2025-03-27 15:42:19 +07:00
Darcy Wong
88d896e7d5 fix(android): Copy values-sw600dp-land/dimens.xml to values-land-xhdpi 2025-03-27 15:40:53 +07:00
Darcy Wong
fee91b379d chore(android): Remove debug statements 2025-03-27 11:04:30 +07:00