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
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
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
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`.
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`.
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
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/
By design, kmp keyboards will unzip into /packages/packageID folders.
1. Moving default eurolatin2 keyboard assets
2. Move old keyboards to new packages structure
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
For the first portion of resolving issues/370
Fix KMManager and JSONParser HttpURLConnection calls so HTTP:// to HTTPS:// redirects are properly followed.
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
`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
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.