mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-09 10:25:32 +00:00
chore(android/engine): Cleanup old SDK calls
This commit is contained in:
parent
cb3688d209
commit
22402a34cd
2 changed files with 5 additions and 16 deletions
|
|
@ -150,21 +150,10 @@ final class KMKeyboard extends WebView {
|
|||
|
||||
getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
|
||||
getSettings().setSupportZoom(false);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
getSettings().setUseWideViewPort(true);
|
||||
getSettings().setLoadWithOverviewMode(true);
|
||||
setWebContentsDebuggingEnabled(true);
|
||||
}
|
||||
|
||||
if (keyboardType == KeyboardType.KEYBOARD_TYPE_INAPP && Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)
|
||||
setLayerType(View.LAYER_TYPE_SOFTWARE, null); // Disable hardware acceleration for API < 17, Keyman keyboard is slower without HWA but it causes some display issues.
|
||||
// (Tested on Samsung Galaxy Nexus running Android 4.1.2)
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
||||
// These were deprecated in API 18
|
||||
getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
|
||||
getSettings().setPluginState(WebSettings.PluginState.ON_DEMAND);
|
||||
}
|
||||
getSettings().setUseWideViewPort(true);
|
||||
getSettings().setLoadWithOverviewMode(true);
|
||||
setWebContentsDebuggingEnabled(true);
|
||||
|
||||
setWebChromeClient(new WebChromeClient() {
|
||||
public boolean onConsoleMessage(ConsoleMessage cm) {
|
||||
|
|
|
|||
|
|
@ -1655,7 +1655,7 @@ public final class KMManager {
|
|||
if (IMService != null) {
|
||||
IMService.switchToPreviousInputMethod();
|
||||
}
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
} else {
|
||||
// This method is added in API level 16 and deprecated in API level 28
|
||||
// Reference: https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#switchToLastInputMethod(android.os.IBinder)
|
||||
InputMethodManager imm = (InputMethodManager) appContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
|
|
@ -1668,7 +1668,7 @@ public final class KMManager {
|
|||
if (IMService != null) {
|
||||
IMService.switchToNextInputMethod(false);
|
||||
}
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||
} else {
|
||||
// This method is added in API level 16 and deprecated in API level 28
|
||||
// Reference: https://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#switchToNextInputMethod(android.os.IBinder,%20boolean)
|
||||
InputMethodManager imm = (InputMethodManager) appContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue