Commit graph

84 commits

Author SHA1 Message Date
Joshua Horton
3718ae775b
Merge pull request #482 from keymanapp/android-kmp-processor
Android .kmp package processor
2017-12-11 10:35:31 +07:00
Joshua A. Horton
4a3cf87fe1 Tweaked JSONParser error log tags. 2017-12-11 10:03:15 +07:00
Joshua A. Horton
882dd8425a Documentation for the newly added classes. 2017-12-11 08:48:48 +07:00
Joshua A. Horton
ddb1d58850 Added a .kmp version check test. 2017-12-08 15:23:51 +07:00
Joshua A. Horton
ba0cbd2d72 First functional iteration of the .kmp processor. 2017-12-08 14:53:38 +07:00
Joshua A. Horton
4ec82a5acf Minor code omission. 2017-12-08 14:11:34 +07:00
Joshua A. Horton
8bb486415b Initial JSON extraction/analysis work. 2017-12-08 14:05:56 +07:00
Joshua A. Horton
997164066d Added KMEA test cases to build script, debugged working path. 2017-12-08 13:04:09 +07:00
Joshua A. Horton
9157b6decd Refactored the JSONParser class; kmp.json now loads. 2017-12-08 12:21:18 +07:00
Joshua A. Horton
0bbc254278 Basic extraction and test case infrastructure for KMP processing. 2017-12-08 10:32:03 +07:00
Joshua A. Horton
319b20cefb Patches Android to fully specify the path to each keyboard. 2017-12-07 11:02:47 +07:00
Joshua A. Horton
f81896878b Base start toward package info processing unit & testing. 2017-12-07 10:36:41 +07:00
darcywong00
891dcda99b Document asset folder change in history and readme 2017-12-04 12:52:52 +07:00
darcywong00
911a254966 Move KMSamples and KeyboardHarness assets
PR #456 changed internal folder locations for KMEA and kmapro. This PR continues the renames for the Sample and Test projects
2017-12-04 11:42:07 +07:00
darcywong00
f6a710a383 Fix directory structure in MainActivity.onActivityResult
I suspect this portion of the code is obsolete, but fixed the old `/languages` and `/fonts` structure in this method.
2017-11-30 13:14:50 +07:00
darcywong00
73f0463982 More cleanup of directories and packageID
Add header to `FileDownloader.download` to clarify that it will create destination directories if they don't exist.
Also fix 1 more place for storing packageID when downloading ad-hoc keyboard
2017-11-30 13:01:39 +07:00
darcywong00
80c3bc40ed Fix packageID for displaying keyboard version
KMKEyboardPickerAdapter.onClick needs a defined packageID to display the keyboard version
2017-11-30 09:13:34 +07:00
darcywong00
a85cb25302 and save packageID
For undefined packageIDs, update keyboardsList and save.
2017-11-29 16:49:47 +07:00
darcywong00
bfb17498f4 More work on default packageID
Use `KMManager.KMDefault_PackageID` if the `keyboardID` is `KMManager.KMDefault_KeyboardID`
2017-11-29 16:31:46 +07:00
darcywong00
4dd4379a64 "Add new keyboard" downloads to packages/cloud
At the moment, the keboard API isn't publishing the packageID, so using "cloud" as an in-term packageID.

As a result, keyboards get downloaded to /packages/cloud/
2017-11-29 14:49:21 +07:00
darcywong00
1db048f1b9 packageID fixes
Quote packageID for JS call. And assign undefined packageID to `cloud`
2017-11-29 11:18:55 +07:00
darcywong00
7d6aa35486 Change renameOldKeyboardFiles to migrateOldKeyboardFiles 2017-11-29 11:13:23 +07:00
darcywong00
e46f6a9cc0 Start moving to new asset structure
By design, kmp keyboards will unzip into /packages/packageID folders. 

1. Moving default eurolatin2 keyboard assets
2. Move old keyboards to new packages structure
2017-11-28 14:48:56 +07:00
darcywong00
667e82e9d4 Ignore zero-byte JS keyboard files
For the 3rd part of #370, ignore 0-byte JS files in `KMManager.getLatestKeyboardFileVersion)`

If a keyboard doesn't have a valid version, attempting to load it will revert to the default (EuroLatin2) keyboard.

Also added a check so null version keyboard doesn't get added to OldKeyboardsList
2017-11-23 12:47:53 +07:00
Darcy Wong
9ae9067dbe
Merge pull request #437 from keymanapp/android-370-follow-redirects
Update HttpURLConnections to follow HTTPS redirects
2017-11-23 10:06:43 +07:00
darcywong00
365f4d09de Refactor to use util.Connection
New class will manage the HttpUrlConnection
2017-11-23 09:08:44 +07:00
darcywong00
44deae4937 Check valid file size when downloading keyboard
Addresses the second part of #370
2017-11-23 04:45:04 +07:00
darcywong00
40a68c167b Update HttpURLConnections to follow HTTPS redirects
For the first portion of resolving issues/370

