aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin')
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionary.java4
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java27
-rw-r--r--java/src/com/android/inputmethod/latin/Settings.java4
-rw-r--r--java/src/com/android/inputmethod/latin/SubtypeSwitcher.java23
-rw-r--r--java/src/com/android/inputmethod/latin/Utils.java5
5 files changed, 38 insertions, 25 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
index f7e67673a..af08742d3 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -53,9 +53,9 @@ public class BinaryDictionary extends Dictionary {
static {
try {
- System.loadLibrary("jni_latinime");
+ System.loadLibrary("jni_latinime2");
} catch (UnsatisfiedLinkError ule) {
- Log.e(TAG, "Could not load native library jni_latinime");
+ Log.e(TAG, "Could not load native library jni_latinime");
}
}
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index addc6c782..88261b60e 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -16,6 +16,7 @@
package com.android.inputmethod.latin;
+import com.android.inputmethod.compat.InputMethodSubtype;
import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.KeyboardActionListener;
import com.android.inputmethod.keyboard.KeyboardId;
@@ -63,13 +64,12 @@ import android.view.ViewParent;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.CompletionInfo;
-import android.view.inputmethod.CorrectionInfo;
+// @@@ import android.view.inputmethod.CorrectionInfo;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.ExtractedText;
import android.view.inputmethod.ExtractedTextRequest;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
-import android.view.inputmethod.InputMethodSubtype;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
@@ -444,7 +444,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (container.getPaddingRight() != 0) {
HorizontalScrollView scrollView =
(HorizontalScrollView) container.findViewById(R.id.candidates_scroll_view);
- scrollView.setOverScrollMode(View.OVER_SCROLL_NEVER);
+ // @@@ scrollView.setOverScrollMode(View.OVER_SCROLL_NEVER);
container.setGravity(Gravity.CENTER_HORIZONTAL);
}
mCandidateView = (CandidateView) container.findViewById(R.id.candidates);
@@ -455,13 +455,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private static boolean isPasswordVariation(int variation) {
return variation == InputType.TYPE_TEXT_VARIATION_PASSWORD
- || variation == InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
- || variation == InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD;
+ || variation == InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
+ // @@@ || variation == InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD;
}
private static boolean isEmailVariation(int variation) {
- return variation == InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS
- || variation == InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
+ return variation == InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
+ // @@@ || variation == InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
}
@Override
@@ -1166,8 +1166,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private void handleTab() {
final int imeOptions = getCurrentInputEditorInfo().imeOptions;
- final int navigationFlags =
- EditorInfo.IME_FLAG_NAVIGATE_NEXT | EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS;
+ final int navigationFlags = 0;
+ // @@@ final int navigationFlags =
+ // @@@ EditorInfo.IME_FLAG_NAVIGATE_NEXT | EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS;
if ((imeOptions & navigationFlags) == 0) {
sendDownUpKeyEvents(KeyEvent.KEYCODE_TAB);
return;
@@ -1177,6 +1178,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (ic == null)
return;
+ /* @@@
// True if keyboard is in either chording shift or manual temporary upper case mode.
final boolean isManualTemporaryUpperCase = mKeyboardSwitcher.isManualTemporaryUpperCase();
if ((imeOptions & EditorInfo.IME_FLAG_NAVIGATE_NEXT) != 0
@@ -1186,6 +1188,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
&& isManualTemporaryUpperCase) {
ic.performEditorAction(EditorInfo.IME_ACTION_PREVIOUS);
}
+ */
}
private void abortCorrection(boolean force) {
@@ -1312,9 +1315,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
TextEntryState.backToAcceptedDefault(typedWord);
if (!TextUtils.isEmpty(typedWord) && !typedWord.equals(mBestWord)) {
if (ic != null) {
+ /* @@@
CorrectionInfo correctionInfo = new CorrectionInfo(
mLastSelectionEnd - typedWord.length(), typedWord, mBestWord);
ic.commitCorrection(correctionInfo);
+ */
}
if (mCandidateView != null)
mCandidateView.onAutoCorrectionInverted(mBestWord);
@@ -2009,7 +2014,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Get the settings preferences
final SharedPreferences prefs = mPrefs;
Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
- mVibrateOn = vibrator != null && vibrator.hasVibrator()
+ // @@@ mVibrateOn = vibrator != null && vibrator.hasVibrator()
+ mVibrateOn = vibrator != null
&& prefs.getBoolean(Settings.PREF_VIBRATE_ON, false);
mSoundOn = prefs.getBoolean(Settings.PREF_SOUND_ON, false);
mPopupOn = prefs.getBoolean(Settings.PREF_POPUP_ON,
@@ -2169,7 +2175,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
System.out.println("CPS = " + ((CPS_BUFFER_SIZE * 1000f) / total));
}
- @Override
public void onCurrentInputMethodSubtypeChanged(InputMethodSubtype subtype) {
SubtypeSwitcher.getInstance().updateSubtype(subtype);
}
diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java
index 4a8b34ce4..4678f6747 100644
--- a/java/src/com/android/inputmethod/latin/Settings.java
+++ b/java/src/com/android/inputmethod/latin/Settings.java
@@ -124,7 +124,9 @@ public class Settings extends PreferenceActivity
}
Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
- if (vibrator == null || !vibrator.hasVibrator()) {
+ if (vibrator == null
+ // @@@ || !vibrator.hasVibrator()
+ ) {
getPreferenceScreen().removePreference(
getPreferenceScreen().findPreference(PREF_VIBRATE_ON));
}
diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
index d696834e9..8d45d5b38 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
@@ -16,6 +16,7 @@
package com.android.inputmethod.latin;
+import com.android.inputmethod.compat.InputMethodSubtype;
import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.voice.SettingsUtil;
@@ -33,7 +34,6 @@ import android.text.TextUtils;
import android.util.Log;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
-import android.view.inputmethod.InputMethodSubtype;
import java.util.ArrayList;
import java.util.Arrays;
@@ -45,7 +45,8 @@ public class SubtypeSwitcher {
// TODO: This should be configurable by resource
// This flag indicates if we support language switching by swipe on space bar.
// We may or may not draw the current language on space bar regardless of this flag.
- public static final boolean USE_SPACEBAR_LANGUAGE_SWITCHER = false;
+ // @@@
+ public static final boolean USE_SPACEBAR_LANGUAGE_SWITCHER = true;
private static final boolean DBG = false;
private static final String TAG = "SubtypeSwitcher";
@@ -116,7 +117,7 @@ public class SubtypeSwitcher {
// Only configuration changed event is allowed to call this because this is heavy.
private void updateAllParameters() {
mSystemLocale = mResources.getConfiguration().locale;
- updateSubtype(mImm.getCurrentInputMethodSubtype());
+ // @@@ updateSubtype(mImm.getCurrentInputMethodSubtype());
updateParametersOnStartInputView();
}
@@ -134,8 +135,8 @@ public class SubtypeSwitcher {
// Reload enabledSubtypes from the framework.
private void updateEnabledSubtypes() {
boolean foundCurrentSubtypeBecameDisabled = true;
- mAllEnabledSubtypesOfCurrentInputMethod = mImm.getEnabledInputMethodSubtypeList(
- null, false);
+ // @@@ mAllEnabledSubtypesOfCurrentInputMethod = mImm.getEnabledInputMethodSubtypeList(
+ //null, false);
mEnabledLanguagesOfCurrentInputMethod.clear();
mEnabledKeyboardSubtypesOfCurrentInputMethod.clear();
for (InputMethodSubtype ims: mAllEnabledSubtypesOfCurrentInputMethod) {
@@ -158,12 +159,13 @@ public class SubtypeSwitcher {
if (DBG) {
Log.w(TAG, "Last subtype was disabled. Update to the current one.");
}
- updateSubtype(mImm.getCurrentInputMethodSubtype());
+ // @@@ updateSubtype(mImm.getCurrentInputMethodSubtype());
}
}
private void updateShortcutIME() {
// TODO: Update an icon for shortcut IME
+ /*
Map<InputMethodInfo, List<InputMethodSubtype>> shortcuts =
mImm.getShortcutInputMethodsAndSubtypes();
for (InputMethodInfo imi: shortcuts.keySet()) {
@@ -175,7 +177,8 @@ public class SubtypeSwitcher {
// as appropriate.
mShortcutSubtype = subtypes.size() > 0 ? subtypes.get(0) : null;
break;
- }
+ }
+ */
}
// Update the current subtype. LatinIME.onCurrentInputMethodSubtypeChanged calls this function.
@@ -270,7 +273,7 @@ public class SubtypeSwitcher {
if (token == null || mShortcutInfo == null) {
return;
}
- mImm.setInputMethodAndSubtype(token, mShortcutInfo.getId(), mShortcutSubtype);
+ // @@@ mImm.setInputMethodAndSubtype(token, mShortcutInfo.getId(), mShortcutSubtype);
}
public Drawable getShortcutIcon() {
@@ -278,6 +281,7 @@ public class SubtypeSwitcher {
}
private Drawable getSubtypeIcon(InputMethodInfo imi, InputMethodSubtype subtype) {
+ /*
final PackageManager pm = mService.getPackageManager();
if (imi != null) {
final String imiPackageName = imi.getPackageName();
@@ -299,7 +303,8 @@ public class SubtypeSwitcher {
Log.w(TAG, "IME can't be found: " + imiPackageName);
}
}
- }
+ }
+ */
return null;
}
diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/Utils.java
index 753e5d64f..56ad6c7aa 100644
--- a/java/src/com/android/inputmethod/latin/Utils.java
+++ b/java/src/com/android/inputmethod/latin/Utils.java
@@ -89,10 +89,11 @@ public class Utils {
}
public static boolean hasMultipleEnabledIMEsOrSubtypes(InputMethodManager imm) {
- return imm.getEnabledInputMethodList().size() > 1
+ return imm.getEnabledInputMethodList().size() > 1;
+ // @@@ return imm.getEnabledInputMethodList().size() > 1
// imm.getEnabledInputMethodSubtypeList(null, false) will return the current IME's enabled
// input method subtype (The current IME should be LatinIME.)
- || imm.getEnabledInputMethodSubtypeList(null, false).size() > 1;
+ // || imm.getEnabledInputMethodSubtypeList(null, false).size() > 1;
}
/* package */ static class RingCharBuffer {