From c130be877987afe675869d2cbea9d5a49b4ad419 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 22 Oct 2013 10:51:11 +0900 Subject: Add a sequence number to SuggestedWords. This allows testing for suggestion freshness in an asynchronous suggestions world. In-advance cherrypick of Ic76cd17568598d8534aec81e037f9e37f52eb6b4 because there's a merge conflict. Bug: 11301597 Change-Id: I4aec765a975298fcac30a48dede73d2622224fe5 --- .../com/android/inputmethod/latin/LatinIME.java | 125 ++++++++++++--------- .../src/com/android/inputmethod/latin/Suggest.java | 18 +-- .../android/inputmethod/latin/SuggestedWords.java | 14 +++ 3 files changed, 100 insertions(+), 57 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index e8ebf8860..2ddef3cbf 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1836,12 +1836,15 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen @Override public boolean handleMessage(final Message msg) { + // TODO: straighten message passing - we don't need two kinds of messages calling + // each other. switch (msg.what) { case MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP: - updateBatchInput((InputPointers)msg.obj); + updateBatchInput((InputPointers)msg.obj, msg.arg2 /* sequenceNumber */); break; case MSG_GET_SUGGESTED_WORDS: - mLatinIme.getSuggestedWords(msg.arg1, (OnGetSuggestedWordsCallback) msg.obj); + mLatinIme.getSuggestedWords(msg.arg1 /* sessionId */, + msg.arg2 /* sequenceNumber */, (OnGetSuggestedWordsCallback) msg.obj); break; } return true; @@ -1858,14 +1861,15 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } // Run in the Handler thread. - private void updateBatchInput(final InputPointers batchPointers) { + private void updateBatchInput(final InputPointers batchPointers, final int sequenceNumber) { synchronized (mLock) { if (!mInBatchInput) { // Batch input has ended or canceled while the message was being delivered. return; } - getSuggestedWordsGestureLocked(batchPointers, new OnGetSuggestedWordsCallback() { + getSuggestedWordsGestureLocked(batchPointers, sequenceNumber, + new OnGetSuggestedWordsCallback() { @Override public void onGetSuggestedWords(final SuggestedWords suggestedWords) { mLatinIme.mHandler.showGesturePreviewAndSuggestionStrip( @@ -1876,13 +1880,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } // Run in the UI thread. - public void onUpdateBatchInput(final InputPointers batchPointers) { + public void onUpdateBatchInput(final InputPointers batchPointers, + final int sequenceNumber) { if (mHandler.hasMessages(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP)) { return; } - mHandler.obtainMessage( - MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP, batchPointers) - .sendToTarget(); + mHandler.obtainMessage(MSG_UPDATE_GESTURE_PREVIEW_AND_SUGGESTION_STRIP, 0 /* arg1 */, + sequenceNumber /* arg2 */, batchPointers /* obj */).sendToTarget(); } public void onCancelBatchInput() { @@ -1896,7 +1900,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // Run in the UI thread. public void onEndBatchInput(final InputPointers batchPointers) { synchronized(mLock) { - getSuggestedWordsGestureLocked(batchPointers, new OnGetSuggestedWordsCallback() { + getSuggestedWordsGestureLocked(batchPointers, SuggestedWords.NOT_A_SEQUENCE_NUMBER, + new OnGetSuggestedWordsCallback() { @Override public void onGetSuggestedWords(final SuggestedWords suggestedWords) { mInBatchInput = false; @@ -1911,10 +1916,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // {@link LatinIME#getSuggestedWords(int)} method calls with same session id have to // be synchronized. private void getSuggestedWordsGestureLocked(final InputPointers batchPointers, - final OnGetSuggestedWordsCallback callback) { + final int sequenceNumber, final OnGetSuggestedWordsCallback callback) { mLatinIme.mWordComposer.setBatchInputPointers(batchPointers); mLatinIme.getSuggestedWordsOrOlderSuggestionsAsync(Suggest.SESSION_GESTURE, - new OnGetSuggestedWordsCallback() { + sequenceNumber, new OnGetSuggestedWordsCallback() { @Override public void onGetSuggestedWords(SuggestedWords suggestedWords) { final int suggestionCount = suggestedWords.size(); @@ -1929,9 +1934,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen }); } - public void getSuggestedWords(final int sessionId, + public void getSuggestedWords(final int sessionId, final int sequenceNumber, final OnGetSuggestedWordsCallback callback) { - mHandler.obtainMessage(MSG_GET_SUGGESTED_WORDS, sessionId, 0, callback).sendToTarget(); + mHandler.obtainMessage(MSG_GET_SUGGESTED_WORDS, sessionId, sequenceNumber, callback) + .sendToTarget(); } private void onDestroy() { @@ -1952,11 +1958,28 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } } + /* The sequence number member is only used in onUpdateBatchInput. It is increased each time + * auto-commit happens. The reason we need this is, when auto-commit happens we trim the + * input pointers that are held in a singleton, and to know how much to trim we rely on the + * results of the suggestion process that is held in mSuggestedWords. + * However, the suggestion process is asynchronous, and sometimes we may enter the + * onUpdateBatchInput method twice without having recomputed suggestions yet, or having + * received new suggestions generated from not-yet-trimmed input pointers. In this case, the + * mIndexOfTouchPointOfSecondWords member will be out of date, and we must not use it lest we + * remove an unrelated number of pointers (possibly even more than are left in the input + * pointers, leading to a crash). + * To avoid that, we increase the sequence number each time we auto-commit and trim the + * input pointers, and we do not use any suggested words that have been generated with an + * earlier sequence number. + */ + private int mAutoCommitSequenceNumber = 1; @Override public void onUpdateBatchInput(final InputPointers batchPointers) { if (mSettings.getCurrent().mPhraseGestureEnabled) { final SuggestedWordInfo candidate = mSuggestedWords.getAutoCommitCandidate(); - if (null != candidate) { + // If these suggested words have been generated with out of date input pointers, then + // we skip auto-commit (see comments above on the mSequenceNumber member). + if (null != candidate && mSuggestedWords.mSequenceNumber >= mAutoCommitSequenceNumber) { if (candidate.mSourceDict.shouldAutoCommit(candidate)) { final String[] commitParts = candidate.mWord.split(" ", 2); batchPointers.shift(candidate.mIndexOfTouchPointOfSecondWord); @@ -1965,10 +1988,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mSpaceState = SPACE_STATE_PHANTOM; mKeyboardSwitcher.updateShiftState(); mWordComposer.setCapitalizedModeAtStartComposingTime(getActualCapsMode()); + ++mAutoCommitSequenceNumber; } } } - mInputUpdater.onUpdateBatchInput(batchPointers); + mInputUpdater.onUpdateBatchInput(batchPointers, mAutoCommitSequenceNumber); } // This method must run in UI Thread. @@ -2503,7 +2527,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final AsyncResultHolder holder = new AsyncResultHolder(); getSuggestedWordsOrOlderSuggestionsAsync(Suggest.SESSION_TYPING, - new OnGetSuggestedWordsCallback() { + SuggestedWords.NOT_A_SEQUENCE_NUMBER, new OnGetSuggestedWordsCallback() { @Override public void onGetSuggestedWords(final SuggestedWords suggestedWords) { holder.set(suggestedWords); @@ -2518,7 +2542,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } } - private void getSuggestedWords(final int sessionId, + private void getSuggestedWords(final int sessionId, final int sequenceNumber, final OnGetSuggestedWordsCallback callback) { final Keyboard keyboard = mKeyboardSwitcher.getKeyboard(); final Suggest suggest = mSuggest; @@ -2543,18 +2567,19 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } suggest.getSuggestedWords(mWordComposer, prevWord, keyboard.getProximityInfo(), currentSettings.mBlockPotentiallyOffensive, currentSettings.mCorrectionEnabled, - additionalFeaturesOptions, sessionId, callback); + additionalFeaturesOptions, sessionId, sequenceNumber, callback); } private void getSuggestedWordsOrOlderSuggestionsAsync(final int sessionId, - final OnGetSuggestedWordsCallback callback) { - mInputUpdater.getSuggestedWords(sessionId, new OnGetSuggestedWordsCallback() { - @Override - public void onGetSuggestedWords(SuggestedWords suggestedWords) { - callback.onGetSuggestedWords(maybeRetrieveOlderSuggestions( - mWordComposer.getTypedWord(), suggestedWords)); - } - }); + final int sequenceNumber, final OnGetSuggestedWordsCallback callback) { + mInputUpdater.getSuggestedWords(sessionId, sequenceNumber, + new OnGetSuggestedWordsCallback() { + @Override + public void onGetSuggestedWords(SuggestedWords suggestedWords) { + callback.onGetSuggestedWords(maybeRetrieveOlderSuggestions( + mWordComposer.getTypedWord(), suggestedWords)); + } + }); } private SuggestedWords maybeRetrieveOlderSuggestions(final String typedWord, @@ -2889,30 +2914,30 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // We come here if there weren't any suggestion spans on this word. We will try to // compute suggestions for it instead. mInputUpdater.getSuggestedWords(Suggest.SESSION_TYPING, - new OnGetSuggestedWordsCallback() { - @Override - public void onGetSuggestedWords( - final SuggestedWords suggestedWordsIncludingTypedWord) { - final SuggestedWords suggestedWords; - if (suggestedWordsIncludingTypedWord.size() > 1) { - // We were able to compute new suggestions for this word. - // Remove the typed word, since we don't want to display it in this case. - // The #getSuggestedWordsExcludingTypedWord() method sets willAutoCorrect to - // false. - suggestedWords = suggestedWordsIncludingTypedWord - .getSuggestedWordsExcludingTypedWord(); - } else { - // No saved suggestions, and we were unable to compute any good one either. - // Rather than displaying an empty suggestion strip, we'll display the - // original word alone in the middle. - // Since there is only one word, willAutoCorrect is false. - suggestedWords = suggestedWordsIncludingTypedWord; - } - // We need to pass typedWord because mWordComposer.mTypedWord may differ from - // typedWord. - unsetIsAutoCorrectionIndicatorOnAndCallShowSuggestionStrip(suggestedWords, - typedWord); - }}); + SuggestedWords.NOT_A_SEQUENCE_NUMBER, new OnGetSuggestedWordsCallback() { + @Override + public void onGetSuggestedWords( + final SuggestedWords suggestedWordsIncludingTypedWord) { + final SuggestedWords suggestedWords; + if (suggestedWordsIncludingTypedWord.size() > 1) { + // We were able to compute new suggestions for this word. + // Remove the typed word, since we don't want to display it in this + // case. The #getSuggestedWordsExcludingTypedWord() method sets + // willAutoCorrect to false. + suggestedWords = suggestedWordsIncludingTypedWord + .getSuggestedWordsExcludingTypedWord(); + } else { + // No saved suggestions, and we were unable to compute any good one + // either. Rather than displaying an empty suggestion strip, we'll + // display the original word alone in the middle. + // Since there is only one word, willAutoCorrect is false. + suggestedWords = suggestedWordsIncludingTypedWord; + } + // We need to pass typedWord because mWordComposer.mTypedWord may + // differ from typedWord. + unsetIsAutoCorrectionIndicatorOnAndCallShowSuggestionStrip( + suggestedWords, typedWord); + }}); } else { // We found suggestion spans in the word. We'll create the SuggestedWords out of // them, and make willAutoCorrect false. diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index c270d47d0..72b9c417c 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -217,15 +217,17 @@ public final class Suggest { public void getSuggestedWords(final WordComposer wordComposer, final String prevWordForBigram, final ProximityInfo proximityInfo, final boolean blockOffensiveWords, final boolean isCorrectionEnabled, - final int[] additionalFeaturesOptions, final int sessionId, + final int[] additionalFeaturesOptions, final int sessionId, final int sequenceNumber, final OnGetSuggestedWordsCallback callback) { LatinImeLogger.onStartSuggestion(prevWordForBigram); if (wordComposer.isBatchMode()) { getSuggestedWordsForBatchInput(wordComposer, prevWordForBigram, proximityInfo, - blockOffensiveWords, additionalFeaturesOptions, sessionId, callback); + blockOffensiveWords, additionalFeaturesOptions, sessionId, sequenceNumber, + callback); } else { getSuggestedWordsForTypingInput(wordComposer, prevWordForBigram, proximityInfo, - blockOffensiveWords, isCorrectionEnabled, additionalFeaturesOptions, callback); + blockOffensiveWords, isCorrectionEnabled, additionalFeaturesOptions, + sequenceNumber, callback); } } @@ -234,7 +236,8 @@ public final class Suggest { private void getSuggestedWordsForTypingInput(final WordComposer wordComposer, final String prevWordForBigram, final ProximityInfo proximityInfo, final boolean blockOffensiveWords, final boolean isCorrectionEnabled, - final int[] additionalFeaturesOptions, final OnGetSuggestedWordsCallback callback) { + final int[] additionalFeaturesOptions, final int sequenceNumber, + final OnGetSuggestedWordsCallback callback) { final int trailingSingleQuotesCount = wordComposer.trailingSingleQuotesCount(); final BoundedTreeSet suggestionsSet = new BoundedTreeSet(sSuggestedWordInfoComparator, MAX_SUGGESTIONS); @@ -347,7 +350,7 @@ public final class Suggest { hasAutoCorrection, /* willAutoCorrect */ false /* isPunctuationSuggestions */, false /* isObsoleteSuggestions */, - !wordComposer.isComposingWord() /* isPrediction */)); + !wordComposer.isComposingWord() /* isPrediction */, sequenceNumber)); } // Retrieves suggestions for the batch input @@ -355,7 +358,8 @@ public final class Suggest { private void getSuggestedWordsForBatchInput(final WordComposer wordComposer, final String prevWordForBigram, final ProximityInfo proximityInfo, final boolean blockOffensiveWords, final int[] additionalFeaturesOptions, - final int sessionId, final OnGetSuggestedWordsCallback callback) { + final int sessionId, final int sequenceNumber, + final OnGetSuggestedWordsCallback callback) { final BoundedTreeSet suggestionsSet = new BoundedTreeSet(sSuggestedWordInfoComparator, MAX_SUGGESTIONS); @@ -408,7 +412,7 @@ public final class Suggest { false /* willAutoCorrect */, false /* isPunctuationSuggestions */, false /* isObsoleteSuggestions */, - false /* isPrediction */)); + false /* isPrediction */, sequenceNumber)); } private static ArrayList getSuggestionsInfoListWithDebugInfo( diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java index fed4cdbbb..97c89dd4e 100644 --- a/java/src/com/android/inputmethod/latin/SuggestedWords.java +++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java @@ -29,6 +29,7 @@ import java.util.HashSet; public final class SuggestedWords { public static final int INDEX_OF_TYPED_WORD = 0; public static final int INDEX_OF_AUTO_CORRECTION = 1; + public static final int NOT_A_SEQUENCE_NUMBER = -1; private static final ArrayList EMPTY_WORD_INFO_LIST = CollectionUtils.newArrayList(0); @@ -43,6 +44,7 @@ public final class SuggestedWords { public final boolean mIsPunctuationSuggestions; public final boolean mIsObsoleteSuggestions; public final boolean mIsPrediction; + public final int mSequenceNumber; // Sequence number for auto-commit. private final ArrayList mSuggestedWordInfoList; public SuggestedWords(final ArrayList suggestedWordInfoList, @@ -51,12 +53,24 @@ public final class SuggestedWords { final boolean isPunctuationSuggestions, final boolean isObsoleteSuggestions, final boolean isPrediction) { + this(suggestedWordInfoList, typedWordValid, willAutoCorrect, isPunctuationSuggestions, + isObsoleteSuggestions, isPrediction, NOT_A_SEQUENCE_NUMBER); + } + + public SuggestedWords(final ArrayList suggestedWordInfoList, + final boolean typedWordValid, + final boolean willAutoCorrect, + final boolean isPunctuationSuggestions, + final boolean isObsoleteSuggestions, + final boolean isPrediction, + final int sequenceNumber) { mSuggestedWordInfoList = suggestedWordInfoList; mTypedWordValid = typedWordValid; mWillAutoCorrect = willAutoCorrect; mIsPunctuationSuggestions = isPunctuationSuggestions; mIsObsoleteSuggestions = isObsoleteSuggestions; mIsPrediction = isPrediction; + mSequenceNumber = sequenceNumber; } public boolean isEmpty() { -- cgit v1.2.3-83-g751a From 7da2295328a16d061a94c46c4cab21e46370ab41 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 11 Oct 2013 19:33:59 +0900 Subject: Fix a bug where autoshift would be ignored coming from emoji Bug: 11123691 Change-Id: I36474e12e34af95051129840865015f85595411b --- java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index 9f9fdaa6f..dd98c1703 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -327,6 +327,9 @@ public final class KeyboardState { } mIsAlphabetMode = false; mIsEmojiMode = true; + // Remember caps lock mode and reset alphabet shift state. + mPrevMainKeyboardWasShiftLocked = mAlphabetShiftState.isShiftLocked(); + mAlphabetShiftState.setShiftLocked(false); mSwitchActions.setEmojiKeyboard(); } -- cgit v1.2.3-83-g751a From 6bc5acaa793e0311fcfa4a0f12c49ced6d792729 Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Fri, 18 Oct 2013 19:53:57 +0900 Subject: Fix: Suggested words from user history are invalid. - Suggestions form user history can contain invalid words. - isValidWord always returns false. Bug: 11139426 Change-Id: I6075b275603332ddb00f4a9284afcaa82d824270 --- .../DecayingExpandableBinaryDictionaryBase.java | 9 --------- .../policyimpl/dictionary/dynamic_patricia_trie_policy.cpp | 11 +++++++++-- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java b/java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java index a1e36006b..1de15a333 100644 --- a/java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java +++ b/java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java @@ -113,15 +113,6 @@ public abstract class DecayingExpandableBinaryDictionaryBase extends ExpandableB return false; } - /** - * Return whether the passed charsequence is in the dictionary. - */ - @Override - public boolean isValidWord(final String word) { - // Words included only in the user history should be treated as not in dictionary words. - return false; - } - /** * Pair will be added to the decaying dictionary. * diff --git a/native/jni/src/suggest/policyimpl/dictionary/dynamic_patricia_trie_policy.cpp b/native/jni/src/suggest/policyimpl/dictionary/dynamic_patricia_trie_policy.cpp index a8ea69f3c..495b146c2 100644 --- a/native/jni/src/suggest/policyimpl/dictionary/dynamic_patricia_trie_policy.cpp +++ b/native/jni/src/suggest/policyimpl/dictionary/dynamic_patricia_trie_policy.cpp @@ -55,9 +55,16 @@ void DynamicPatriciaTriePolicy::createAndGetAllChildNodes(const DicNode *const d readingHelper.initWithPtNodeArrayPos(dicNode->getChildrenPos()); const DynamicPatriciaTrieNodeReader *const nodeReader = readingHelper.getNodeReader(); while (!readingHelper.isEnd()) { + bool isTerminal = nodeReader->isTerminal() && !nodeReader->isDeleted(); + if (isTerminal && mHeaderPolicy.isDecayingDict()) { + // A DecayingDict may have a terminal PtNode that has a terminal DicNode whose + // probability is NOT_A_PROBABILITY. In such case, we don't want to treat it as a + // valid terminal DicNode. + isTerminal = getProbability(nodeReader->getProbability(), NOT_A_PROBABILITY) + != NOT_A_PROBABILITY; + } childDicNodes->pushLeavingChild(dicNode, nodeReader->getHeadPos(), - nodeReader->getChildrenPos(), nodeReader->getProbability(), - nodeReader->isTerminal() && !nodeReader->isDeleted(), + nodeReader->getChildrenPos(), nodeReader->getProbability(), isTerminal, nodeReader->hasChildren(), nodeReader->isBlacklisted() || nodeReader->isNotAWord(), nodeReader->getCodePointCount(), readingHelper.getMergedNodeCodePoints()); readingHelper.readNextSiblingNode(); -- cgit v1.2.3-83-g751a From 5b5ed3d6092ea539d8cfebd786c63ec0c784040b Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Mon, 21 Oct 2013 14:40:32 +0900 Subject: Fix a bug where autocaps would jam auto-commit Bug: 11311002 Change-Id: I62955e364c9ffc75322cf05fa3ad7985f1d09259 --- java/src/com/android/inputmethod/latin/Suggest.java | 2 +- .../src/com/android/inputmethod/latin/SuggestedWordsTests.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 72b9c417c..0a4c7a55d 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -479,7 +479,7 @@ public final class Suggest { } return new SuggestedWordInfo(sb.toString(), wordInfo.mScore, wordInfo.mKind, wordInfo.mSourceDict, wordInfo.mIndexOfTouchPointOfSecondWord, - SuggestedWordInfo.NOT_A_CONFIDENCE /* autoCommitFirstWordConfidence */); + wordInfo.mAutoCommitFirstWordConfidence); } public void close() { diff --git a/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java b/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java index a594baf0b..375352067 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java +++ b/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java @@ -25,6 +25,7 @@ import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.ArrayList; import java.util.Locale; +import java.util.Random; @SmallTest public class SuggestedWordsTests extends AndroidTestCase { @@ -72,15 +73,20 @@ public class SuggestedWordsTests extends AndroidTestCase { return new SuggestedWordInfo(s, 100, SuggestedWordInfo.KIND_TYPED, null /* sourceDict */, SuggestedWordInfo.NOT_AN_INDEX /* indexOfTouchPointOfSecondWord */, - SuggestedWordInfo.NOT_A_CONFIDENCE /* autoCommitFirstWordConfidence */); + new Random().nextInt(1000000) /* autoCommitFirstWordConfidence */); } // Helper for testGetTransformedWordInfo private SuggestedWordInfo transformWordInfo(final String info, final int trailingSingleQuotesCount) { - return Suggest.getTransformedSuggestedWordInfo(createWordInfo(info), + final SuggestedWordInfo suggestedWordInfo = createWordInfo(info); + final SuggestedWordInfo returnedWordInfo = + Suggest.getTransformedSuggestedWordInfo(suggestedWordInfo, Locale.ENGLISH, false /* isAllUpperCase */, false /* isFirstCharCapitalized */, trailingSingleQuotesCount); + assertEquals(suggestedWordInfo.mAutoCommitFirstWordConfidence, + returnedWordInfo.mAutoCommitFirstWordConfidence); + return returnedWordInfo; } public void testGetTransformedSuggestedWordInfo() { -- cgit v1.2.3-83-g751a From 8a1675379e03bd7830d35212fd987346927068a9 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 22 Oct 2013 19:22:57 +0900 Subject: Stopgap solution for a crash. This returns the wrong string, but since it's used for getting the previous word for bigrams, it only results in slightly worse suggestions quality. Bug: 11273655 Change-Id: I6ce5de2f76effc453ca691a654ab6bf17445b9e7 --- java/src/com/android/inputmethod/latin/RichInputConnection.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java index e43cab5ca..c212f9c81 100644 --- a/java/src/com/android/inputmethod/latin/RichInputConnection.java +++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java @@ -294,7 +294,14 @@ public final class RichInputConnection { // the text field, then we can return the cached version right away. if (cachedLength >= n || cachedLength >= mExpectedCursorPosition) { final StringBuilder s = new StringBuilder(mCommittedTextBeforeComposingText); - s.append(mComposingText); + // We call #toString() here to create a temporary object. + // In some situations, this method is called on a worker thread, and it's possible + // the main thread touches the contents of mComposingText while this worker thread + // is suspended, because mComposingText is a StringBuilder. This may lead to crashes, + // so we call #toString() on it. That will result in the return value being strictly + // speaking wrong, but since this is used for basing bigram probability off, and + // it's only going to matter for one getSuggestions call, it's fine in the practice. + s.append(mComposingText.toString()); if (s.length() > n) { s.delete(0, s.length() - n); } -- cgit v1.2.3-83-g751a From d7d60881309a7083139a17bbc9dab9bc8f6790d5 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 11 Nov 2013 14:20:56 +0900 Subject: Revert back punctuations to the more keys keyboard of the period Cherry-pick I157164910f from Master. Bug: 11621857 Change-Id: I0fd0496e9091165280f34b4640ff0e524e3847b9 --- java/res/xml/key_nepali_traditional_period.xml | 3 ++- .../com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java | 6 +++--- tools/make-keyboard-text/res/values-ca/donottranslate-more-keys.xml | 2 +- tools/make-keyboard-text/res/values-iw/donottranslate-more-keys.xml | 1 + tools/make-keyboard-text/res/values/donottranslate-more-keys.xml | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) (limited to 'java/src') diff --git a/java/res/xml/key_nepali_traditional_period.xml b/java/res/xml/key_nepali_traditional_period.xml index 0f575c50b..1c389b009 100644 --- a/java/res/xml/key_nepali_traditional_period.xml +++ b/java/res/xml/key_nepali_traditional_period.xml @@ -39,10 +39,11 @@ set of Key definitions are needed based on the API version. --> + diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java index e769e3cdd..c2a01b5e8 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java @@ -278,7 +278,7 @@ public final class KeyboardTextsSet { /* 50 */ "\u00A2,\u00A3,\u20AC,\u00A5,\u20B1", /* 51 */ "$", /* 52 */ "$,\u00A2,\u20AC,\u00A3,\u00A5,\u20B1", - /* 53 */ "!fixedColumnOrder!4,#,!,\\,,?,-,:,',@", + /* 53 */ "!fixedColumnOrder!8,;,/,(,),#,!,\\,,?,&,\\%,+,\",-,:,',@", // U+2020: "†" DAGGER // U+2021: "‡" DOUBLE DAGGER // U+2605: "★" BLACK STAR @@ -785,7 +785,7 @@ public final class KeyboardTextsSet { null, null, null, null, null, null, null, null, /* ~52 */ // U+00B7: "·" MIDDLE DOT - /* 53 */ "!fixedColumnOrder!4,\u00B7,!,\\,,?,:,;,@", + /* 53 */ "!fixedColumnOrder!9,;,/,(,),#,\u00B7,!,\\,,?,&,\\%,+,\",-,:,',@", /* 54~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, @@ -1935,7 +1935,7 @@ public final class KeyboardTextsSet { // U+20AA: "₪" NEW SHEQEL SIGN /* 51 */ "\u20AA", /* 52 */ null, - /* 53 */ null, + /* 53 */ "!fixedColumnOrder!8,;,/,(|),)|(,#,!,\\,,?,&,\\%,+,\",-,:,',@", // U+2605: "★" BLACK STAR /* 54 */ "\u2605", /* 55 */ null, diff --git a/tools/make-keyboard-text/res/values-ca/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-ca/donottranslate-more-keys.xml index 4cf742441..66393732c 100644 --- a/tools/make-keyboard-text/res/values-ca/donottranslate-more-keys.xml +++ b/tools/make-keyboard-text/res/values-ca/donottranslate-more-keys.xml @@ -71,7 +71,7 @@ U+0142: "ł" LATIN SMALL LETTER L WITH STROKE --> l·l,ł - "!fixedColumnOrder!4,·,!,\\,,\?,:,;,\@" + "!fixedColumnOrder!9,;,/,(,),#,·,!,\\,,\?,&,\\%,+,\",-,:,',\@" \?,· ç diff --git a/tools/make-keyboard-text/res/values-iw/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-iw/donottranslate-more-keys.xml index a1633316f..994e35ae9 100644 --- a/tools/make-keyboard-text/res/values-iw/donottranslate-more-keys.xml +++ b/tools/make-keyboard-text/res/values-iw/donottranslate-more-keys.xml @@ -28,6 +28,7 @@ ±,﬩ + "!fixedColumnOrder!8,;,/,(|),)|(,#,!,\\,,\?,&,\\%,+,\",-,:,',\@" !fixedColumnOrder!3,<|>,{|},[|] diff --git a/tools/make-keyboard-text/res/values/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values/donottranslate-more-keys.xml index 64396b1dd..3c59b4bd1 100644 --- a/tools/make-keyboard-text/res/values/donottranslate-more-keys.xml +++ b/tools/make-keyboard-text/res/values/donottranslate-more-keys.xml @@ -77,7 +77,7 @@ ¢,£,€,¥,₱ $ $,¢,€,£,¥,₱ - "!fixedColumnOrder!4,#,!,\\,,\?,-,:,',\@" + "!fixedColumnOrder!8,;,/,(,),#,!,\\,,\?,&,\\%,+,\",-,:,',\@" -- cgit v1.2.3-83-g751a From e4022137ee2db3c07115775d472858ab1b05aa1c Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 8 Nov 2013 20:32:43 +0900 Subject: Remove an out-of-place check Bug: 11584525 Change-Id: I76cc3e4ee21d62fbd56042adcf085efd5cafb53f --- java/src/com/android/inputmethod/latin/LatinIME.java | 1 - 1 file changed, 1 deletion(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 2ddef3cbf..91faf4802 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1457,7 +1457,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private boolean maybeDoubleSpacePeriod() { final SettingsValues currentSettingsValues = mSettings.getCurrent(); - if (!currentSettingsValues.mCorrectionEnabled) return false; if (!currentSettingsValues.mUseDoubleSpacePeriod) return false; if (!mHandler.isAcceptingDoubleSpacePeriod()) return false; // We only do this when we see two spaces and an accepted code point before the cursor. -- cgit v1.2.3-83-g751a From 3a9b2430a56cb2d774070bd8ecd661d0dfb82484 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 13 Nov 2013 14:20:45 +0900 Subject: Fix many small nits. ...the interaction of which results in a very bad bug. Bug: 11648854 Change-Id: I774489e384388f187e72b9ac091ab387c5e1a79a --- java/src/com/android/inputmethod/latin/LatinIME.java | 11 +++++++++-- .../com/android/inputmethod/latin/RichInputConnection.java | 8 ++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 91faf4802..0f883245f 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -910,6 +910,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen false /* shouldFinishComposition */)) { // We try resetting the caches up to 5 times before giving up. mHandler.postResetCaches(isDifferentTextField, 5 /* remainingTries */); + // mLastSelection{Start,End} are reset later in this method, don't need to do it here canReachInputConnection = false; } else { if (isDifferentTextField) { @@ -989,10 +990,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (textLength > mLastSelectionStart || (textLength < Constants.EDITOR_CONTENTS_CACHE_SIZE && mLastSelectionStart < Constants.EDITOR_CONTENTS_CACHE_SIZE)) { + // It should not be possible to have only one of those variables be + // NOT_A_CURSOR_POSITION, so if they are equal, either the selection is zero-sized + // (simple cursor, no selection) or there is no cursor/we don't know its pos + final boolean wasEqual = mLastSelectionStart == mLastSelectionEnd; mLastSelectionStart = textLength; // We can't figure out the value of mLastSelectionEnd :( - // But at least if it's smaller than mLastSelectionStart something is wrong - if (mLastSelectionStart > mLastSelectionEnd) { + // But at least if it's smaller than mLastSelectionStart something is wrong, + // and if they used to be equal we also don't want to make it look like there is a + // selection. + if (wasEqual || mLastSelectionStart > mLastSelectionEnd) { mLastSelectionEnd = mLastSelectionStart; } } diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java index c212f9c81..673d1b4c2 100644 --- a/java/src/com/android/inputmethod/latin/RichInputConnection.java +++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java @@ -61,7 +61,7 @@ public final class RichInputConnection { * cursor may end up after all the keyboard-triggered updates have passed. We keep this to * compare it to the actual cursor position to guess whether the move was caused by a * keyboard command or not. - * It's not really the cursor position: the cursor may not be there yet, and it's also expected + * It's not really the cursor position: the cursor may not be there yet, and it's also expected * there be cases where it never actually comes to be there. */ private int mExpectedCursorPosition = INVALID_CURSOR_POSITION; // in chars, not code points @@ -292,7 +292,11 @@ public final class RichInputConnection { mCommittedTextBeforeComposingText.length() + mComposingText.length(); // If we have enough characters to satisfy the request, or if we have all characters in // the text field, then we can return the cached version right away. - if (cachedLength >= n || cachedLength >= mExpectedCursorPosition) { + // However, if we don't have an expected cursor position, then we should always + // go fetch the cache again (as it happens, INVALID_CURSOR_POSITION < 0, so we need to + // test for this explicitly) + if (INVALID_CURSOR_POSITION != mExpectedCursorPosition + && (cachedLength >= n || cachedLength >= mExpectedCursorPosition)) { final StringBuilder s = new StringBuilder(mCommittedTextBeforeComposingText); // We call #toString() here to create a temporary object. // In some situations, this method is called on a worker thread, and it's possible -- cgit v1.2.3-83-g751a From db4f3730047c8a3e25e031aacc07bb02bc47c5ae Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Thu, 21 Nov 2013 15:52:16 +0900 Subject: Fix: PtNode array size writirng when array size > 127. DO NOT MERGE. This is a manual cherrypick of Ib729ceedbc8ef837e50490439817b36039ae2b4e. Bug: 11772864 Change-Id: I5ecbe729dbdd24e194e48b4d68b17af8549c4726 --- .../com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java | 6 ++++-- java/src/com/android/inputmethod/latin/makedict/FormatSpec.java | 2 ++ .../src/com/android/inputmethod/latin/makedict/Ver3DictEncoder.java | 4 +++- .../src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java index 0f7d2f6c9..d5516ef46 100644 --- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java +++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtils.java @@ -460,8 +460,10 @@ public final class BinaryDictIOUtils { destination.write((byte)infos.length); break; case 2: - destination.write((byte)(infos.length >> 8)); - destination.write((byte)(infos.length & 0xFF)); + final int encodedPtNodeCount = + infos.length | FormatSpec.LARGE_PTNODE_ARRAY_SIZE_FIELD_SIZE_FLAG; + destination.write((byte)(encodedPtNodeCount >> 8)); + destination.write((byte)(encodedPtNodeCount & 0xFF)); break; default: throw new RuntimeException("Invalid node count size."); diff --git a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java index 6d5827023..b56234f6d 100644 --- a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java +++ b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java @@ -304,6 +304,8 @@ public final class FormatSpec { static final int INVALID_CHARACTER = -1; static final int MAX_PTNODES_FOR_ONE_BYTE_PTNODE_COUNT = 0x7F; // 127 + // Large PtNode array size field size is 2 bytes. + static final int LARGE_PTNODE_ARRAY_SIZE_FIELD_SIZE_FLAG = 0x8000; static final int MAX_PTNODES_IN_A_PT_NODE_ARRAY = 0x7FFF; // 32767 static final int MAX_BIGRAMS_IN_A_PTNODE = 10000; static final int MAX_SHORTCUT_LIST_SIZE_IN_A_PTNODE = 0xFFFF; diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver3DictEncoder.java b/java/src/com/android/inputmethod/latin/makedict/Ver3DictEncoder.java index d9e19899c..5da34534e 100644 --- a/java/src/com/android/inputmethod/latin/makedict/Ver3DictEncoder.java +++ b/java/src/com/android/inputmethod/latin/makedict/Ver3DictEncoder.java @@ -129,7 +129,9 @@ public class Ver3DictEncoder implements DictEncoder { if (countSize != 1 && countSize != 2) { throw new RuntimeException("Strange size from getGroupCountSize : " + countSize); } - mPosition = BinaryDictEncoderUtils.writeUIntToBuffer(mBuffer, mPosition, ptNodeCount, + final int encodedPtNodeCount = (countSize == 2) ? + (ptNodeCount | FormatSpec.LARGE_PTNODE_ARRAY_SIZE_FIELD_SIZE_FLAG) : ptNodeCount; + mPosition = BinaryDictEncoderUtils.writeUIntToBuffer(mBuffer, mPosition, encodedPtNodeCount, countSize); } diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java b/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java index 5d5ab0462..8d5b48a9b 100644 --- a/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java +++ b/java/src/com/android/inputmethod/latin/makedict/Ver4DictEncoder.java @@ -354,7 +354,9 @@ public class Ver4DictEncoder implements DictEncoder { if (countSize != 1 && countSize != 2) { throw new RuntimeException("Strange size from getPtNodeCountSize : " + countSize); } - mTriePos = BinaryDictEncoderUtils.writeUIntToBuffer(mTrieBuf, mTriePos, ptNodeCount, + final int encodedPtNodeCount = (countSize == 2) ? + (ptNodeCount | FormatSpec.LARGE_PTNODE_ARRAY_SIZE_FIELD_SIZE_FLAG) : ptNodeCount; + mTriePos = BinaryDictEncoderUtils.writeUIntToBuffer(mTrieBuf, mTriePos, encodedPtNodeCount, countSize); } -- cgit v1.2.3-83-g751a From 87cd39124a6e47f69e18f2495b0818fbe09a33b3 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Thu, 21 Nov 2013 17:13:02 +0900 Subject: handleBackspace should always send KEYCODE_DEL for InputType.TYPE_NULL This is a fix only for the Bayo branch because this part in master has been changed. The corresponding fix in master is I295eeb5f9f0f1f07e919bf54122d003be150a174 bug: 11797053 Change-Id: I779be039ebf992de5d246c7a9d9509623fc3c120 --- .../com/android/inputmethod/latin/LatinIME.java | 49 +++++++++------------- 1 file changed, 20 insertions(+), 29 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 0f883245f..fc07ce730 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2163,26 +2163,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // later (typically, in a subsequent press on backspace). mLastSelectionEnd = mLastSelectionStart; mConnection.deleteSurroundingText(numCharsDeleted, 0); - if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { - ResearchLogger.latinIME_handleBackspace(numCharsDeleted, - false /* shouldUncommitLogUnit */); - } } else { // There is no selection, just delete one character. if (NOT_A_CURSOR_POSITION == mLastSelectionEnd) { // This should never happen. Log.e(TAG, "Backspace when we don't know the selection position"); } - final int codePointBeforeCursor = mConnection.getCodePointBeforeCursor(); - if (codePointBeforeCursor == Constants.NOT_A_CODE) { - // Nothing to delete before the cursor. We have to revert the deletion states - // that were updated at the beginning of this method. - mDeleteCount--; - mExpectingUpdateSelection = false; - return; - } - final int lengthToDelete = - Character.isSupplementaryCodePoint(codePointBeforeCursor) ? 2 : 1; if (mAppWorkAroundsUtils.isBeforeJellyBean() || currentSettings.mInputAttributes.isTypeNull()) { // There are two possible reasons to send a key event: either the field has @@ -2193,23 +2179,28 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // applications are relying on this behavior so we continue to support it for // older apps, so we retain this behavior if the app has target SDK < JellyBean. sendDownUpKeyEvent(KeyEvent.KEYCODE_DEL); + if (mDeleteCount > DELETE_ACCELERATE_AT) { + sendDownUpKeyEvent(KeyEvent.KEYCODE_DEL); + } } else { + final int codePointBeforeCursor = mConnection.getCodePointBeforeCursor(); + if (codePointBeforeCursor == Constants.NOT_A_CODE) { + // Nothing to delete before the cursor. We have to revert the deletion + // states that were updated at the beginning of this method. + mDeleteCount--; + mExpectingUpdateSelection = false; + return; + } + final int lengthToDelete = + Character.isSupplementaryCodePoint(codePointBeforeCursor) ? 2 : 1; mConnection.deleteSurroundingText(lengthToDelete, 0); - } - if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { - ResearchLogger.latinIME_handleBackspace(lengthToDelete, - true /* shouldUncommitLogUnit */); - } - if (mDeleteCount > DELETE_ACCELERATE_AT) { - final int codePointBeforeCursorToDeleteAgain = - mConnection.getCodePointBeforeCursor(); - if (codePointBeforeCursorToDeleteAgain != Constants.NOT_A_CODE) { - final int lengthToDeleteAgain = Character.isSupplementaryCodePoint( - codePointBeforeCursorToDeleteAgain) ? 2 : 1; - mConnection.deleteSurroundingText(lengthToDeleteAgain, 0); - if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { - ResearchLogger.latinIME_handleBackspace(lengthToDeleteAgain, - true /* shouldUncommitLogUnit */); + if (mDeleteCount > DELETE_ACCELERATE_AT) { + final int codePointBeforeCursorToDeleteAgain = + mConnection.getCodePointBeforeCursor(); + if (codePointBeforeCursorToDeleteAgain != Constants.NOT_A_CODE) { + final int lengthToDeleteAgain = Character.isSupplementaryCodePoint( + codePointBeforeCursorToDeleteAgain) ? 2 : 1; + mConnection.deleteSurroundingText(lengthToDeleteAgain, 0); } } } -- cgit v1.2.3-83-g751a From d5e6044dedefb42d9c3e091cd8e2e9bb9579c356 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 11 Nov 2013 18:49:28 +0900 Subject: Rename KLP/JB/ICS common resource name suffixes to _holo Bug: 11622614 Change-Id: I53b5ff8b6627a38aef352855ad024213a450b40f --- java/res/color/emoji_tab_label_color_holo.xml | 33 ++++++++++++ java/res/color/emoji_tab_label_color_ics.xml | 33 ------------ java/res/color/key_text_color_holo.xml | 48 +++++++++++++++++ java/res/color/key_text_color_ics.xml | 48 ----------------- java/res/values-land/dimens.xml | 12 ++--- java/res/values-sw540dp-land/dimens.xml | 8 +-- java/res/values-sw540dp/dimens.xml | 12 ++--- .../values-sw540dp/touch-position-correction.xml | 2 +- java/res/values-sw768dp-land/dimens.xml | 10 ++-- java/res/values-sw768dp/dimens.xml | 12 ++--- java/res/values/colors.xml | 22 ++++---- java/res/values/dimens.xml | 12 ++--- java/res/values/keyboard-icons-holo.xml | 45 ++++++++++++++++ java/res/values/themes-common.xml | 2 +- java/res/values/themes-ics.xml | 63 +++++++--------------- java/res/values/touch-position-correction.xml | 2 +- .../inputmethod/keyboard/EmojiLayoutParams.java | 8 +-- 17 files changed, 197 insertions(+), 175 deletions(-) create mode 100644 java/res/color/emoji_tab_label_color_holo.xml delete mode 100644 java/res/color/emoji_tab_label_color_ics.xml create mode 100644 java/res/color/key_text_color_holo.xml delete mode 100644 java/res/color/key_text_color_ics.xml create mode 100644 java/res/values/keyboard-icons-holo.xml (limited to 'java/src') diff --git a/java/res/color/emoji_tab_label_color_holo.xml b/java/res/color/emoji_tab_label_color_holo.xml new file mode 100644 index 000000000..373e9314b --- /dev/null +++ b/java/res/color/emoji_tab_label_color_holo.xml @@ -0,0 +1,33 @@ + + + + + + + + + diff --git a/java/res/color/emoji_tab_label_color_ics.xml b/java/res/color/emoji_tab_label_color_ics.xml deleted file mode 100644 index 36e1d3020..000000000 --- a/java/res/color/emoji_tab_label_color_ics.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - diff --git a/java/res/color/key_text_color_holo.xml b/java/res/color/key_text_color_holo.xml new file mode 100644 index 000000000..d034a945f --- /dev/null +++ b/java/res/color/key_text_color_holo.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/res/color/key_text_color_ics.xml b/java/res/color/key_text_color_ics.xml deleted file mode 100644 index c6f111ad2..000000000 --- a/java/res/color/key_text_color_ics.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/res/values-land/dimens.xml b/java/res/values-land/dimens.xml index b874d4881..c97e68f11 100644 --- a/java/res/values-land/dimens.xml +++ b/java/res/values-land/dimens.xml @@ -31,10 +31,10 @@ 5.941%p 0.997%p - 2.727%p - 0.0%p - 5.368%p - 1.020%p + 2.727%p + 0.0%p + 5.368%p + 1.020%p 8dp @@ -54,9 +54,9 @@ 78% 48% - 1.6dp + 1.6dp - -22.4dp + -22.4dp 36dp 36dp diff --git a/java/res/values-sw540dp-land/dimens.xml b/java/res/values-sw540dp-land/dimens.xml index d79e8ca35..002493798 100644 --- a/java/res/values-sw540dp-land/dimens.xml +++ b/java/res/values-sw540dp-land/dimens.xml @@ -29,10 +29,10 @@ 5.200%p 1.447%p - 2.727%p - 0.0%p - 4.5%p - 0.9%p + 2.727%p + 0.0%p + 4.5%p + 0.9%p 81.9dp diff --git a/java/res/values-sw540dp/dimens.xml b/java/res/values-sw540dp/dimens.xml index b2f4ae043..801b7acb5 100644 --- a/java/res/values-sw540dp/dimens.xml +++ b/java/res/values-sw540dp/dimens.xml @@ -32,10 +32,10 @@ 4.625%p 2.113%p - 2.335%p - 4.0%p - 4.5%p - 1.565%p + 2.335%p + 4.0%p + 4.5%p + 1.565%p 6dp @@ -66,9 +66,9 @@ 52% 27% - 8.0dp + 8.0dp - -31.5dp + -31.5dp 44dp 44dp diff --git a/java/res/values-sw540dp/touch-position-correction.xml b/java/res/values-sw540dp/touch-position-correction.xml index df07c1295..932b8fc72 100644 --- a/java/res/values-sw540dp/touch-position-correction.xml +++ b/java/res/values-sw540dp/touch-position-correction.xml @@ -48,7 +48,7 @@ - -31.5dp + -31.5dp 44dp 44dp diff --git a/java/res/values/colors.xml b/java/res/values/colors.xml index 94fadb964..60a8c2909 100644 --- a/java/res/values/colors.xml +++ b/java/res/values/colors.xml @@ -39,15 +39,15 @@ #D833B5E5 #B233B5E5 #9933B5E5 - @android:color/transparent - #66E0E4E5 - #80000000 - #A0FFFFFF - #66E0E4E5 - @android:color/white - #FFC0C0C0 - #80000000 - #C0000000 + @android:color/transparent + #66E0E4E5 + #80000000 + #A0FFFFFF + #66E0E4E5 + @android:color/white + #FFC0C0C0 + #80000000 + #C0000000 #FFF0F0F0 #D8F0F0F0 @@ -66,6 +66,6 @@ #00000000 #30FFFFFF - @android:color/white - @android:color/white + @android:color/white + @android:color/white diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml index 18cb262e2..4588b10eb 100644 --- a/java/res/values/dimens.xml +++ b/java/res/values/dimens.xml @@ -37,10 +37,10 @@ 6.495%p 1.971%p - 2.335%p - 4.669%p - 6.127%p - 1.739%p + 2.335%p + 4.669%p + 6.127%p + 1.739%p @@ -71,9 +71,9 @@ 64% 41% - 8.0dp + 8.0dp - -26.4dp + -26.4dp 40dp 12dp diff --git a/java/res/values/keyboard-icons-holo.xml b/java/res/values/keyboard-icons-holo.xml new file mode 100644 index 000000000..b49e1d10b --- /dev/null +++ b/java/res/values/keyboard-icons-holo.xml @@ -0,0 +1,45 @@ + + + + + + diff --git a/java/res/values/themes-common.xml b/java/res/values/themes-common.xml index 37607711d..787bd6e35 100644 --- a/java/res/values/themes-common.xml +++ b/java/res/values/themes-common.xml @@ -110,7 +110,7 @@ name="EmojiPalettesView" parent="KeyboardView" > - @color/emoji_tab_label_color_ics + @color/emoji_tab_label_color_holo - @@ -104,7 +81,7 @@ parent="KeyboardView.ICS" > @drawable/btn_keyboard_key_functional_ics - @color/emoji_tab_label_color_ics + @color/emoji_tab_label_color_holo - - - - - - - - - - - diff --git a/java/res/values/themes-klp.xml b/java/res/values/themes-klp.xml new file mode 100644 index 000000000..a3730019d --- /dev/null +++ b/java/res/values/themes-klp.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index b7521b998..ef1b9d53f 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -58,7 +58,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { } private static final KeyboardTheme[] KEYBOARD_THEMES = { - new KeyboardTheme(0, R.style.KeyboardTheme_ICS), + new KeyboardTheme(0, R.style.KeyboardTheme_KLP), new KeyboardTheme(1, R.style.KeyboardTheme_GB), }; -- cgit v1.2.3-83-g751a From 51352009b5ac418d20826e034e5989705131aeca Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 11 Nov 2013 19:28:40 +0900 Subject: Add JB/ICS resources from Azuki MR1 release Bug: 11622614 Change-Id: I126fc42dd31e912788db0446b67a9d4ea80f848e --- .../btn_keyboard_key_dark_active_ics.9.png | Bin 0 -> 462 bytes .../btn_keyboard_key_dark_normal_on_ics.9.png | Bin 0 -> 587 bytes .../btn_keyboard_key_dark_pressed_ics.9.png | Bin 0 -> 553 bytes .../btn_keyboard_key_dark_pressed_off_ics.9.png | Bin 0 -> 668 bytes .../btn_keyboard_key_dark_pressed_on_ics.9.png | Bin 0 -> 707 bytes .../btn_keyboard_key_light_pressed_ics.9.png | Bin 0 -> 547 bytes .../btn_keyboard_key_popup_selected_ics.9.png | Bin 0 -> 282 bytes .../keyboard_key_feedback_background_ics.9.png | Bin 0 -> 2080 bytes ...keyboard_key_feedback_left_background_ics.9.png | Bin 0 -> 1990 bytes ...ard_key_feedback_left_more_background_ics.9.png | Bin 0 -> 2152 bytes ...keyboard_key_feedback_more_background_ics.9.png | Bin 0 -> 2256 bytes ...eyboard_key_feedback_right_background_ics.9.png | Bin 0 -> 1993 bytes ...rd_key_feedback_right_more_background_ics.9.png | Bin 0 -> 2163 bytes .../keyboard_popup_panel_background_ics.9.png | Bin 0 -> 856 bytes .../btn_keyboard_key_dark_active_ics.9.png | Bin 0 -> 345 bytes .../btn_keyboard_key_dark_normal_on_ics.9.png | Bin 0 -> 411 bytes .../btn_keyboard_key_dark_pressed_ics.9.png | Bin 0 -> 394 bytes .../btn_keyboard_key_dark_pressed_off_ics.9.png | Bin 0 -> 505 bytes .../btn_keyboard_key_dark_pressed_on_ics.9.png | Bin 0 -> 489 bytes .../btn_keyboard_key_light_pressed_ics.9.png | Bin 0 -> 381 bytes .../btn_keyboard_key_popup_selected_ics.9.png | Bin 0 -> 236 bytes .../keyboard_key_feedback_background_ics.9.png | Bin 0 -> 1313 bytes ...keyboard_key_feedback_left_background_ics.9.png | Bin 0 -> 1297 bytes ...ard_key_feedback_left_more_background_ics.9.png | Bin 0 -> 1437 bytes ...keyboard_key_feedback_more_background_ics.9.png | Bin 0 -> 1457 bytes ...eyboard_key_feedback_right_background_ics.9.png | Bin 0 -> 1288 bytes ...rd_key_feedback_right_more_background_ics.9.png | Bin 0 -> 1423 bytes .../keyboard_popup_panel_background_ics.9.png | Bin 0 -> 571 bytes .../btn_keyboard_key_dark_active_ics.9.png | Bin 0 -> 601 bytes .../btn_keyboard_key_dark_normal_on_ics.9.png | Bin 0 -> 745 bytes .../btn_keyboard_key_dark_pressed_ics.9.png | Bin 0 -> 737 bytes .../btn_keyboard_key_dark_pressed_off_ics.9.png | Bin 0 -> 953 bytes .../btn_keyboard_key_dark_pressed_on_ics.9.png | Bin 0 -> 945 bytes .../btn_keyboard_key_light_pressed_ics.9.png | Bin 0 -> 668 bytes .../btn_keyboard_key_popup_selected_ics.9.png | Bin 0 -> 351 bytes .../keyboard_key_feedback_background_ics.9.png | Bin 0 -> 2916 bytes ...keyboard_key_feedback_left_background_ics.9.png | Bin 0 -> 2873 bytes ...ard_key_feedback_left_more_background_ics.9.png | Bin 0 -> 3176 bytes ...keyboard_key_feedback_more_background_ics.9.png | Bin 0 -> 3184 bytes ...eyboard_key_feedback_right_background_ics.9.png | Bin 0 -> 2818 bytes ...rd_key_feedback_right_more_background_ics.9.png | Bin 0 -> 3102 bytes .../keyboard_popup_panel_background_ics.9.png | Bin 0 -> 1178 bytes .../btn_keyboard_key_dark_active_ics.9.png | Bin 0 -> 1805 bytes .../btn_keyboard_key_dark_normal_on_ics.9.png | Bin 0 -> 2039 bytes .../btn_keyboard_key_dark_pressed_ics.9.png | Bin 0 -> 1863 bytes .../btn_keyboard_key_dark_pressed_off_ics.9.png | Bin 0 -> 2196 bytes .../btn_keyboard_key_dark_pressed_on_ics.9.png | Bin 0 -> 2210 bytes .../btn_keyboard_key_light_pressed_ics.9.png | Bin 0 -> 1840 bytes .../btn_keyboard_key_popup_selected_ics.9.png | Bin 0 -> 1293 bytes .../keyboard_key_feedback_background_ics.9.png | Bin 0 -> 5212 bytes ...keyboard_key_feedback_left_background_ics.9.png | Bin 0 -> 4941 bytes ...ard_key_feedback_left_more_background_ics.9.png | Bin 0 -> 5188 bytes ...keyboard_key_feedback_more_background_ics.9.png | Bin 0 -> 5373 bytes ...eyboard_key_feedback_right_background_ics.9.png | Bin 0 -> 4964 bytes ...rd_key_feedback_right_more_background_ics.9.png | Bin 0 -> 5118 bytes .../keyboard_popup_panel_background_ics.9.png | Bin 0 -> 2712 bytes .../drawable/btn_keyboard_key_functional_ics.xml | 22 ++++ java/res/drawable/btn_keyboard_key_ics.xml | 48 ++++++++ java/res/drawable/btn_keyboard_key_popup_ics.xml | 21 ++++ java/res/drawable/btn_suggestion_ics.xml | 27 +++++ java/res/drawable/keyboard_key_feedback_ics.xml | 36 ++++++ java/res/layout/key_preview_ics.xml | 27 +++++ java/res/values/config.xml | 2 +- java/res/values/donottranslate.xml | 3 + java/res/values/themes-ics.xml | 124 +++++++++++++++++++++ java/res/xml/prefs_for_debug.xml | 1 + .../inputmethod/keyboard/KeyboardSwitcher.java | 10 +- 67 files changed, 317 insertions(+), 4 deletions(-) create mode 100644 java/res/drawable-hdpi/btn_keyboard_key_dark_active_ics.9.png create mode 100644 java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on_ics.9.png create mode 100644 java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_ics.9.png create mode 100644 java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off_ics.9.png create mode 100644 java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on_ics.9.png create mode 100644 java/res/drawable-hdpi/btn_keyboard_key_light_pressed_ics.9.png create mode 100644 java/res/drawable-hdpi/btn_keyboard_key_popup_selected_ics.9.png create mode 100644 java/res/drawable-hdpi/keyboard_key_feedback_background_ics.9.png create mode 100644 java/res/drawable-hdpi/keyboard_key_feedback_left_background_ics.9.png create mode 100644 java/res/drawable-hdpi/keyboard_key_feedback_left_more_background_ics.9.png create mode 100644 java/res/drawable-hdpi/keyboard_key_feedback_more_background_ics.9.png create mode 100644 java/res/drawable-hdpi/keyboard_key_feedback_right_background_ics.9.png create mode 100644 java/res/drawable-hdpi/keyboard_key_feedback_right_more_background_ics.9.png create mode 100644 java/res/drawable-hdpi/keyboard_popup_panel_background_ics.9.png create mode 100644 java/res/drawable-mdpi/btn_keyboard_key_dark_active_ics.9.png create mode 100644 java/res/drawable-mdpi/btn_keyboard_key_dark_normal_on_ics.9.png create mode 100644 java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_ics.9.png create mode 100644 java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_off_ics.9.png create mode 100644 java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_on_ics.9.png create mode 100644 java/res/drawable-mdpi/btn_keyboard_key_light_pressed_ics.9.png create mode 100644 java/res/drawable-mdpi/btn_keyboard_key_popup_selected_ics.9.png create mode 100644 java/res/drawable-mdpi/keyboard_key_feedback_background_ics.9.png create mode 100644 java/res/drawable-mdpi/keyboard_key_feedback_left_background_ics.9.png create mode 100644 java/res/drawable-mdpi/keyboard_key_feedback_left_more_background_ics.9.png create mode 100644 java/res/drawable-mdpi/keyboard_key_feedback_more_background_ics.9.png create mode 100644 java/res/drawable-mdpi/keyboard_key_feedback_right_background_ics.9.png create mode 100644 java/res/drawable-mdpi/keyboard_key_feedback_right_more_background_ics.9.png create mode 100644 java/res/drawable-mdpi/keyboard_popup_panel_background_ics.9.png create mode 100644 java/res/drawable-xhdpi/btn_keyboard_key_dark_active_ics.9.png create mode 100644 java/res/drawable-xhdpi/btn_keyboard_key_dark_normal_on_ics.9.png create mode 100644 java/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_ics.9.png create mode 100644 java/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_off_ics.9.png create mode 100644 java/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_on_ics.9.png create mode 100644 java/res/drawable-xhdpi/btn_keyboard_key_light_pressed_ics.9.png create mode 100644 java/res/drawable-xhdpi/btn_keyboard_key_popup_selected_ics.9.png create mode 100644 java/res/drawable-xhdpi/keyboard_key_feedback_background_ics.9.png create mode 100644 java/res/drawable-xhdpi/keyboard_key_feedback_left_background_ics.9.png create mode 100644 java/res/drawable-xhdpi/keyboard_key_feedback_left_more_background_ics.9.png create mode 100644 java/res/drawable-xhdpi/keyboard_key_feedback_more_background_ics.9.png create mode 100644 java/res/drawable-xhdpi/keyboard_key_feedback_right_background_ics.9.png create mode 100644 java/res/drawable-xhdpi/keyboard_key_feedback_right_more_background_ics.9.png create mode 100644 java/res/drawable-xhdpi/keyboard_popup_panel_background_ics.9.png create mode 100644 java/res/drawable-xxhdpi/btn_keyboard_key_dark_active_ics.9.png create mode 100644 java/res/drawable-xxhdpi/btn_keyboard_key_dark_normal_on_ics.9.png create mode 100644 java/res/drawable-xxhdpi/btn_keyboard_key_dark_pressed_ics.9.png create mode 100644 java/res/drawable-xxhdpi/btn_keyboard_key_dark_pressed_off_ics.9.png create mode 100644 java/res/drawable-xxhdpi/btn_keyboard_key_dark_pressed_on_ics.9.png create mode 100644 java/res/drawable-xxhdpi/btn_keyboard_key_light_pressed_ics.9.png create mode 100644 java/res/drawable-xxhdpi/btn_keyboard_key_popup_selected_ics.9.png create mode 100644 java/res/drawable-xxhdpi/keyboard_key_feedback_background_ics.9.png create mode 100644 java/res/drawable-xxhdpi/keyboard_key_feedback_left_background_ics.9.png create mode 100644 java/res/drawable-xxhdpi/keyboard_key_feedback_left_more_background_ics.9.png create mode 100644 java/res/drawable-xxhdpi/keyboard_key_feedback_more_background_ics.9.png create mode 100644 java/res/drawable-xxhdpi/keyboard_key_feedback_right_background_ics.9.png create mode 100644 java/res/drawable-xxhdpi/keyboard_key_feedback_right_more_background_ics.9.png create mode 100644 java/res/drawable-xxhdpi/keyboard_popup_panel_background_ics.9.png create mode 100644 java/res/drawable/btn_keyboard_key_functional_ics.xml create mode 100644 java/res/drawable/btn_keyboard_key_ics.xml create mode 100644 java/res/drawable/btn_keyboard_key_popup_ics.xml create mode 100644 java/res/drawable/btn_suggestion_ics.xml create mode 100644 java/res/drawable/keyboard_key_feedback_ics.xml create mode 100644 java/res/layout/key_preview_ics.xml create mode 100644 java/res/values/themes-ics.xml (limited to 'java/src') diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_active_ics.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_active_ics.9.png new file mode 100644 index 000000000..9aa8db60e Binary files /dev/null and b/java/res/drawable-hdpi/btn_keyboard_key_dark_active_ics.9.png differ diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on_ics.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on_ics.9.png new file mode 100644 index 000000000..9f4587b4a Binary files /dev/null and b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on_ics.9.png differ diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_ics.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_ics.9.png new file mode 100644 index 000000000..7ec33dd20 Binary files /dev/null and b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_ics.9.png differ diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off_ics.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off_ics.9.png new file mode 100644 index 000000000..655bc01b1 Binary files /dev/null and b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off_ics.9.png differ diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on_ics.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on_ics.9.png new file mode 100644 index 000000000..138e915d9 Binary files /dev/null and b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on_ics.9.png differ diff --git a/java/res/drawable-hdpi/btn_keyboard_key_light_pressed_ics.9.png b/java/res/drawable-hdpi/btn_keyboard_key_light_pressed_ics.9.png new file mode 100644 index 000000000..5612c51a1 Binary files /dev/null and b/java/res/drawable-hdpi/btn_keyboard_key_light_pressed_ics.9.png differ diff --git a/java/res/drawable-hdpi/btn_keyboard_key_popup_selected_ics.9.png b/java/res/drawable-hdpi/btn_keyboard_key_popup_selected_ics.9.png new file mode 100644 index 000000000..c2e8b3779 Binary files /dev/null and b/java/res/drawable-hdpi/btn_keyboard_key_popup_selected_ics.9.png differ diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_background_ics.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_background_ics.9.png new file mode 100644 index 000000000..28b406a5c Binary files /dev/null and b/java/res/drawable-hdpi/keyboard_key_feedback_background_ics.9.png differ diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_left_background_ics.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_left_background_ics.9.png new file mode 100644 index 000000000..e42cd88dc Binary files /dev/null and b/java/res/drawable-hdpi/keyboard_key_feedback_left_background_ics.9.png differ diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_left_more_background_ics.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_left_more_background_ics.9.png new file mode 100644 index 000000000..160344073 Binary files /dev/null and b/java/res/drawable-hdpi/keyboard_key_feedback_left_more_background_ics.9.png differ diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_more_background_ics.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_more_background_ics.9.png new file mode 100644 index 000000000..a40d4277c Binary files /dev/null and b/java/res/drawable-hdpi/keyboard_key_feedback_more_background_ics.9.png differ diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_right_background_ics.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_right_background_ics.9.png new file mode 100644 index 000000000..1f6807376 Binary files /dev/null and b/java/res/drawable-hdpi/keyboard_key_feedback_right_background_ics.9.png differ diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_right_more_background_ics.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_right_more_background_ics.9.png new file mode 100644 index 000000000..ec53593d9 Binary files /dev/null and b/java/res/drawable-hdpi/keyboard_key_feedback_right_more_background_ics.9.png differ diff --git a/java/res/drawable-hdpi/keyboard_popup_panel_background_ics.9.png b/java/res/drawable-hdpi/keyboard_popup_panel_background_ics.9.png new file mode 100644 index 000000000..53d7b6fb3 Binary files /dev/null and b/java/res/drawable-hdpi/keyboard_popup_panel_background_ics.9.png differ diff --git a/java/res/drawable-mdpi/btn_keyboard_key_dark_active_ics.9.png b/java/res/drawable-mdpi/btn_keyboard_key_dark_active_ics.9.png new file mode 100644 index 000000000..e810c7789 Binary files /dev/null and b/java/res/drawable-mdpi/btn_keyboard_key_dark_active_ics.9.png differ diff --git a/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_on_ics.9.png b/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_on_ics.9.png new file mode 100644 index 000000000..f3fc64114 Binary files /dev/null and b/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_on_ics.9.png differ diff --git a/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_ics.9.png b/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_ics.9.png new file mode 100644 index 000000000..8f340d355 Binary files /dev/null and b/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_ics.9.png differ diff --git a/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_off_ics.9.png b/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_off_ics.9.png new file mode 100644 index 000000000..53ea5f894 Binary files /dev/null and b/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_off_ics.9.png differ diff --git a/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_on_ics.9.png b/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_on_ics.9.png new file mode 100644 index 000000000..69c84e7ec Binary files /dev/null and b/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_on_ics.9.png differ diff --git a/java/res/drawable-mdpi/btn_keyboard_key_light_pressed_ics.9.png b/java/res/drawable-mdpi/btn_keyboard_key_light_pressed_ics.9.png new file mode 100644 index 000000000..c39dd4a94 Binary files /dev/null and b/java/res/drawable-mdpi/btn_keyboard_key_light_pressed_ics.9.png differ diff --git a/java/res/drawable-mdpi/btn_keyboard_key_popup_selected_ics.9.png b/java/res/drawable-mdpi/btn_keyboard_key_popup_selected_ics.9.png new file mode 100644 index 000000000..93a6e7921 Binary files /dev/null and b/java/res/drawable-mdpi/btn_keyboard_key_popup_selected_ics.9.png differ diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_background_ics.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_background_ics.9.png new file mode 100644 index 000000000..7a9f640d1 Binary files /dev/null and b/java/res/drawable-mdpi/keyboard_key_feedback_background_ics.9.png differ diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_left_background_ics.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_left_background_ics.9.png new file mode 100644 index 000000000..5b06f09bb Binary files /dev/null and b/java/res/drawable-mdpi/keyboard_key_feedback_left_background_ics.9.png differ diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_left_more_background_ics.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_left_more_background_ics.9.png new file mode 100644 index 000000000..fd992d6f4 Binary files /dev/null and b/java/res/drawable-mdpi/keyboard_key_feedback_left_more_background_ics.9.png differ diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_more_background_ics.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_more_background_ics.9.png new file mode 100644 index 000000000..128dcd6ad Binary files /dev/null and b/java/res/drawable-mdpi/keyboard_key_feedback_more_background_ics.9.png differ diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_right_background_ics.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_right_background_ics.9.png new file mode 100644 index 000000000..0b08d1747 Binary files /dev/null and b/java/res/drawable-mdpi/keyboard_key_feedback_right_background_ics.9.png differ diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_right_more_background_ics.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_right_more_background_ics.9.png new file mode 100644 index 000000000..cf0b33c1d Binary files /dev/null and b/java/res/drawable-mdpi/keyboard_key_feedback_right_more_background_ics.9.png differ diff --git a/java/res/drawable-mdpi/keyboard_popup_panel_background_ics.9.png b/java/res/drawable-mdpi/keyboard_popup_panel_background_ics.9.png new file mode 100644 index 000000000..61988a8e1 Binary files /dev/null and b/java/res/drawable-mdpi/keyboard_popup_panel_background_ics.9.png differ diff --git a/java/res/drawable-xhdpi/btn_keyboard_key_dark_active_ics.9.png b/java/res/drawable-xhdpi/btn_keyboard_key_dark_active_ics.9.png new file mode 100644 index 000000000..d990c0258 Binary files /dev/null and b/java/res/drawable-xhdpi/btn_keyboard_key_dark_active_ics.9.png differ diff --git a/java/res/drawable-xhdpi/btn_keyboard_key_dark_normal_on_ics.9.png b/java/res/drawable-xhdpi/btn_keyboard_key_dark_normal_on_ics.9.png new file mode 100644 index 000000000..ab8fb2e86 Binary files /dev/null and b/java/res/drawable-xhdpi/btn_keyboard_key_dark_normal_on_ics.9.png differ diff --git a/java/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_ics.9.png b/java/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_ics.9.png new file mode 100644 index 000000000..3871689ef Binary files /dev/null and b/java/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_ics.9.png differ diff --git a/java/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_off_ics.9.png b/java/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_off_ics.9.png new file mode 100644 index 000000000..912506368 Binary files /dev/null and b/java/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_off_ics.9.png differ diff --git a/java/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_on_ics.9.png b/java/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_on_ics.9.png new file mode 100644 index 000000000..35ce67fdc Binary files /dev/null and b/java/res/drawable-xhdpi/btn_keyboard_key_dark_pressed_on_ics.9.png differ diff --git a/java/res/drawable-xhdpi/btn_keyboard_key_light_pressed_ics.9.png b/java/res/drawable-xhdpi/btn_keyboard_key_light_pressed_ics.9.png new file mode 100644 index 000000000..c23a4b225 Binary files /dev/null and b/java/res/drawable-xhdpi/btn_keyboard_key_light_pressed_ics.9.png differ diff --git a/java/res/drawable-xhdpi/btn_keyboard_key_popup_selected_ics.9.png b/java/res/drawable-xhdpi/btn_keyboard_key_popup_selected_ics.9.png new file mode 100644 index 000000000..0c7bfdace Binary files /dev/null and b/java/res/drawable-xhdpi/btn_keyboard_key_popup_selected_ics.9.png differ diff --git a/java/res/drawable-xhdpi/keyboard_key_feedback_background_ics.9.png b/java/res/drawable-xhdpi/keyboard_key_feedback_background_ics.9.png new file mode 100644 index 000000000..d999127f2 Binary files /dev/null and b/java/res/drawable-xhdpi/keyboard_key_feedback_background_ics.9.png differ diff --git a/java/res/drawable-xhdpi/keyboard_key_feedback_left_background_ics.9.png b/java/res/drawable-xhdpi/keyboard_key_feedback_left_background_ics.9.png new file mode 100644 index 000000000..c4d694136 Binary files /dev/null and b/java/res/drawable-xhdpi/keyboard_key_feedback_left_background_ics.9.png differ diff --git a/java/res/drawable-xhdpi/keyboard_key_feedback_left_more_background_ics.9.png b/java/res/drawable-xhdpi/keyboard_key_feedback_left_more_background_ics.9.png new file mode 100644 index 000000000..5429c1785 Binary files /dev/null and b/java/res/drawable-xhdpi/keyboard_key_feedback_left_more_background_ics.9.png differ diff --git a/java/res/drawable-xhdpi/keyboard_key_feedback_more_background_ics.9.png b/java/res/drawable-xhdpi/keyboard_key_feedback_more_background_ics.9.png new file mode 100644 index 000000000..5135a0869 Binary files /dev/null and b/java/res/drawable-xhdpi/keyboard_key_feedback_more_background_ics.9.png differ diff --git a/java/res/drawable-xhdpi/keyboard_key_feedback_right_background_ics.9.png b/java/res/drawable-xhdpi/keyboard_key_feedback_right_background_ics.9.png new file mode 100644 index 000000000..19a77a29f Binary files /dev/null and b/java/res/drawable-xhdpi/keyboard_key_feedback_right_background_ics.9.png differ diff --git a/java/res/drawable-xhdpi/keyboard_key_feedback_right_more_background_ics.9.png b/java/res/drawable-xhdpi/keyboard_key_feedback_right_more_background_ics.9.png new file mode 100644 index 000000000..ae2ffff8e Binary files /dev/null and b/java/res/drawable-xhdpi/keyboard_key_feedback_right_more_background_ics.9.png differ diff --git a/java/res/drawable-xhdpi/keyboard_popup_panel_background_ics.9.png b/java/res/drawable-xhdpi/keyboard_popup_panel_background_ics.9.png new file mode 100644 index 000000000..1dee699f4 Binary files /dev/null and b/java/res/drawable-xhdpi/keyboard_popup_panel_background_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/btn_keyboard_key_dark_active_ics.9.png b/java/res/drawable-xxhdpi/btn_keyboard_key_dark_active_ics.9.png new file mode 100644 index 000000000..680421eaf Binary files /dev/null and b/java/res/drawable-xxhdpi/btn_keyboard_key_dark_active_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/btn_keyboard_key_dark_normal_on_ics.9.png b/java/res/drawable-xxhdpi/btn_keyboard_key_dark_normal_on_ics.9.png new file mode 100644 index 000000000..40f5011c0 Binary files /dev/null and b/java/res/drawable-xxhdpi/btn_keyboard_key_dark_normal_on_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/btn_keyboard_key_dark_pressed_ics.9.png b/java/res/drawable-xxhdpi/btn_keyboard_key_dark_pressed_ics.9.png new file mode 100644 index 000000000..6ff6319d3 Binary files /dev/null and b/java/res/drawable-xxhdpi/btn_keyboard_key_dark_pressed_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/btn_keyboard_key_dark_pressed_off_ics.9.png b/java/res/drawable-xxhdpi/btn_keyboard_key_dark_pressed_off_ics.9.png new file mode 100644 index 000000000..818ea70fd Binary files /dev/null and b/java/res/drawable-xxhdpi/btn_keyboard_key_dark_pressed_off_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/btn_keyboard_key_dark_pressed_on_ics.9.png b/java/res/drawable-xxhdpi/btn_keyboard_key_dark_pressed_on_ics.9.png new file mode 100644 index 000000000..a476d2a9e Binary files /dev/null and b/java/res/drawable-xxhdpi/btn_keyboard_key_dark_pressed_on_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/btn_keyboard_key_light_pressed_ics.9.png b/java/res/drawable-xxhdpi/btn_keyboard_key_light_pressed_ics.9.png new file mode 100644 index 000000000..3c17c5eec Binary files /dev/null and b/java/res/drawable-xxhdpi/btn_keyboard_key_light_pressed_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/btn_keyboard_key_popup_selected_ics.9.png b/java/res/drawable-xxhdpi/btn_keyboard_key_popup_selected_ics.9.png new file mode 100644 index 000000000..6d2af5942 Binary files /dev/null and b/java/res/drawable-xxhdpi/btn_keyboard_key_popup_selected_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/keyboard_key_feedback_background_ics.9.png b/java/res/drawable-xxhdpi/keyboard_key_feedback_background_ics.9.png new file mode 100644 index 000000000..bd1ef3cd9 Binary files /dev/null and b/java/res/drawable-xxhdpi/keyboard_key_feedback_background_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/keyboard_key_feedback_left_background_ics.9.png b/java/res/drawable-xxhdpi/keyboard_key_feedback_left_background_ics.9.png new file mode 100644 index 000000000..65af4b569 Binary files /dev/null and b/java/res/drawable-xxhdpi/keyboard_key_feedback_left_background_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/keyboard_key_feedback_left_more_background_ics.9.png b/java/res/drawable-xxhdpi/keyboard_key_feedback_left_more_background_ics.9.png new file mode 100644 index 000000000..ac6750dcb Binary files /dev/null and b/java/res/drawable-xxhdpi/keyboard_key_feedback_left_more_background_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/keyboard_key_feedback_more_background_ics.9.png b/java/res/drawable-xxhdpi/keyboard_key_feedback_more_background_ics.9.png new file mode 100644 index 000000000..cea7c05f6 Binary files /dev/null and b/java/res/drawable-xxhdpi/keyboard_key_feedback_more_background_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/keyboard_key_feedback_right_background_ics.9.png b/java/res/drawable-xxhdpi/keyboard_key_feedback_right_background_ics.9.png new file mode 100644 index 000000000..520fa7c6b Binary files /dev/null and b/java/res/drawable-xxhdpi/keyboard_key_feedback_right_background_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/keyboard_key_feedback_right_more_background_ics.9.png b/java/res/drawable-xxhdpi/keyboard_key_feedback_right_more_background_ics.9.png new file mode 100644 index 000000000..eee221758 Binary files /dev/null and b/java/res/drawable-xxhdpi/keyboard_key_feedback_right_more_background_ics.9.png differ diff --git a/java/res/drawable-xxhdpi/keyboard_popup_panel_background_ics.9.png b/java/res/drawable-xxhdpi/keyboard_popup_panel_background_ics.9.png new file mode 100644 index 000000000..721c24400 Binary files /dev/null and b/java/res/drawable-xxhdpi/keyboard_popup_panel_background_ics.9.png differ diff --git a/java/res/drawable/btn_keyboard_key_functional_ics.xml b/java/res/drawable/btn_keyboard_key_functional_ics.xml new file mode 100644 index 000000000..847ca72f4 --- /dev/null +++ b/java/res/drawable/btn_keyboard_key_functional_ics.xml @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/java/res/drawable/btn_keyboard_key_ics.xml b/java/res/drawable/btn_keyboard_key_ics.xml new file mode 100644 index 000000000..259bb9ba5 --- /dev/null +++ b/java/res/drawable/btn_keyboard_key_ics.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/res/drawable/btn_keyboard_key_popup_ics.xml b/java/res/drawable/btn_keyboard_key_popup_ics.xml new file mode 100644 index 000000000..31b613176 --- /dev/null +++ b/java/res/drawable/btn_keyboard_key_popup_ics.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/java/res/drawable/btn_suggestion_ics.xml b/java/res/drawable/btn_suggestion_ics.xml new file mode 100644 index 000000000..8f528ee4b --- /dev/null +++ b/java/res/drawable/btn_suggestion_ics.xml @@ -0,0 +1,27 @@ + + + + + + diff --git a/java/res/drawable/keyboard_key_feedback_ics.xml b/java/res/drawable/keyboard_key_feedback_ics.xml new file mode 100644 index 000000000..b52a61fbf --- /dev/null +++ b/java/res/drawable/keyboard_key_feedback_ics.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + diff --git a/java/res/layout/key_preview_ics.xml b/java/res/layout/key_preview_ics.xml new file mode 100644 index 000000000..33b6947ef --- /dev/null +++ b/java/res/layout/key_preview_ics.xml @@ -0,0 +1,27 @@ + + + + diff --git a/java/res/values/config.xml b/java/res/values/config.xml index 66b9b7082..8f6c12561 100644 --- a/java/res/values/config.xml +++ b/java/res/values/config.xml @@ -42,7 +42,7 @@ 16 1100 - 0 + 2 5 Gingerbread IceCreamSandwich + KeyLimePie @string/layout_ics @string/layout_gingerbread + @string/layout_klp 0 1 + 2 + + + + + + + + + + + + + + diff --git a/java/res/xml/prefs_for_debug.xml b/java/res/xml/prefs_for_debug.xml index 5d89b9cb2..8d9508e38 100644 --- a/java/res/xml/prefs_for_debug.xml +++ b/java/res/xml/prefs_for_debug.xml @@ -28,6 +28,7 @@ Date: Mon, 11 Nov 2013 20:39:03 +0900 Subject: Add keyboard color switch option Bug: 11622614 Change-Id: I25aa1ff7376fe72fd94ab2cb7190c61d7a98a1af --- java/res/values/config.xml | 2 +- java/res/values/donottranslate.xml | 12 ++++++++++++ java/res/xml/prefs.xml | 8 ++++++++ .../inputmethod/keyboard/KeyboardSwitcher.java | 20 +++++++++++++++++--- java/src/com/android/inputmethod/latin/LatinIME.java | 1 + .../inputmethod/latin/settings/DebugSettings.java | 4 +--- 6 files changed, 40 insertions(+), 7 deletions(-) (limited to 'java/src') diff --git a/java/res/values/config.xml b/java/res/values/config.xml index 8f6c12561..61779d4b5 100644 --- a/java/res/values/config.xml +++ b/java/res/values/config.xml @@ -41,7 +41,7 @@ 32 16 1100 - + 2 5 diff --git a/java/res/values/donottranslate.xml b/java/res/values/donottranslate.xml index ca9d7c388..af5ec061b 100644 --- a/java/res/values/donottranslate.xml +++ b/java/res/values/donottranslate.xml @@ -111,12 +111,24 @@ @string/layout_gingerbread @string/layout_klp + 0 1 2 + + + @string/keyboard_color_scheme_white + @string/keyboard_color_scheme_blue + + + + 2 + 0 + +