Fix KMManager and JSONParser HttpURLConnection calls so HTTP:// to HTTPS:// redirects are properly followed.
2017-11-22 11:51:54 +07:00
Joshua Horton
0ac1377d76 Merge branch 'master' into web-349-core-refactoring 2017-11-13 13:05:52 +07:00
darcywong00
3ea672edc5 Fix remaining references to keymanweb, and test chirality keyboard 2017-10-31 21:26:40 +07:00
darcywong00
41a8ea3d04 Modified the KMEA keyboard.html to use the new keyman JS namespace
Addresses the KMEA portion of #349

Modify keyboard.html to use the new `keyman` JS namespace instead of `tavultesoft.keymanweb`
2017-10-31 13:19:35 +07:00
darcywong00
ff41c7e446 Update to Android Studio and Gradle 3.0
Per Android Studio 3.0 [Release Notes](https://android-developers.googleblog.com/2017/10/android-studio-30.html)

-Update gradle version
-Change deprecated `compile` dependencies to `implementation` or `api`
-Change maven repositories to google (triplet plugin still on maven)
- Update readme instructions for using the engine
2017-10-30 14:51:24 +07:00
darcywong00
0c560f308b Fix osk.defaultKeyOutput to handle characters beyond U_FFFF
`String.fromCharCode()` has a limitation to Unicode characters in the BMP. Change to `String.kmwFromCharCode()` to handle entire Unicode range.

Also clarified how default key codepoints are processed.

KeyboardHarness changes:
- Change text area font on keyboard change
- Added U_10481 to test longpress keyboard.
- Remove test tchad keyboard
2017-10-17 13:21:30 +07:00
darcywong00
ca89f90b86 Document which Unicode control codes are suppressed
Update comments explaning how control codes U_0000 to U_001F and U_0080 to U_009F are suppressed.

Also updated longpress test keyboard to test control codes.
2017-10-16 17:24:25 +07:00
darcywong00
cdd75ccf5f Refactor longpress logic so key text is not confused with key code
A tchad keyboard has a diacritic rule that converts `=` (U_003D) into a combining macron (U_0304).
A longpress on `»` (U_00BB) was inadvertently triggering the diacritic rule, and outputting the macron.

The longpress code in KMEA and KMW needs to be refactored so they dont confuse key text (U_00BB is decimal 187) with underlying keyCodes (`=` is keyCode 187).

- fix KMW executePopupKey so key code is dictionary lookup instead of parsing the keyID.
- clean up JS call to executePopupKey since it only uses the keyID
2017-10-12 14:21:29 +07:00
darcywong00
f06c727e51 Refactor longpress text when it's generated by Id
Currently on the touch layout, longpress for K_SPACE causes the app to crash because it is attempting to parse `K_SPACE` as an int for generating the longpress text.

- Clean up when key text is empty how it is parsed from Id
-Change Unicode hex string delimiter from `,0x` to `\\u` which makes it easier to read `executePopupKey()` in the logs.
2017-10-09 09:04:30 +07:00
darcywong00
0665756299 Final cleanup
Remove chirality test keyboard from main kmapro app
Fix KMSample2 compilation
2017-10-04 10:33:16 +07:00
Joshua Horton
16048e5573 setIsChiral() is now operational. 2017-10-04 10:33:16 +07:00
Joshua Horton
086e7c511d Tweaked keyboard.html a bit. 2017-10-04 10:33:16 +07:00
darcywong00
ced4102bed Update calls to kmw.addEventLIstener 2017-10-04 10:33:16 +07:00
darcywong00
adee729b8a Clarify setIsChiral parameter 2017-10-04 10:33:16 +07:00
darcywong00
3a30d23684 Clean up TestHarness
Fix onKeyboardChanged signature
2017-10-04 10:33:16 +07:00
darcywong00
bc208fba5d Cleanup sample projects
Revert to original onKeyboardChanged() signature
2017-10-04 10:33:16 +07:00
darcywong00
aac2368405 Cleanup after attaching to KMW event
Cleanup code after moving chirality test to KMW event handler
2017-10-04 10:33:16 +07:00
darcywong00
e507462146 Move chirality checks to KMEA
Attempt to move to JS handler in KMManager
2017-10-04 10:33:16 +07:00
darcywong00
c8e54b9767 Remove test chirality keyboard (again) from kmapro 2017-10-04 10:33:16 +07:00
darcywong00
d66f52b350 Update Samples and Tests projects for handler API change
Updates to new onKeyboardChanged signature

Also incorporated external keyboard support to KMSample2
2017-10-04 10:33:16 +07:00
darcywong00
e2a8b763a1 Update isChiral on keyboard shown / changed
- Update In-app keyboard `isChiral` property when the OSK is shown
- Update System keyboard `isChiral` property on the event onKeyboardChanged()

This implementation comes out of the complication when in-app or system keyboard is changed, KMManager.setKeyboard is changing both keyboards
2017-10-04 10:33:16 +07:00
darcywong00
32bb4c6961 Refactor JS call of setIsChiral() to onKeyboardChanged event
Addresses PR comment of not using a timeout that assumes keyboard is ready in preference of KMW event (keyboard loaded or changed)

This is still wip
2017-10-04 10:33:16 +07:00
darcywong00
f9f3dc7449 Document bitmasks and undo getActiveKeyboard refactor
* Document shift states and lock states in kmembedded.js, and standardize `lstates` parameter name
* Leave getActiveKeyboard() refactor as a TODO
2017-10-04 10:33:16 +07:00