Merge "Fix text color of main key labels in shifted state" into honeycomb
diff --git a/java/res/drawable-land-hdpi/keyboard_suggest_strip_divider.png b/java/res/drawable-land-hdpi/keyboard_suggest_strip_divider.png
deleted file mode 100755
index 1a03c52..0000000
--- a/java/res/drawable-land-hdpi/keyboard_suggest_strip_divider.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard.png b/java/res/drawable/ic_subtype_keyboard.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard.png
+++ b/java/res/drawable/ic_subtype_keyboard.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_cs.png b/java/res/drawable/ic_subtype_keyboard_cs.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_cs.png
+++ b/java/res/drawable/ic_subtype_keyboard_cs.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_da.png b/java/res/drawable/ic_subtype_keyboard_da.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_da.png
+++ b/java/res/drawable/ic_subtype_keyboard_da.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_de.png b/java/res/drawable/ic_subtype_keyboard_de.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_de.png
+++ b/java/res/drawable/ic_subtype_keyboard_de.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_en_gb.png b/java/res/drawable/ic_subtype_keyboard_en_gb.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_en_gb.png
+++ b/java/res/drawable/ic_subtype_keyboard_en_gb.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_en_us.png b/java/res/drawable/ic_subtype_keyboard_en_us.png
index 8ed6cc8..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_en_us.png
+++ b/java/res/drawable/ic_subtype_keyboard_en_us.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_es.png b/java/res/drawable/ic_subtype_keyboard_es.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_es.png
+++ b/java/res/drawable/ic_subtype_keyboard_es.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_es_us.png b/java/res/drawable/ic_subtype_keyboard_es_us.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_es_us.png
+++ b/java/res/drawable/ic_subtype_keyboard_es_us.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_fr.png b/java/res/drawable/ic_subtype_keyboard_fr.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_fr.png
+++ b/java/res/drawable/ic_subtype_keyboard_fr.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_fr_ca.png b/java/res/drawable/ic_subtype_keyboard_fr_ca.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_fr_ca.png
+++ b/java/res/drawable/ic_subtype_keyboard_fr_ca.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_fr_ch.png b/java/res/drawable/ic_subtype_keyboard_fr_ch.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_fr_ch.png
+++ b/java/res/drawable/ic_subtype_keyboard_fr_ch.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_it.png b/java/res/drawable/ic_subtype_keyboard_it.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_it.png
+++ b/java/res/drawable/ic_subtype_keyboard_it.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_nb.png b/java/res/drawable/ic_subtype_keyboard_nb.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_nb.png
+++ b/java/res/drawable/ic_subtype_keyboard_nb.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_nl.png b/java/res/drawable/ic_subtype_keyboard_nl.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_nl.png
+++ b/java/res/drawable/ic_subtype_keyboard_nl.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_ru.png b/java/res/drawable/ic_subtype_keyboard_ru.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_ru.png
+++ b/java/res/drawable/ic_subtype_keyboard_ru.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_sr.png b/java/res/drawable/ic_subtype_keyboard_sr.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_sr.png
+++ b/java/res/drawable/ic_subtype_keyboard_sr.png
Binary files differ
diff --git a/java/res/drawable/ic_subtype_keyboard_sv.png b/java/res/drawable/ic_subtype_keyboard_sv.png
index ef5fe4b..001a38c 100644
--- a/java/res/drawable/ic_subtype_keyboard_sv.png
+++ b/java/res/drawable/ic_subtype_keyboard_sv.png
Binary files differ
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index ad783ca..addc6c7 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -776,11 +776,11 @@
     @Override
     public void onDisplayCompletions(CompletionInfo[] applicationSpecifiedCompletions) {
         if (DEBUG) {
-            Log.i("foo", "Received completions:");
+            Log.i(TAG, "Received completions:");
             final int count = (applicationSpecifiedCompletions != null)
                     ? applicationSpecifiedCompletions.length : 0;
             for (int i = 0; i < count; i++) {
-                Log.i("foo", "  #" + i + ": " + applicationSpecifiedCompletions[i]);
+                Log.i(TAG, "  #" + i + ": " + applicationSpecifiedCompletions[i]);
             }
         }
         if (mApplicationSpecifiedCompletionOn) {
@@ -1447,7 +1447,6 @@
     }
 
     private void showSuggestions(WordComposer word) {
-        // long startTime = System.currentTimeMillis(); // TIME MEASUREMENT!
         // TODO Maybe need better way of retrieving previous word
         CharSequence prevWord = EditingUtils.getPreviousWord(getCurrentInputConnection(),
                 mWordSeparators);
@@ -1459,9 +1458,9 @@
 
         boolean correctionAvailable = !mInputTypeNoAutoCorrect && !mJustReverted
                 && mSuggest.hasMinimalCorrection();
-        CharSequence typedWord = word.getTypedWord();
+        final CharSequence typedWord = word.getTypedWord();
         // If we're in basic correct
-        boolean typedWordValid = mSuggest.isValidWord(typedWord) ||
+        final boolean typedWordValid = mSuggest.isValidWord(typedWord) ||
                 (preferCapitalization()
                         && mSuggest.isValidWord(typedWord.toString().toLowerCase()));
         if (mCorrectionMode == Suggest.CORRECTION_FULL
@@ -1472,7 +1471,13 @@
         correctionAvailable &= !word.isMostlyCaps();
         correctionAvailable &= !TextEntryState.isCorrecting();
 
-        if (builder.size() > 1 || mCandidateView.isShowingAddToDictionaryHint()) {
+        // Basically, we update the suggestion strip only when suggestion count > 1.  However,
+        // there is an exception: We update the suggestion strip whenever typed word's length
+        // is 1, regardless of suggestion count.  Actually, in most cases, suggestion count is 1
+        // when typed word's length is 1, but we do always need to clear the previous state when
+        // the user starts typing a word (i.e. typed word's length == 1).
+        if (typedWord.length() == 1 || builder.size() > 1
+                || mCandidateView.isShowingAddToDictionaryHint()) {
             builder.setTypedWordValid(typedWordValid).setHasMinimalSuggestion(correctionAvailable);
         } else {
             final SuggestedWords previousSuggestions = mCandidateView.getSuggestions();