diff --git a/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java b/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java index 5c1590dd6b..eec7a8a53a 100644 --- a/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java +++ b/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java @@ -103,6 +103,8 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven attribute.imeOptions |= EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_FLAG_NO_FULLSCREEN; super.onStartInput(attribute, restarting); KMManager.onStartInput(attribute, restarting); + KMManager.resetContext(KeyboardType.KEYBOARD_TYPE_SYSTEM); + //Log.i("SystemKeyboard", "onStartInput"); InputConnection ic = getCurrentInputConnection(); if (ic != null) { diff --git a/android/KMEA/app/src/main/assets/keyboard.html b/android/KMEA/app/src/main/assets/keyboard.html index 413311ce40..b2301c4a71 100644 --- a/android/KMEA/app/src/main/assets/keyboard.html +++ b/android/KMEA/app/src/main/assets/keyboard.html @@ -90,6 +90,10 @@ window.jsInterface.insertText(dn, s); } + function resetContext() { + tavultesoft.keymanweb.resetContext(); + } + function updateKMText(text) { if(text == undefined) { text = ''; diff --git a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KMManager.java b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KMManager.java index 832af6e297..5bfc4c8eca 100644 --- a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KMManager.java +++ b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KMManager.java @@ -1730,6 +1730,18 @@ public final class KMManager { return result; } + public static void resetContext(KeyboardType kbType) { + if (kbType == KeyboardType.KEYBOARD_TYPE_INAPP) { + if (InAppKeyboard != null && InAppKeyboardLoaded) { + InAppKeyboard.loadUrl("javascript:resetContext()"); + } + } else if (kbType == KeyboardType.KEYBOARD_TYPE_SYSTEM) { + if (SystemKeyboard != null && SystemKeyboardLoaded) { + SystemKeyboard.loadUrl("javascript:resetContext()"); + } + } + } + public static int getCurrentKeyboardIndex(Context context) { return KeyboardPickerActivity.getCurrentKeyboardIndex(context); } diff --git a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KMTextView.java b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KMTextView.java index 6fbf59324f..e4ab1c5149 100644 --- a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KMTextView.java +++ b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KMTextView.java @@ -111,6 +111,7 @@ public final class KMTextView extends EditText { int selEnd = textView.getSelectionEnd(); KMManager.InAppKeyboard.loadUrl(String.format("javascript:updateKMText('%s')", textView.getText().toString())); KMManager.InAppKeyboard.loadUrl(String.format("javascript:updateKMSelectionRange(%d,%d)", selStart, selEnd)); + KMManager.resetContext(KeyboardType.KEYBOARD_TYPE_INAPP); } showKeyboard(); } else { diff --git a/android/history.md b/android/history.md index 654f8a5a00..1792b1f15a 100644 --- a/android/history.md +++ b/android/history.md @@ -1,8 +1,9 @@ # Keyman for Android ## 10.0 alpha -* Removed "Share to Facebook" feature (#156) -* Fix dual keyboards that appear when closing Keyman Browser (#220) +* Add feature to reset keyboard to default layer when new input field focused (keymanapp/keyman#288) +* Removed "Share to Facebook" feature (keymanapp/keyman#156) +* Fix dual keyboards that appear when closing Keyman Browser (keymanapp/keyman#220) ## 2017-08-10 2.8.300 stable * No changes, just published latest beta as stable diff --git a/web/.editorconfig b/web/.editorconfig new file mode 100644 index 0000000000..5e07bc9613 --- /dev/null +++ b/web/.editorconfig @@ -0,0 +1,10 @@ +# top-most EditorConfig file +root = true + +; applies to all files +[*] +indent_style = space + +[*.{java, js, sh, css, html, xml}] +indent_size = 2 + diff --git a/web/history.md b/web/history.md index 78caae1d4d..c70dc43eab 100644 --- a/web/history.md +++ b/web/history.md @@ -10,7 +10,7 @@ * Refactored code paths relating to KMW's embedding in the iOS and Android apps. (#211) * Added support for L/R Alt and Ctrl modifiers for keyboards. (#9) (#52) * Added support for use of the Caps Lock state within keyboards if specified by a keyboard designer. - +* Fixed next-layer processing (#116) ## 2017-07-10 2.0.473 stable * 2.0 stable release build. diff --git a/web/samples/index.html b/web/samples/index.html index 139331eae4..6f7b38576f 100644 --- a/web/samples/index.html +++ b/web/samples/index.html @@ -26,9 +26,12 @@