Merge pull request #638 from keymanapp/android-shift-longpress-osk-font-239

[Android] Fix path of special OSK font used for longpress of special keys
This commit is contained in:
Darcy Wong 2018-03-01 14:53:22 +07:00 committed by GitHub
commit b85cd9b8e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View file

@ -242,6 +242,16 @@ final class KMKeyboard extends WebView {
return keyboardRoot + oskFont;
}
/**
* Return the full path to the special OSK font,
* which is with all the keyboard assets at the root app_data folder
* @param String filename
* @return String
*/
public String specialOSKFontFilename(String filename) {
return context.getDir("data", Context.MODE_PRIVATE).toString() + File.separator + filename;
}
public boolean setKeyboard(String packageID, String keyboardID, String languageID) {
if (packageID == null || keyboardID == null || languageID == null)
return false;
@ -635,7 +645,7 @@ final class KMKeyboard extends WebView {
button.setText(title);
if (!specialOskFont.isEmpty()) {
button.setTypeface(KMManager.getFontTypeface(context, specialOskFont));
button.setTypeface(KMManager.getFontTypeface(context, specialOSKFontFilename(specialOskFont)));
} else {
Typeface font = KMManager.getFontTypeface(context, (oskFont != null) ? oskFontFilename() : textFontFilename());
if (font != null) {

View file

@ -1388,7 +1388,7 @@ public final class KMManager {
end = url.length();
InAppKeyboard.specialOskFont = "";
} else {
InAppKeyboard.specialOskFont = "keymanweb-osk.ttf";
InAppKeyboard.specialOskFont = KMFilename_Osk_Ttf_Font;
}
String keys = url.substring(start, end);
@ -1562,7 +1562,7 @@ public final class KMManager {
end = url.length();
SystemKeyboard.specialOskFont = "";
} else {
SystemKeyboard.specialOskFont = "keymanweb-osk.ttf";
SystemKeyboard.specialOskFont = KMFilename_Osk_Ttf_Font;
}
String keys = url.substring(start, end);

View file

@ -12,6 +12,7 @@
* Add feature to install ad-hoc keyboards via .kmp packages
* Add [Firebase Crashlytics](https://firebase.google.com/docs/crashlytics/) for generating crash reports
* Add Material Design [icons](https://material.io/icons/)
* Fix path to special OSK font for longpress of special keys (#239)
## 2017-08-10 2.8.300 stable
* No changes, just published latest beta as stable