aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/res/raw/main_en.dictbin1068791 -> 1069800 bytes
-rw-r--r--java/res/raw/main_es.dictbin1138855 -> 1138855 bytes
-rw-r--r--java/res/raw/main_fr.dictbin1327366 -> 1329652 bytes
-rw-r--r--java/res/raw/main_it.dictbin1143310 -> 1143310 bytes
-rw-r--r--java/res/raw/main_pt_br.dictbin1091964 -> 1091965 bytes
-rw-r--r--java/res/raw/main_ru.dictbin0 -> 2240073 bytes
-rw-r--r--java/res/values-am/strings.xml6
-rw-r--r--java/res/values-ar/strings.xml6
-rw-r--r--java/res/values-el/strings.xml6
-rw-r--r--java/res/values-fi/strings.xml6
-rw-r--r--java/res/values-it/strings.xml6
-rw-r--r--java/res/values-iw/strings.xml6
-rw-r--r--java/res/values-sv/strings.xml6
-rw-r--r--java/res/values-sw/strings.xml6
-rw-r--r--java/res/values/attrs.xml2
-rw-r--r--java/res/values/config.xml1
-rw-r--r--java/res/values/styles.xml1
-rw-r--r--java/src/com/android/inputmethod/keyboard/MainKeyboardView.java15
-rw-r--r--java/src/com/android/inputmethod/keyboard/PointerTracker.java32
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java2
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java32
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java2
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java35
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/FormatSpec.java33
24 files changed, 105 insertions, 98 deletions
diff --git a/java/res/raw/main_en.dict b/java/res/raw/main_en.dict
index e02e300e4..0cf546772 100644
--- a/java/res/raw/main_en.dict
+++ b/java/res/raw/main_en.dict
Binary files differ
diff --git a/java/res/raw/main_es.dict b/java/res/raw/main_es.dict
index 71370aac2..7a4daf1f2 100644
--- a/java/res/raw/main_es.dict
+++ b/java/res/raw/main_es.dict
Binary files differ
diff --git a/java/res/raw/main_fr.dict b/java/res/raw/main_fr.dict
index 8e616591c..2fd94f4dc 100644
--- a/java/res/raw/main_fr.dict
+++ b/java/res/raw/main_fr.dict
Binary files differ
diff --git a/java/res/raw/main_it.dict b/java/res/raw/main_it.dict
index 82579078c..b93a55c93 100644
--- a/java/res/raw/main_it.dict
+++ b/java/res/raw/main_it.dict
Binary files differ
diff --git a/java/res/raw/main_pt_br.dict b/java/res/raw/main_pt_br.dict
index d31752e07..66ac3f953 100644
--- a/java/res/raw/main_pt_br.dict
+++ b/java/res/raw/main_pt_br.dict
Binary files differ
diff --git a/java/res/raw/main_ru.dict b/java/res/raw/main_ru.dict
new file mode 100644
index 000000000..050b0b8c4
--- /dev/null
+++ b/java/res/raw/main_ru.dict
Binary files differ
diff --git a/java/res/values-am/strings.xml b/java/res/values-am/strings.xml
index 513c17686..7b0891f94 100644
--- a/java/res/values-am/strings.xml
+++ b/java/res/values-am/strings.xml
@@ -36,10 +36,8 @@
<string name="advanced_settings_summary" msgid="4487980456152830271">"ለብቁ ተጠቃሚዎች አማራጮች"</string>
<string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"ወደ ሌሎች የግቤት ስልቶች ቀይር"</string>
<string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"የቋንቋ መቀየሪያ ቁልፍ ሌሎች የግቤት ስልቶችንም ይሸፍናል"</string>
- <!-- no translation found for show_language_switch_key (5915478828318774384) -->
- <skip />
- <!-- no translation found for show_language_switch_key_summary (7343403647474265713) -->
- <skip />
+ <string name="show_language_switch_key" msgid="5915478828318774384">"የቋንቋ መቀየሪያ ቁልፍ"</string>
+ <string name="show_language_switch_key_summary" msgid="7343403647474265713">"በርካታ የግቤት ቋንቋዎች ሲነቁ አሳይ"</string>
<string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"የቁልፍ ብቅ ባይ መዘግየትን ያስወገዳል"</string>
<string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"የዘገየ የለም"</string>
<string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"ነባሪ"</string>
diff --git a/java/res/values-ar/strings.xml b/java/res/values-ar/strings.xml
index b1c7afe5a..8e7e752d0 100644
--- a/java/res/values-ar/strings.xml
+++ b/java/res/values-ar/strings.xml
@@ -36,10 +36,8 @@
<string name="advanced_settings_summary" msgid="4487980456152830271">"خيارات للخبراء"</string>
<string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"التبديل إلى أسلوب إدخال آخر"</string>
<string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"يغطي مفتاح تبديل اللغات أساليب الإدخال الأخرى أيضًا"</string>
- <!-- no translation found for show_language_switch_key (5915478828318774384) -->
- <skip />
- <!-- no translation found for show_language_switch_key_summary (7343403647474265713) -->
- <skip />
+ <string name="show_language_switch_key" msgid="5915478828318774384">"مفتاح تبديل اللغة"</string>
+ <string name="show_language_switch_key_summary" msgid="7343403647474265713">"يظهر عندما يتم تمكين لغات الإدخال متعددة"</string>
<string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"تأخير إزالة النافذة المنبثقة الأساسية"</string>
<string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"بلا تأخير"</string>
<string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"افتراضي"</string>
diff --git a/java/res/values-el/strings.xml b/java/res/values-el/strings.xml
index 63f65126d..4f80bd18d 100644
--- a/java/res/values-el/strings.xml
+++ b/java/res/values-el/strings.xml
@@ -36,10 +36,8 @@
<string name="advanced_settings_summary" msgid="4487980456152830271">"Επιλογές για έμπειρους χρήστες"</string>
<string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Άλλη μέθοδος εισόδου"</string>
<string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Το κλειδί αλλαγής γλώσσας καλύπτει και άλλες μεθόδους εισόδου"</string>
- <!-- no translation found for show_language_switch_key (5915478828318774384) -->
- <skip />
- <!-- no translation found for show_language_switch_key_summary (7343403647474265713) -->
- <skip />
+ <string name="show_language_switch_key" msgid="5915478828318774384">"Πλήκτρο εναλλαγής γλώσσας"</string>
+ <string name="show_language_switch_key_summary" msgid="7343403647474265713">"Εμφάνιση κατά την ενεργοποίηση πολλών γλωσσών εισόδου"</string>
<string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Χρόνος εξαφ. αναδ. παραθ."</string>
<string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Χωρίς καθυστέρ."</string>
<string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Προεπιλογή"</string>
diff --git a/java/res/values-fi/strings.xml b/java/res/values-fi/strings.xml
index 68f946cfa..211c3aa47 100644
--- a/java/res/values-fi/strings.xml
+++ b/java/res/values-fi/strings.xml
@@ -36,10 +36,8 @@
<string name="advanced_settings_summary" msgid="4487980456152830271">"Valinnat asiantuntijoille"</string>
<string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Käytä toista syöttötapaa"</string>
<string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Kielenvaihtonäppäin kattaa myös muut syöttötavat"</string>
- <!-- no translation found for show_language_switch_key (5915478828318774384) -->
- <skip />
- <!-- no translation found for show_language_switch_key_summary (7343403647474265713) -->
- <skip />
+ <string name="show_language_switch_key" msgid="5915478828318774384">"Kielenvaihtonäppäin"</string>
+ <string name="show_language_switch_key_summary" msgid="7343403647474265713">"Näytä, kun käytössä on useita syöttökieliä"</string>
<string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Näppäimen hylkäysviive"</string>
<string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Ei viivettä"</string>
<string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Oletus"</string>
diff --git a/java/res/values-it/strings.xml b/java/res/values-it/strings.xml
index 1567c2080..49c7b9267 100644
--- a/java/res/values-it/strings.xml
+++ b/java/res/values-it/strings.xml
@@ -36,10 +36,8 @@
<string name="advanced_settings_summary" msgid="4487980456152830271">"Opzioni per esperti"</string>
<string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Altri metodi immissione"</string>
<string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Il tasto per cambiare lingua offre altri metodi di immissione"</string>
- <!-- no translation found for show_language_switch_key (5915478828318774384) -->
- <skip />
- <!-- no translation found for show_language_switch_key_summary (7343403647474265713) -->
- <skip />
+ <string name="show_language_switch_key" msgid="5915478828318774384">"Tasto cambio lingua"</string>
+ <string name="show_language_switch_key_summary" msgid="7343403647474265713">"Mostra quando sono attive più lingue di immissione"</string>
<string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Ritardo eliminaz. popup tasto"</string>
<string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Nessun ritardo"</string>
<string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Predefinito"</string>
diff --git a/java/res/values-iw/strings.xml b/java/res/values-iw/strings.xml
index 5b6315b71..20eed68e5 100644
--- a/java/res/values-iw/strings.xml
+++ b/java/res/values-iw/strings.xml
@@ -36,10 +36,8 @@
<string name="advanced_settings_summary" msgid="4487980456152830271">"אפשרויות למומחים"</string>
<string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"עבור לשיטות קלט אחרות"</string>
<string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"מתג החלפת השפה מכסה גם שיטות קלט אחרות"</string>
- <!-- no translation found for show_language_switch_key (5915478828318774384) -->
- <skip />
- <!-- no translation found for show_language_switch_key_summary (7343403647474265713) -->
- <skip />
+ <string name="show_language_switch_key" msgid="5915478828318774384">"מתג החלפת שפה"</string>
+ <string name="show_language_switch_key_summary" msgid="7343403647474265713">"הצג כאשר מורשה שימוש בשפות קלט מרובות"</string>
<string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"עיכוב סגירת חלון קופץ של מקש"</string>
<string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"ללא עיכוב"</string>
<string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"ברירת מחדל"</string>
diff --git a/java/res/values-sv/strings.xml b/java/res/values-sv/strings.xml
index 1ec59d914..8a83de6bb 100644
--- a/java/res/values-sv/strings.xml
+++ b/java/res/values-sv/strings.xml
@@ -36,10 +36,8 @@
<string name="advanced_settings_summary" msgid="4487980456152830271">"Alternativ för experter"</string>
<string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Byt till annan inmatning"</string>
<string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Språkbytesknappen omfattar även andra inmatningsmetoder"</string>
- <!-- no translation found for show_language_switch_key (5915478828318774384) -->
- <skip />
- <!-- no translation found for show_language_switch_key_summary (7343403647474265713) -->
- <skip />
+ <string name="show_language_switch_key" msgid="5915478828318774384">"Knapp för att byta språk"</string>
+ <string name="show_language_switch_key_summary" msgid="7343403647474265713">"Visa när flera inmatningsspråk är aktiverade"</string>
<string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Ta bort popup-fördröjning"</string>
<string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Fördröj inte"</string>
<string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Standard"</string>
diff --git a/java/res/values-sw/strings.xml b/java/res/values-sw/strings.xml
index 453b2806b..62cc82444 100644
--- a/java/res/values-sw/strings.xml
+++ b/java/res/values-sw/strings.xml
@@ -36,10 +36,8 @@
<string name="advanced_settings_summary" msgid="4487980456152830271">"Chaguo za wataalamu"</string>
<string name="include_other_imes_in_language_switch_list" msgid="4533689960308565519">"Badilisha hadi kwa mbinu zingine za ingizo"</string>
<string name="include_other_imes_in_language_switch_list_summary" msgid="840637129103317635">"Ufunguo wa kubadilisha lugha unashughulikia mbinu zingine za ingizo pia"</string>
- <!-- no translation found for show_language_switch_key (5915478828318774384) -->
- <skip />
- <!-- no translation found for show_language_switch_key_summary (7343403647474265713) -->
- <skip />
+ <string name="show_language_switch_key" msgid="5915478828318774384">"Kitufe cha kubadilisha lugha"</string>
+ <string name="show_language_switch_key_summary" msgid="7343403647474265713">"Onyesha wakati lugha ingizo mbalimbali zinapowezeshwa"</string>
<string name="key_preview_popup_dismiss_delay" msgid="6213164897443068248">"Kuchelewesha kutupa kitufe ibukizi"</string>
<string name="key_preview_popup_dismiss_no_delay" msgid="2096123151571458064">"Hakuna kuchelewa"</string>
<string name="key_preview_popup_dismiss_default_delay" msgid="2166964333903906734">"Chaguo-msingi"</string>
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 7e8c77e13..acc5df2e5 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -125,6 +125,8 @@
<attr name="longPressShiftKeyTimeout" format="integer" />
<!-- Ignore special key timeout while typing in millisecond. -->
<attr name="ignoreAltCodeKeyTimeout" format="integer" />
+ <!-- Disable gesture input while fast typing timer in millisecond. -->
+ <attr name="disableGestureWhileFastTypingTimeout" format="integer" />
<!-- More keys keyboard will shown at touched point. -->
<attr name="showMoreKeysKeyboardAtTouchedPoint" format="boolean" />
</declare-styleable>
diff --git a/java/res/values/config.xml b/java/res/values/config.xml
index 8e2d43e4e..1f6adffbb 100644
--- a/java/res/values/config.xml
+++ b/java/res/values/config.xml
@@ -66,6 +66,7 @@
<!-- Long pressing shift will invoke caps-lock if > 0, never invoke caps-lock if == 0 -->
<integer name="config_long_press_shift_key_timeout">1200</integer>
<integer name="config_ignore_alt_code_key_timeout">350</integer>
+ <integer name="config_disable_gesture_while_fast_typing_timeout">350</integer>
<!-- Showing more keys keyboard, just above the touched point if true, aligned to the key if
false -->
<bool name="config_show_more_keys_keyboard_at_touched_point">false</bool>
diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml
index ed92440ef..d52039221 100644
--- a/java/res/values/styles.xml
+++ b/java/res/values/styles.xml
@@ -89,6 +89,7 @@
<item name="longPressKeyTimeout">@integer/config_long_press_key_timeout</item>
<item name="longPressShiftKeyTimeout">@integer/config_long_press_shift_key_timeout</item>
<item name="ignoreAltCodeKeyTimeout">@integer/config_ignore_alt_code_key_timeout</item>
+ <item name="disableGestureWhileFastTypingTimeout">@integer/config_disable_gesture_while_fast_typing_timeout</item>
<item name="showMoreKeysKeyboardAtTouchedPoint">@bool/config_show_more_keys_keyboard_at_touched_point</item>
<item name="languageOnSpacebarFinalAlpha">@integer/config_language_on_spacebar_final_alpha</item>
<item name="languageOnSpacebarFadeoutAnimator">@anim/language_on_spacebar_fadeout</item>
diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
index 4ed0f58e1..f5c1b7a0c 100644
--- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
@@ -142,12 +142,14 @@ public class MainKeyboardView extends KeyboardView implements PointerTracker.Key
private static final int MSG_REPEAT_KEY = 1;
private static final int MSG_LONGPRESS_KEY = 2;
private static final int MSG_DOUBLE_TAP = 3;
+ private static final int MSG_DISABLE_GESTURE_EXPIRED = 4;
private final int mKeyRepeatStartTimeout;
private final int mKeyRepeatInterval;
private final int mLongPressKeyTimeout;
private final int mLongPressShiftKeyTimeout;
private final int mIgnoreAltCodeKeyTimeout;
+ private final int mDisableGestureWhileFastTypingTimeout;
public KeyTimerHandler(final MainKeyboardView outerInstance,
final TypedArray mainKeyboardViewAttr) {
@@ -163,6 +165,8 @@ public class MainKeyboardView extends KeyboardView implements PointerTracker.Key
R.styleable.MainKeyboardView_longPressShiftKeyTimeout, 0);
mIgnoreAltCodeKeyTimeout = mainKeyboardViewAttr.getInt(
R.styleable.MainKeyboardView_ignoreAltCodeKeyTimeout, 0);
+ mDisableGestureWhileFastTypingTimeout = mainKeyboardViewAttr.getInt(
+ R.styleable.MainKeyboardView_disableGestureWhileFastTypingTimeout, 0);
}
@Override
@@ -187,6 +191,9 @@ public class MainKeyboardView extends KeyboardView implements PointerTracker.Key
KeyboardSwitcher.getInstance().onLongPressTimeout(msg.arg1);
}
break;
+ case MSG_DISABLE_GESTURE_EXPIRED:
+ PointerTracker.clearGestureOffWhileFastTyping();
+ break;
}
}
@@ -312,6 +319,14 @@ public class MainKeyboardView extends KeyboardView implements PointerTracker.Key
}
@Override
+ public void startGestureOffWhileFastTypingTimer() {
+ removeMessages(MSG_DISABLE_GESTURE_EXPIRED);
+ PointerTracker.setGestureOffWhileFastTyping();
+ sendMessageDelayed(obtainMessage(MSG_DISABLE_GESTURE_EXPIRED),
+ mDisableGestureWhileFastTypingTimeout);
+ }
+
+ @Override
public void startDoubleTapTimer() {
sendMessageDelayed(obtainMessage(MSG_DOUBLE_TAP),
ViewConfiguration.getDoubleTapTimeout());
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
index d4902ec28..0778ad902 100644
--- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java
+++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
@@ -46,6 +46,7 @@ public class PointerTracker implements PointerTrackerQueue.Element {
private static boolean sMainDictionaryAvailable = false;
private static boolean sGestureHandlingEnabledByInputField = false;
private static boolean sGestureHandlingEnabledByUser = false;
+ private static boolean sGestureOffWhileFastTyping = false;
public interface KeyEventHandler {
/**
@@ -84,6 +85,7 @@ public class PointerTracker implements PointerTrackerQueue.Element {
public interface TimerProxy {
public void startTypingStateTimer(Key typedKey);
public boolean isTypingState();
+ public void startGestureOffWhileFastTypingTimer();
public void startKeyRepeatTimer(PointerTracker tracker);
public void startLongPressTimer(PointerTracker tracker);
public void startLongPressTimer(int code);
@@ -99,6 +101,8 @@ public class PointerTracker implements PointerTrackerQueue.Element {
@Override
public boolean isTypingState() { return false; }
@Override
+ public void startGestureOffWhileFastTypingTimer() {}
+ @Override
public void startKeyRepeatTimer(PointerTracker tracker) {}
@Override
public void startLongPressTimer(PointerTracker tracker) {}
@@ -225,6 +229,7 @@ public class PointerTracker implements PointerTrackerQueue.Element {
private static void updateGestureHandlingMode() {
sShouldHandleGesture = sMainDictionaryAvailable
+ && !sGestureOffWhileFastTyping
&& sGestureHandlingEnabledByInputField
&& sGestureHandlingEnabledByUser
&& !AccessibilityUtils.getInstance().isTouchExplorationEnabled();
@@ -241,6 +246,16 @@ public class PointerTracker implements PointerTrackerQueue.Element {
updateGestureHandlingMode();
}
+ public static void setGestureOffWhileFastTyping() {
+ sGestureOffWhileFastTyping = true;
+ updateGestureHandlingMode();
+ }
+
+ public static void clearGestureOffWhileFastTyping() {
+ sGestureOffWhileFastTyping = false;
+ updateGestureHandlingMode();
+ }
+
public static PointerTracker getPointerTracker(final int id, final KeyEventHandler handler) {
final ArrayList<PointerTracker> trackers = sTrackers;
@@ -346,8 +361,10 @@ public class PointerTracker implements PointerTrackerQueue.Element {
if (key.isEnabled() || altersCode) {
if (code == Keyboard.CODE_OUTPUT_TEXT) {
mListener.onTextInput(key.getOutputText());
+ mTimerProxy.startGestureOffWhileFastTypingTimer();
} else if (code != Keyboard.CODE_UNSPECIFIED) {
mListener.onCodeInput(code, x, y);
+ mTimerProxy.startGestureOffWhileFastTypingTimer();
}
}
}
@@ -668,18 +685,13 @@ public class PointerTracker implements PointerTrackerQueue.Element {
if (!sShouldHandleGesture) {
return;
}
- final int activePointerTrackerCount = getActivePointerTrackerCount();
- if (activePointerTrackerCount == 1) {
- mIsDetectingGesture = false;
- // A gesture should start only from the letter key.
- final boolean isAlphabetKeyboard = (mKeyboard != null)
- && mKeyboard.mId.isAlphabetKeyboard();
- if (isAlphabetKeyboard && !mIsShowingMoreKeysPanel && key != null
- && Keyboard.isLetterCode(key.mCode)) {
+ // A gesture should start only from the letter key.
+ mIsDetectingGesture = (mKeyboard != null) && mKeyboard.mId.isAlphabetKeyboard()
+ && !mIsShowingMoreKeysPanel && key != null && Keyboard.isLetterCode(key.mCode);
+ if (mIsDetectingGesture) {
+ if (getActivePointerTrackerCount() == 1) {
sGestureFirstDownTime = eventTime;
- onGestureDownEvent(x, y, eventTime);
}
- } else if (sInGesture && activePointerTrackerCount > 1) {
onGestureDownEvent(x, y, eventTime);
}
}
diff --git a/java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java b/java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java
index 73413f698..193c3a4ba 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java
@@ -45,7 +45,7 @@ public class GestureStroke {
private int mDetectFastMoveY;
// TODO: Move some of these to resource.
- private static final float START_GESTURE_LENGTH_THRESHOLD_RATIO_TO_KEY_WIDTH = 0.75f;
+ private static final float START_GESTURE_LENGTH_THRESHOLD_RATIO_TO_KEY_WIDTH = 0.60f;
private static final int START_GESTURE_DURATION_THRESHOLD = 70; // msec
private static final int MIN_GESTURE_RECOGNITION_TIME = 100; // msec
private static final float MIN_GESTURE_SAMPLING_RATIO_TO_KEY_WIDTH = 1.0f / 6.0f;
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 9252b0980..b8a8f9aaf 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -715,11 +715,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mSpaceState = SPACE_STATE_NONE;
if (mSuggestionStripView != null) {
- mSuggestionStripView.clear();
+ // This will set the punctuation suggestions if next word suggestion is off;
+ // otherwise it will clear the suggestion strip.
+ setPunctuationSuggestions();
}
}
- mConnection.resetCachesUponCursorMove(mLastSelectionStart);
+ mConnection.resetCachesUponCursorMove(editorInfo.initialSelStart);
if (isDifferentTextField) {
mainKeyboardView.closing();
@@ -856,16 +858,25 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// TODO: the following is probably better done in resetEntireInputState().
// it should only happen when the cursor moved, and the very purpose of the
// test below is to narrow down whether this happened or not. Likewise with
- // the call to postUpdateShiftState.
+ // the call to updateShiftState.
// We set this to NONE because after a cursor move, we don't want the space
// state-related special processing to kick in.
mSpaceState = SPACE_STATE_NONE;
if ((!mWordComposer.isComposingWord()) || selectionChanged || noComposingSpan) {
+ // If we are composing a word and moving the cursor, we would want to set a
+ // suggestion span for recorrection to work correctly. Unfortunately, that
+ // would involve the keyboard committing some new text, which would move the
+ // cursor back to where it was. Latin IME could then fix the position of the cursor
+ // again, but the asynchronous nature of the calls results in this wreaking havoc
+ // with selection on double tap and the like.
+ // Another option would be to send suggestions each time we set the composing
+ // text, but that is probably too expensive to do, so we decided to leave things
+ // as is.
resetEntireInputState(newSelStart);
}
- mHandler.postUpdateShiftState();
+ mKeyboardSwitcher.updateShiftState();
}
mExpectingUpdateSelection = false;
// TODO: Decide to call restartSuggestionsOnWordBeforeCursorIfAtEndOfWord() or not
@@ -1087,11 +1098,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (!mWordComposer.isComposingWord()) return;
final CharSequence typedWord = mWordComposer.getTypedWord();
if (typedWord.length() > 0) {
- mConnection.commitText(typedWord, 1);
- final CharSequence prevWord = addToUserHistoryDictionary(typedWord);
- mLastComposedWord = mWordComposer.commitWord(
- LastComposedWord.COMMIT_TYPE_USER_TYPED_WORD, typedWord.toString(),
- separatorString, prevWord);
+ commitChosenWord(typedWord, LastComposedWord.COMMIT_TYPE_USER_TYPED_WORD,
+ separatorString);
}
}
@@ -1551,7 +1559,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
private void handleBackspace(final int spaceState) {
- // In many cases, we may have to put the keyboard in auto-shift state again.
+ // In many cases, we may have to put the keyboard in auto-shift state again. However
+ // we want to wait a few milliseconds before doing it to avoid the keyboard flashing
+ // during key repeat.
mHandler.postUpdateShiftState();
if (mWordComposer.isComposingWord()) {
@@ -1791,7 +1801,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
Utils.Stats.onSeparator((char)primaryCode, x, y);
}
- mHandler.postUpdateShiftState();
+ mKeyboardSwitcher.updateShiftState();
return didAutoCorrect;
}
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java
index 397532933..ac0fb0ece 100644
--- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java
+++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java
@@ -92,7 +92,7 @@ public class BinaryDictIOUtils {
}
if (p.mPosition == p.mNumOfCharGroup) {
- if (formatOptions.mHasLinkedListNode) {
+ if (formatOptions.mSupportsDynamicUpdate) {
final int forwardLinkAddress = buffer.readUnsignedInt24();
if (forwardLinkAddress != FormatSpec.NO_FORWARD_LINK_ADDRESS) {
// the node has a forward link.
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
index 7b8dc5cc5..4806bf9dc 100644
--- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
+++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
@@ -376,7 +376,7 @@ public class BinaryDictInputOutput {
g.mCachedSize = groupSize;
size += groupSize;
}
- if (options.mHasLinkedListNode) {
+ if (options.mSupportsDynamicUpdate) {
size += FormatSpec.FORWARD_LINK_ADDRESS_SIZE;
}
node.mCachedSize = size;
@@ -390,11 +390,11 @@ public class BinaryDictInputOutput {
}
/**
- * Helper method to check whether the CharGroup has a parent address.
+ * Helper method to check whether the dictionary can be updated dynamically.
*/
- public static boolean hasParentAddress(final FormatOptions options) {
- return options.mVersion >= FormatSpec.FIRST_VERSION_WITH_PARENT_ADDRESS
- && options.mHasParentAddress;
+ public static boolean supportsDynamicUpdate(final FormatOptions options) {
+ return options.mVersion >= FormatSpec.FIRST_VERSION_WITH_DYNAMIC_UPDATE
+ && options.mSupportsDynamicUpdate;
}
/**
@@ -404,7 +404,7 @@ public class BinaryDictInputOutput {
* @param options file format options.
*/
private static int getGroupHeaderSize(final CharGroup group, final FormatOptions options) {
- if (hasParentAddress(options)) {
+ if (supportsDynamicUpdate(options)) {
return FormatSpec.GROUP_FLAGS_SIZE + FormatSpec.PARENT_ADDRESS_SIZE
+ getGroupCharactersSize(group);
} else {
@@ -530,7 +530,7 @@ public class BinaryDictInputOutput {
group.mCachedSize = groupSize;
size += groupSize;
}
- if (formatOptions.mHasLinkedListNode) {
+ if (formatOptions.mSupportsDynamicUpdate) {
size += FormatSpec.FORWARD_LINK_ADDRESS_SIZE;
}
if (node.mCachedSize != size) {
@@ -559,7 +559,8 @@ public class BinaryDictInputOutput {
groupOffset += g.mCachedSize;
}
final int nodeSize = groupCountSize + groupOffset
- + (formatOptions.mHasLinkedListNode ? FormatSpec.FORWARD_LINK_ADDRESS_SIZE : 0);
+ + (formatOptions.mSupportsDynamicUpdate
+ ? FormatSpec.FORWARD_LINK_ADDRESS_SIZE : 0);
if (nodeSize != n.mCachedSize) {
throw new RuntimeException("Bug : Stored and computed node size differ");
}
@@ -792,8 +793,7 @@ public class BinaryDictInputOutput {
return (options.mFrenchLigatureProcessing ? FormatSpec.FRENCH_LIGATURE_PROCESSING_FLAG : 0)
+ (options.mGermanUmlautProcessing ? FormatSpec.GERMAN_UMLAUT_PROCESSING_FLAG : 0)
+ (hasBigrams ? FormatSpec.CONTAINS_BIGRAMS_FLAG : 0)
- + (formatOptions.mHasParentAddress ? FormatSpec.HAS_PARENT_ADDRESS : 0)
- + (formatOptions.mHasLinkedListNode ? FormatSpec.HAS_LINKEDLIST_NODE : 0);
+ + (formatOptions.mSupportsDynamicUpdate ? FormatSpec.SUPPORTS_DYNAMIC_UPDATE : 0);
}
/**
@@ -857,7 +857,7 @@ public class BinaryDictInputOutput {
byte flags = makeCharGroupFlags(group, groupAddress, childrenOffset);
buffer[index++] = flags;
- if (hasParentAddress(formatOptions)) {
+ if (supportsDynamicUpdate(formatOptions)) {
if (parentAddress == FormatSpec.NO_PARENT_ADDRESS) {
// this node is the root node.
buffer[index] = buffer[index + 1] = buffer[index + 2] = 0;
@@ -927,7 +927,7 @@ public class BinaryDictInputOutput {
}
}
- if (formatOptions.mHasLinkedListNode) {
+ if (formatOptions.mSupportsDynamicUpdate) {
buffer[index] = buffer[index + 1] = buffer[index + 2]
= FormatSpec.NO_FORWARD_LINK_ADDRESS;
index += FormatSpec.FORWARD_LINK_ADDRESS_SIZE;
@@ -1112,7 +1112,7 @@ public class BinaryDictInputOutput {
++addressPointer;
final int parentAddress;
- if (hasParentAddress(options)) {
+ if (supportsDynamicUpdate(options)) {
// read the parent address. (version 3)
parentAddress = -buffer.readUnsignedInt24();
addressPointer += 3;
@@ -1251,7 +1251,7 @@ public class BinaryDictInputOutput {
final String result;
final int originalPointer = buffer.position();
- if (hasParentAddress(formatOptions)) {
+ if (supportsDynamicUpdate(formatOptions)) {
result = getWordAtAddressWithParentAddress(buffer, headerSize, address, formatOptions);
} else {
result = getWordAtAddressWithoutParentAddress(buffer, headerSize, address,
@@ -1392,7 +1392,7 @@ public class BinaryDictInputOutput {
}
// reach the end of the array.
- if (options.mHasLinkedListNode) {
+ if (options.mSupportsDynamicUpdate) {
final int nextAddress = buffer.readUnsignedInt24();
if (nextAddress >= 0 && nextAddress < buffer.limit()) {
buffer.position(nextAddress);
@@ -1400,7 +1400,7 @@ public class BinaryDictInputOutput {
break;
}
}
- } while (options.mHasLinkedListNode &&
+ } while (options.mSupportsDynamicUpdate &&
buffer.position() != FormatSpec.NO_FORWARD_LINK_ADDRESS);
final Node node = new Node(nodeContents);
@@ -1469,8 +1469,7 @@ public class BinaryDictInputOutput {
0 != (optionsFlags & FormatSpec.GERMAN_UMLAUT_PROCESSING_FLAG),
0 != (optionsFlags & FormatSpec.FRENCH_LIGATURE_PROCESSING_FLAG)),
new FormatOptions(version,
- 0 != (optionsFlags & FormatSpec.HAS_PARENT_ADDRESS),
- 0 != (optionsFlags & FormatSpec.HAS_LINKEDLIST_NODE)));
+ 0 != (optionsFlags & FormatSpec.SUPPORTS_DYNAMIC_UPDATE)));
return header;
}
diff --git a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
index adc6037bb..63a61b46f 100644
--- a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
+++ b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
@@ -145,17 +145,14 @@ public final class FormatSpec {
static final int MAXIMUM_SUPPORTED_VERSION = 3;
static final int NOT_A_VERSION_NUMBER = -1;
static final int FIRST_VERSION_WITH_HEADER_SIZE = 2;
- static final int FIRST_VERSION_WITH_PARENT_ADDRESS = 3;
- static final int FIRST_VERSION_WITH_LINKEDLIST_NODE = 3;
+ static final int FIRST_VERSION_WITH_DYNAMIC_UPDATE = 3;
// These options need to be the same numeric values as the one in the native reading code.
static final int GERMAN_UMLAUT_PROCESSING_FLAG = 0x1;
// TODO: Make the native reading code read this variable.
- static final int HAS_PARENT_ADDRESS = 0x2;
+ static final int SUPPORTS_DYNAMIC_UPDATE = 0x2;
static final int FRENCH_LIGATURE_PROCESSING_FLAG = 0x4;
static final int CONTAINS_BIGRAMS_FLAG = 0x8;
- // TODO: Make the native reading code read this variable.
- static final int HAS_LINKEDLIST_NODE = 0x10;
// TODO: Make this value adaptative to content data, store it in the header, and
// use it in the reading code.
@@ -215,31 +212,17 @@ public final class FormatSpec {
*/
public static class FormatOptions {
public final int mVersion;
- public final boolean mHasParentAddress;
- public final boolean mHasLinkedListNode;
+ public final boolean mSupportsDynamicUpdate;
public FormatOptions(final int version) {
this(version, false);
}
- public FormatOptions(final int version, final boolean hasParentAddress) {
- this(version, hasParentAddress, false);
- }
- public FormatOptions(final int version, final boolean hasParentAddress,
- final boolean hasLinkedListNode) {
+ public FormatOptions(final int version, final boolean supportsDynamicUpdate) {
mVersion = version;
- if (version < FIRST_VERSION_WITH_PARENT_ADDRESS && hasParentAddress) {
- throw new RuntimeException("Parent addresses are only supported with versions "
- + FIRST_VERSION_WITH_PARENT_ADDRESS + " and ulterior.");
- }
- mHasParentAddress = hasParentAddress;
-
- if (version < FIRST_VERSION_WITH_LINKEDLIST_NODE && hasLinkedListNode) {
- throw new RuntimeException("Linked list nodes are only supported with versions "
- + FIRST_VERSION_WITH_LINKEDLIST_NODE + " and ulterior.");
- }
- if (!hasParentAddress && hasLinkedListNode) {
- throw new RuntimeException("Linked list nodes need parent addresses.");
+ if (version < FIRST_VERSION_WITH_DYNAMIC_UPDATE && supportsDynamicUpdate) {
+ throw new RuntimeException("Dynamic updates are only supported with versions "
+ + FIRST_VERSION_WITH_DYNAMIC_UPDATE + " and ulterior.");
}
- mHasLinkedListNode = hasLinkedListNode;
+ mSupportsDynamicUpdate = supportsDynamicUpdate;
}
}