Commit graph

2255 commits

Author SHA1 Message Date
darcywong00
9c2b44fff2 Tweak more PackageActivity layout 2018-01-19 13:28:02 +07:00
Joshua A. Horton
b420de0673 Merge branch 'android-download-kmp' of https://github.com/keymanapp/keyman into android-download-kmp 2018-01-19 11:47:44 +07:00
Joshua A. Horton
2b3cb459e5 Removed errors from PackageProcessor integration. gff_amh_7 keyboard still has problems, though. 2018-01-19 11:47:36 +07:00
darcywong00
71101af915 Add more styling to package activity 2018-01-19 06:35:36 +07:00
darcywong00
2af337de62 Break out package processing to separate activity
This is a placeholder for kmp
2018-01-18 17:03:42 +07:00
Joshua A. Horton
8c223a10ed Basic KMP integration success - it still has some glitches, though. 2018-01-18 17:00:59 +07:00
darcywong00
ed9c6e09a6 Load keyboards that don't contain version string in the filename
Keyboard paths that get passed to KMW will depend on the `packageID`

1. Keyboards distributed ad-hoc via kmp (stored in `/packages/packageID/` won't have version strings in their filename.
2. Legacy keyboards in the `/cloud/` directory will still contain version strings
2018-01-18 13:23:58 +07:00
Joshua A. Horton
fb121e1016 Adds direct installation tests, fixes a bug, adds the ability to force a downgrade, and allows lookup of contained keyboard versions. 2018-01-18 11:20:39 +07:00
darcywong00
534597051f Move keyboard assets for Samples and Test projects 2018-01-17 16:36:30 +07:00
darcywong00
3a0134a758 Handle undefined packageID as "cloud"
Per design discussions, use "cloud" as the package ID when it's undefined. Those keyboards get stored physically at `/cloud/`.

Later on, keyboards installed via kmp will be installed at `/packages/packageID/`

Also update version checker depending on package ID:
1. cloud:  use the version string within the filename
2. all others: parse kmp.json for the keyboard version
2018-01-17 16:08:46 +07:00
darcywong00
4787245808 Round 1 of adding feature for ad-hoc keyboard distribution via kmp 2018-01-17 10:58:25 +07:00
Joshua A. Horton
c8eec9bb4a Removed OS check from Android script since build.bat is no more. 2018-01-11 08:36:03 +07:00
darcywong00
fa772a057d Add commented code for default font
help.keyman.com [in-app guide](http://help.keyman.com.local/developer/engine/android/guides/in-app/)  refers to setting default keyboard font
2017-12-15 13:42:06 +07:00
darcywong00
867c8cc3ab Ensure downloaded keyboard is added before attempting to set it 2017-12-15 11:39:26 +07:00
darcywong00
82f78f005c Document why removeKeyboardDownloadEventListeners are removed
Calls to `removeKEyboardDownloadEventListener()` are removed to ensure `onKeyboardDownloadFinished()` gets called
2017-12-15 10:24:40 +07:00
darcywong00
9cf5e5114c Enable regex for font and oskFont filepaths. 2017-12-14 15:26:47 +07:00
darcywong00
27629a578b Tweaks for keyboard update
Include language name and keyboard name when updating keyboard version. Dismiss the updateProgress dialog when keyboard has finished downloading.

Also fixed a typo in comment
2017-12-14 13:38:15 +07:00
darcywong00
a81387f043 More more keys from KMManager to KMKeyboardDownloaderActivity 2017-12-14 08:19:03 +07:00
darcywong00
4f5bd09cdb Tweak event handlers and fix processing custom JSON
For now, disable calls to `KMKeyboardDownloaderActivity.removeKEyboardDownloadEventListener()`. The parent activities will always pause when KMKeyboardDownloaderActivity runs, and we want the event handlers to trigger when the keyboards finish downloading.

Also fixed processing custom JSON to handle the JSONArray `languages`.
2017-12-13 12:47:36 +07:00
darcywong00
ebafec1626 Fix url key and isCustom() check 2017-12-13 05:57:49 +07:00
darcywong00
ba1a84dde6 Refactor keyboard download code
Currently in `KMManager`, there's 3 methods to download a `KMKeyboard` (2 in `KMKeyboardDownloader`, 1 in `KMCustomKeyboardDownloader`) for the 3 use-cases respectively:
1. Add new keyboard (from the cloud)
2. Update a keyboard
3. Install a custom keyboard

This PR refactors the following:
1. Code from `MainActivity.checkUrl()`, `KMManager.KMKeyboardDownloader()`, and  `KMManager.CustomKeyboardDownloader()` into a new activity `KMKeyboardDownloadActivity`. 
Code for doing actual file downloads are kept in an `AsyncTask`.
2. `FileDownloader` moved to a separate util class.
3. Confirmation dialogs for downloading keyboards are also refactored into `ConfirmDialogFragment`.
2017-12-13 05:14:45 +07:00
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