Add two more fixes

* Fix determination of custom keyboard from package
* Add Toast notification when re-installing a lexical model.
This commit is contained in:
Darcy Wong 2019-05-24 08:18:54 +07:00
parent a19db98e78
commit 56982bde4e
2 changed files with 5 additions and 2 deletions

View file

@ -327,7 +327,7 @@ public final class KeyboardPickerActivity extends AppCompatActivity implements O
protected static boolean hasKeyboardFromPackage() {
for(HashMap<String, String> kbInfo: keyboardsList) {
String customKeyboard = MapCompat.getOrDefault(kbInfo, KMManager.KMKey_CustomKeyboard, "N");
if (!customKeyboard.equalsIgnoreCase("Y")) {
if (customKeyboard.equalsIgnoreCase("Y")) {
return true;
}
}

View file

@ -463,7 +463,10 @@ public final class ModelPickerActivity extends AppCompatActivity {
// we only need to add the model to the list of installed models
// Add help link
modelInfo.put(KMManager.KMKey_CustomHelpLink, "");
KMManager.addLexicalModel(context, modelInfo);
boolean result = KMManager.addLexicalModel(context, modelInfo);
if (result) {
Toast.makeText(context, "Model installed", Toast.LENGTH_SHORT).show();
}
} else {
// Model isn't installed so prompt to download it
Bundle args = new Bundle();