From 363cd6ef0f8f8af41a01964a2f0e800f9305d3a2 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Thu, 23 Dec 2010 12:24:27 +0900 Subject: [PATCH] Make dismissing keyboard by swiping down as configurable Bug: 3306370 Change-Id: If4e258ce4db05fb75dcd3b23fefa422c1287955b --- java/res/values-xlarge/config.xml | 1 + java/res/values/config.xml | 1 + .../android/inputmethod/latin/LatinIME.java | 18 ++++++++++++------ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/java/res/values-xlarge/config.xml b/java/res/values-xlarge/config.xml index 5b9932b06..4ceca45f1 100644 --- a/java/res/values-xlarge/config.xml +++ b/java/res/values-xlarge/config.xml @@ -23,6 +23,7 @@ false false false + false false false diff --git a/java/res/values/config.xml b/java/res/values/config.xml index 0f2a014f1..5db2e82b0 100644 --- a/java/res/values/config.xml +++ b/java/res/values/config.xml @@ -26,6 +26,7 @@ true true true + true true true diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index e9f200a8b..51b56ec14 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -155,6 +155,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private boolean mPopupOn; private boolean mAutoCap; private boolean mQuickFixes; + private boolean mConfigSwipeDownDismissKeyboardEnabled; private int mCorrectionMode; private int mCommittedLength; @@ -310,15 +311,19 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen LatinImeLogger.init(this, prefs); SubtypeSwitcher.init(this, prefs); KeyboardSwitcher.init(this, prefs); + super.onCreate(); - //setStatusIcon(R.drawable.ime_qwerty); - mResources = getResources(); + mImm = ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)); - final Configuration conf = mResources.getConfiguration(); mSubtypeSwitcher = SubtypeSwitcher.getInstance(); mKeyboardSwitcher = KeyboardSwitcher.getInstance(); + + final Resources res = getResources(); + mResources = res; mReCorrectionEnabled = prefs.getBoolean(Settings.PREF_RECORRECTION_ENABLED, - getResources().getBoolean(R.bool.default_recorrection_enabled)); + res.getBoolean(R.bool.default_recorrection_enabled)); + mConfigSwipeDownDismissKeyboardEnabled = res.getBoolean( + R.bool.config_swipe_down_dismiss_keyboard_enabled); Utils.GCUtils.getInstance().reset(); boolean tryGC = true; @@ -331,7 +336,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } } - mOrientation = conf.orientation; + mOrientation = res.getConfiguration().orientation; initSuggestPuncList(); // register to receive ringer mode changes for silent mode @@ -1875,7 +1880,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen @Override public void onSwipeDown() { - handleClose(); + if (mConfigSwipeDownDismissKeyboardEnabled) + handleClose(); } @Override