mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-18 14:27:43 +00:00
Add associated lexical model
This commit is contained in:
parent
67a43243b7
commit
7ea8da554f
1 changed files with 20 additions and 1 deletions
|
|
@ -367,10 +367,16 @@ public class KMKeyboardDownloaderActivity extends AppCompatActivity {
|
|||
String pkgTarget = kmpProcessor.getPackageTarget(kmpFile);
|
||||
if (pkgTarget.equals(PackageProcessor.PP_TARGET_LEXICAL_MODELS)) {
|
||||
File unzipPath = kmpProcessor.unzipKMP(kmpFile);
|
||||
// TODO: Propogate installedLexicalModels to KMW
|
||||
List<Map<String, String>> installedLexicalModels =
|
||||
kmpProcessor.processKMP(kmpFile, unzipPath, PackageProcessor.PP_LEXICAL_MODELS_KEY);
|
||||
|
||||
boolean success = installedLexicalModels.size() != 0;
|
||||
if (success) {
|
||||
notifyLexicalModelInstallListeners(KeyboardEventHandler.EventType.LEXICAL_MODEL_INSTALLED,
|
||||
installedLexicalModels, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (result < 0) {
|
||||
if (FileUtils.hasFontExtension(url)) {
|
||||
|
|
@ -407,6 +413,19 @@ public class KMKeyboardDownloaderActivity extends AppCompatActivity {
|
|||
KeyboardEventHandler.notifyListeners(kbDownloadEventListeners, eventType, keyboardInfo, result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify listeners when a lexical model is installed
|
||||
* @param eventType
|
||||
* @param models
|
||||
* @param result
|
||||
*/
|
||||
protected void notifyLexicalModelInstallListeners(KeyboardEventHandler.EventType eventType,
|
||||
List<Map<String, String>> models, int result) {
|
||||
if (kbDownloadEventListeners != null) {
|
||||
KeyboardEventHandler.notifyListeners(kbDownloadEventListeners, eventType, models, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue