diff --git a/java/res/values/donottranslate-text-decorator.xml b/java/res/values/donottranslate-text-decorator.xml
new file mode 100644
index 000000000..9c39a4689
--- /dev/null
+++ b/java/res/values/donottranslate-text-decorator.xml
@@ -0,0 +1,127 @@
+
+
+
+
The effect of {@link #showCommitIndicator(SuggestedWordInfo)} and + * {@link #showAddToDictionaryIndicator(SuggestedWordInfo)} are exclusive to each other. Call + * {@link #reset()} to hide the indicator.
+ * + * @param wordInfo the suggested word which should be associated with the indicator. This object + * will be passed back in {@link Listener#onClickComposingTextToCommit(SuggestedWordInfo)} + */ + public void showCommitIndicator(final SuggestedWordInfo wordInfo) { + if (mMode == MODE_COMMIT && wordInfo != null && + TextUtils.equals(mWaitingWord.mWord, wordInfo.mWord)) { + // Skip layout for better performance. + return; + } + mWaitingWord = wordInfo; + mMode = MODE_COMMIT; + layoutLater(); + } + + /** + * Shows the "Add to dictionary" indicator and associates it with associating the given + * suggested word. + * + *The effect of {@link #showCommitIndicator(SuggestedWordInfo)} and + * {@link #showAddToDictionaryIndicator(SuggestedWordInfo)} are exclusive to each other. Call + * {@link #reset()} to hide the indicator.
+ * + * @param wordInfo the suggested word which should be associated with the indicator. This object + * will be passed back in + * {@link Listener#onClickComposingTextToAddToDictionary(SuggestedWordInfo)}. + */ + public void showAddToDictionaryIndicator(final SuggestedWordInfo wordInfo) { + if (mMode == MODE_ADD_TO_DICTIONARY && wordInfo != null && + TextUtils.equals(mWaitingWord.mWord, wordInfo.mWord)) { + // Skip layout for better performance. + return; + } + mWaitingWord = wordInfo; + mMode = MODE_ADD_TO_DICTIONARY; + layoutLater(); + return; + } + + /** + * Must be called when the input method is about changing to for from the full screen mode. + * @param fullScreenMode {@code true} if the input method is entering the full screen mode. + * {@code false} is the input method is finishing the full screen mode. + */ + public void notifyFullScreenMode(final boolean fullScreenMode) { + final boolean currentFullScreenMode = mIsFullScreenMode; + if (!currentFullScreenMode && fullScreenMode) { + // Currently full screen mode is not supported. + // TODO: Support full screen mode. + hideIndicator(); + } + mIsFullScreenMode = fullScreenMode; + } + + /** + * Resets previous requests and makes indicator invisible. + */ + public void reset() { + mWaitingWord = null; + mMode = MODE_NONE; + mLocalOrigin.set(0.0f, 0.0f); + mRelativeIndicatorBounds.set(0.0f, 0.0f, 0.0f, 0.0f); + mRelativeComposingTextBounds.set(0.0f, 0.0f, 0.0f, 0.0f); + cancelLayoutInternalExpectedly("Resetting internal state."); + } + + /** + * Must be called when the {@link InputMethodService#onUpdateCursorAnchorInfo()} is called. + * + *CAVEAT: Currently the input method author is responsible for ignoring + * {@link InputMethodService#onUpdateCursorAnchorInfo()} called in full screen mode.
+ * @param info the compatibility wrapper object for the received {@link CursorAnchorInfo}. + */ + public void onUpdateCursorAnchorInfo(final CursorAnchorInfoCompatWrapper info) { + if (mIsFullScreenMode) { + // TODO: Consider to call InputConnection#requestCursorAnchorInfo to disable the + // event callback to suppress unnecessary event callbacks. + return; + } + mCursorAnchorInfoWrapper = info; + // Do not use layoutLater() to minimize the latency. + layoutImmediately(); + } + + private void hideIndicator() { + mUiOperator.hideUi(); + } + + private void cancelLayoutInternalUnexpectedly(final String message) { + hideIndicator(); + Log.d(TAG, message); + } + + private void cancelLayoutInternalExpectedly(final String message) { + hideIndicator(); + if (DEBUG) { + Log.d(TAG, message); + } + } + + private void layoutLater() { + mLayoutInvalidator.invalidateLayout(); + } + + + private void layoutImmediately() { + // Clear pending layout requests. + mLayoutInvalidator.cancelInvalidateLayout(); + layoutMain(); + } + + private void layoutMain() { + if (mIsFullScreenMode) { + cancelLayoutInternalUnexpectedly("Full screen mode isn't yet supported."); + return; + } + + if (mMode != MODE_COMMIT && mMode != MODE_ADD_TO_DICTIONARY) { + if (mMode == MODE_NONE) { + cancelLayoutInternalExpectedly("Not ready for layouting."); + } else { + cancelLayoutInternalUnexpectedly("Unknown mMode=" + mMode); + } + return; + } + + final CursorAnchorInfoCompatWrapper info = mCursorAnchorInfoWrapper; + + if (info == null) { + cancelLayoutInternalExpectedly("CursorAnchorInfo isn't available."); + return; + } + + final Matrix matrix = info.getMatrix(); + if (matrix == null) { + cancelLayoutInternalUnexpectedly("Matrix is null"); + } + + final CharSequence composingText = info.getComposingText(); + if (mMode == MODE_COMMIT) { + if (composingText == null) { + cancelLayoutInternalExpectedly("composingText is null."); + return; + } + final int composingTextStart = info.getComposingTextStart(); + final int lastCharRectIndex = composingTextStart + composingText.length() - 1; + final RectF lastCharRect = info.getCharacterRect(lastCharRectIndex); + final int lastCharRectFlag = info.getCharacterRectFlags(lastCharRectIndex); + final int lastCharRectType = + lastCharRectFlag & CursorAnchorInfoCompatWrapper.CHARACTER_RECT_TYPE_MASK; + if (lastCharRect == null || matrix == null || lastCharRectType != + CursorAnchorInfoCompatWrapper.CHARACTER_RECT_TYPE_FULLY_VISIBLE) { + hideIndicator(); + return; + } + final RectF segmentStartCharRect = new RectF(lastCharRect); + for (int i = composingText.length() - 2; i >= 0; --i) { + final RectF charRect = info.getCharacterRect(composingTextStart + i); + if (charRect == null) { + break; + } + if (charRect.top != segmentStartCharRect.top) { + break; + } + if (charRect.bottom != segmentStartCharRect.bottom) { + break; + } + segmentStartCharRect.set(charRect); + } + + mLocalOrigin.set(lastCharRect.right, lastCharRect.top); + mRelativeIndicatorBounds.set(lastCharRect.right, lastCharRect.top, + lastCharRect.right + lastCharRect.height(), lastCharRect.bottom); + mRelativeIndicatorBounds.offset(-mLocalOrigin.x, -mLocalOrigin.y); + + mRelativeIndicatorBounds.set(lastCharRect.right, lastCharRect.top, + lastCharRect.right + lastCharRect.height(), lastCharRect.bottom); + mRelativeIndicatorBounds.offset(-mLocalOrigin.x, -mLocalOrigin.y); + + mRelativeComposingTextBounds.set(segmentStartCharRect.left, segmentStartCharRect.top, + segmentStartCharRect.right, segmentStartCharRect.bottom); + mRelativeComposingTextBounds.offset(-mLocalOrigin.x, -mLocalOrigin.y); + + if (mWaitingWord == null) { + cancelLayoutInternalExpectedly("mWaitingText is null."); + return; + } + if (TextUtils.isEmpty(mWaitingWord.mWord)) { + cancelLayoutInternalExpectedly("mWaitingText.mWord is empty."); + return; + } + if (!TextUtils.equals(composingText, mWaitingWord.mWord)) { + // This is indeed an expected situation because of the asynchronous nature of + // input method framework in Android. Note that composingText is notified from the + // application, while mWaitingWord.mWord is obtained directly from the InputLogic. + cancelLayoutInternalExpectedly( + "Composing text doesn't match the one we are waiting for."); + return; + } + } else { + if (!TextUtils.isEmpty(composingText)) { + // This is an unexpected case. + // TODO: Document this. + hideIndicator(); + return; + } + // In MODE_ADD_TO_DICTIONARY, we cannot retrieve the character position at all because + // of the lack of composing text. We will use the insertion marker position instead. + if (info.isInsertionMarkerClipped()) { + hideIndicator(); + return; + } + final float insertionMarkerHolizontal = info.getInsertionMarkerHorizontal(); + final float insertionMarkerTop = info.getInsertionMarkerTop(); + mLocalOrigin.set(insertionMarkerHolizontal, insertionMarkerTop); + } + + final RectF indicatorBounds = new RectF(mRelativeIndicatorBounds); + final RectF composingTextBounds = new RectF(mRelativeComposingTextBounds); + indicatorBounds.offset(mLocalOrigin.x, mLocalOrigin.y); + composingTextBounds.offset(mLocalOrigin.x, mLocalOrigin.y); + mUiOperator.layoutUi(mMode == MODE_COMMIT, matrix, indicatorBounds, composingTextBounds); + } + + private void onClickIndicator() { + if (mWaitingWord == null || TextUtils.isEmpty(mWaitingWord.mWord)) { + return; + } + switch (mMode) { + case MODE_COMMIT: + mListener.onClickComposingTextToCommit(mWaitingWord); + break; + case MODE_ADD_TO_DICTIONARY: + mListener.onClickComposingTextToAddToDictionary(mWaitingWord); + break; + } + } + + private final LayoutInvalidator mLayoutInvalidator = new LayoutInvalidator(this); + + /** + * Used for managing pending layout tasks for {@link TextDecorator#layoutLater()}. + */ + private static final class LayoutInvalidator { + private final HandlerImpl mHandler; + public LayoutInvalidator(final TextDecorator ownerInstance) { + mHandler = new HandlerImpl(ownerInstance); + } + + private static final int MSG_LAYOUT = 0; + + private static final class HandlerImpl + extends LeakGuardHandlerWrapperOnly one task can exist in the queue. When this method is called, any prior task that + * has not yet fired will be canceled.
+ * @param task the runnable object that will be fired when the delayed task is dispatched. + */ + public void postShowCommitIndicatorTask(final Runnable task) { + removeMessages(MSG_SHOW_COMMIT_INDICATOR); + sendMessageDelayed(obtainMessage(MSG_SHOW_COMMIT_INDICATOR, task), + mDelayInMillisecondsToShowCommitIndicator); + } + // Working variables for the following methods. private boolean mIsOrientationChanging; private boolean mPendingSuccessiveImsCallback; @@ -717,6 +743,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (hasSuggestionStripView()) { mSuggestionStripView.setListener(this, view); } + mInputLogic.setTextDecoratorUi(new TextDecoratorUi(this, view)); } @Override @@ -972,9 +999,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // @Override public void onUpdateCursorAnchorInfo(final CursorAnchorInfo info) { if (ProductionFlags.ENABLE_CURSOR_ANCHOR_INFO_CALLBACK) { - final CursorAnchorInfoCompatWrapper wrapper = - CursorAnchorInfoCompatWrapper.fromObject(info); - // TODO: Implement here + mInputLogic.onUpdateCursorAnchorInfo(CursorAnchorInfoCompatWrapper.fromObject(info)); } } @@ -1178,6 +1203,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // In fullscreen mode, no need to have extra space to show the key preview. // If not, we should have extra space above the keyboard to show the key preview. mKeyPreviewBackingView.setVisibility(isFullscreenMode() ? View.GONE : View.VISIBLE); + mInputLogic.onUpdateFullscreenMode(isFullscreenMode()); } private int getCurrentAutoCapsState() { @@ -1221,6 +1247,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen wordToEdit = word; } mDictionaryFacilitator.addWordToUserDictionary(this /* context */, wordToEdit); + mInputLogic.onAddWordToUserDictionary(); } // Callback for the {@link SuggestionStripView}, to call when the important notice strip is @@ -1409,7 +1436,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } private void setSuggestedWords(final SuggestedWords suggestedWords) { - mInputLogic.setSuggestedWords(suggestedWords); + final SettingsValues currentSettingsValues = mSettings.getCurrent(); + mInputLogic.setSuggestedWords(suggestedWords, currentSettingsValues, mHandler); // TODO: Modify this when we support suggestions with hard keyboard if (!hasSuggestionStripView()) { return; @@ -1418,7 +1446,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen return; } - final SettingsValues currentSettingsValues = mSettings.getCurrent(); final boolean shouldShowImportantNotice = ImportantNoticeUtils.shouldShowImportantNotice(this); final boolean shouldShowSuggestionCandidates = diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java index a6978809a..0f2ba53d5 100644 --- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java @@ -17,6 +17,7 @@ package com.android.inputmethod.latin.inputlogic; import android.graphics.Color; +import android.inputmethodservice.InputMethodService; import android.os.SystemClock; import android.text.SpannableString; import android.text.TextUtils; @@ -27,11 +28,14 @@ import android.view.KeyEvent; import android.view.inputmethod.CorrectionInfo; import android.view.inputmethod.EditorInfo; +import com.android.inputmethod.compat.CursorAnchorInfoCompatWrapper; import com.android.inputmethod.compat.SuggestionSpanUtils; import com.android.inputmethod.event.Event; import com.android.inputmethod.event.InputTransaction; import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.keyboard.ProximityInfo; +import com.android.inputmethod.keyboard.TextDecorator; +import com.android.inputmethod.keyboard.TextDecoratorUiOperator; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.Dictionary; import com.android.inputmethod.latin.DictionaryFacilitator; @@ -81,6 +85,18 @@ public final class InputLogic { public final Suggest mSuggest; private final DictionaryFacilitator mDictionaryFacilitator; + private final TextDecorator mTextDecorator = new TextDecorator(new TextDecorator.Listener() { + @Override + public void onClickComposingTextToCommit(SuggestedWordInfo wordInfo) { + mLatinIME.pickSuggestionManually(wordInfo); + } + @Override + public void onClickComposingTextToAddToDictionary(SuggestedWordInfo wordInfo) { + mLatinIME.addWordToUserDictionary(wordInfo.mWord); + mLatinIME.dismissAddToDictionaryHint(); + } + }); + public LastComposedWord mLastComposedWord = LastComposedWord.NOT_A_COMPOSED_WORD; // This has package visibility so it can be accessed from InputLogicHandler. /* package */ final WordComposer mWordComposer; @@ -303,8 +319,18 @@ public final class InputLogic { return inputTransaction; } - commitChosenWord(settingsValues, suggestion, - LastComposedWord.COMMIT_TYPE_MANUAL_PICK, LastComposedWord.NOT_A_SEPARATOR); + final boolean shouldShowAddToDictionaryHint = shouldShowAddToDictionaryHint(suggestionInfo); + final boolean shouldShowAddToDictionaryIndicator = + shouldShowAddToDictionaryHint && settingsValues.mShouldShowUiToAcceptTypedWord; + final int backgroundColor; + if (shouldShowAddToDictionaryIndicator) { + backgroundColor = settingsValues.mTextHighlightColorForAddToDictionaryIndicator; + } else { + backgroundColor = Color.TRANSPARENT; + } + commitChosenWordWithBackgroundColor(settingsValues, suggestion, + LastComposedWord.COMMIT_TYPE_MANUAL_PICK, LastComposedWord.NOT_A_SEPARATOR, + backgroundColor); mConnection.endBatchEdit(); // Don't allow cancellation of manual pick mLastComposedWord.deactivate(); @@ -312,13 +338,16 @@ public final class InputLogic { mSpaceState = SpaceState.PHANTOM; inputTransaction.requireShiftUpdate(InputTransaction.SHIFT_UPDATE_NOW); - if (shouldShowAddToDictionaryHint(suggestionInfo)) { + if (shouldShowAddToDictionaryHint) { mSuggestionStripViewAccessor.showAddToDictionaryHint(suggestion); } else { // If we're not showing the "Touch again to save", then update the suggestion strip. // That's going to be predictions (or punctuation suggestions), so INPUT_STYLE_NONE. handler.postUpdateSuggestionStrip(SuggestedWords.INPUT_STYLE_NONE); } + if (shouldShowAddToDictionaryIndicator) { + mTextDecorator.showAddToDictionaryIndicator(suggestionInfo); + } return inputTransaction; } @@ -386,6 +415,8 @@ public final class InputLogic { // The cursor has been moved : we now accept to perform recapitalization mRecapitalizeStatus.enable(); + // We moved the cursor and need to invalidate the indicator right now. + mTextDecorator.reset(); // We moved the cursor. If we are touching a word, we need to resume suggestion. mLatinIME.mHandler.postResumeSuggestions(false /* shouldIncludeResumedWordInSuggestions */, true /* shouldDelay */); @@ -561,7 +592,8 @@ public final class InputLogic { // TODO: on the long term, this method should become private, but it will be difficult. // Especially, how do we deal with InputMethodService.onDisplayCompletions? - public void setSuggestedWords(final SuggestedWords suggestedWords) { + public void setSuggestedWords(final SuggestedWords suggestedWords, + final SettingsValues settingsValues, final LatinIME.UIHandler handler) { if (SuggestedWords.EMPTY != suggestedWords) { final String autoCorrection; if (suggestedWords.mWillAutoCorrect) { @@ -575,6 +607,38 @@ public final class InputLogic { } mSuggestedWords = suggestedWords; final boolean newAutoCorrectionIndicator = suggestedWords.mWillAutoCorrect; + if (shouldShowCommitIndicator(suggestedWords, settingsValues)) { + // typedWordInfo is never null here. + final SuggestedWordInfo typedWordInfo = suggestedWords.getTypedWordInfoOrNull(); + handler.postShowCommitIndicatorTask(new Runnable() { + @Override + public void run() { + // TODO: This needs to be refactored to ensure that mWordComposer is accessed + // only from the UI thread. + if (!mWordComposer.isComposingWord()) { + mTextDecorator.reset(); + return; + } + final SuggestedWordInfo currentTypedWordInfo = + mSuggestedWords.getTypedWordInfoOrNull(); + if (currentTypedWordInfo == null) { + mTextDecorator.reset(); + return; + } + if (!currentTypedWordInfo.equals(typedWordInfo)) { + // Suggested word has been changed. This task is obsolete. + mTextDecorator.reset(); + return; + } + mTextDecorator.showCommitIndicator(typedWordInfo); + } + }); + } else { + // Note: It is OK to not cancel previous postShowCommitIndicatorTask() here. Having a + // cancellation mechanism could improve performance a bit though. + mTextDecorator.reset(); + } + // Put a blue underline to a word in TextView which will be auto-corrected. if (mIsAutoCorrectionIndicatorOn != newAutoCorrectionIndicator && mWordComposer.isComposingWord()) { @@ -756,6 +820,8 @@ public final class InputLogic { if (!mWordComposer.isComposingWord() && mSuggestionStripViewAccessor.isShowingAddToDictionaryHint()) { mSuggestionStripViewAccessor.dismissAddToDictionaryHint(); + mConnection.removeBackgroundColorFromHighlightedTextIfNecessary(); + mTextDecorator.reset(); } final int codePoint = event.mCodePoint; @@ -2108,4 +2174,74 @@ public final class InputLogic { settingsValues.mAutoCorrectionEnabledPerUserSettings, inputStyle, sequenceNumber, callback); } + + ////////////////////////////////////////////////////////////////////////////////////////////// + // Following methods are tentatively placed in this class for the integration with + // TextDecorator. + // TODO: Decouple things that are not related to the input logic. + ////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Sets the UI operator for {@link TextDecorator}. + * @param uiOperator the UI operator which should be associated with {@link TextDecorator}. + */ + public void setTextDecoratorUi(final TextDecoratorUiOperator uiOperator) { + mTextDecorator.setUiOperator(uiOperator); + } + + /** + * Must be called from {@link InputMethodService#onUpdateCursorAnchorInfo} is called. + * @param info The wrapper object with which we can access cursor/anchor info. + */ + public void onUpdateCursorAnchorInfo(final CursorAnchorInfoCompatWrapper info) { + mTextDecorator.onUpdateCursorAnchorInfo(info); + } + + /** + * Must be called when {@link InputMethodService#updateFullscreenMode} is called. + * @param isFullscreen {@code true} if the input method is in full-screen mode. + */ + public void onUpdateFullscreenMode(final boolean isFullscreen) { + mTextDecorator.notifyFullScreenMode(isFullscreen); + } + + /** + * Must be called from {@link LatinIME#addWordToUserDictionary(String)}. + */ + public void onAddWordToUserDictionary() { + mConnection.removeBackgroundColorFromHighlightedTextIfNecessary(); + mTextDecorator.reset(); + } + + /** + * Returns whether the commit indicator should be shown or not. + * @param suggestedWords the suggested word that is being displayed. + * @param settingsValues the current settings value. + * @return {@code true} if the commit indicator should be shown. + */ + private boolean shouldShowCommitIndicator(final SuggestedWords suggestedWords, + final SettingsValues settingsValues) { + if (!settingsValues.mShouldShowUiToAcceptTypedWord) { + return false; + } + final SuggestedWordInfo typedWordInfo = suggestedWords.getTypedWordInfoOrNull(); + if (typedWordInfo == null) { + return false; + } + if (suggestedWords.mInputStyle != SuggestedWords.INPUT_STYLE_TYPING){ + return false; + } + if (settingsValues.mShowCommitIndicatorOnlyForAutoCorrection + && !suggestedWords.mWillAutoCorrect) { + return false; + } + // TODO: Calling shouldShowAddToDictionaryHint(typedWordInfo) multiple times should be fine + // in terms of performance, but we can do better. One idea is to make SuggestedWords include + // a boolean that tells whether the word is a dictionary word or not. + if (settingsValues.mShowCommitIndicatorOnlyForOutOfVocabulary + && !shouldShowAddToDictionaryHint(typedWordInfo)) { + return false; + } + return true; + } } diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java index 1cd7b391a..dc2eda9bc 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java @@ -95,6 +95,12 @@ public final class SettingsValues { public final int[] mAdditionalFeaturesSettingValues = new int[AdditionalFeaturesSettingUtils.ADDITIONAL_FEATURES_SETTINGS_SIZE]; + // TextDecorator + public final int mTextHighlightColorForCommitIndicator; + public final int mTextHighlightColorForAddToDictionaryIndicator; + public final boolean mShowCommitIndicatorOnlyForAutoCorrection; + public final boolean mShowCommitIndicatorOnlyForOutOfVocabulary; + // Debug settings public final boolean mIsInternal; public final int mKeyPreviewShowUpDuration; @@ -163,6 +169,14 @@ public final class SettingsValues { mSuggestionsEnabledPerUserSettings = readSuggestionsEnabled(prefs); AdditionalFeaturesSettingUtils.readAdditionalFeaturesPreferencesIntoArray( prefs, mAdditionalFeaturesSettingValues); + mShowCommitIndicatorOnlyForAutoCorrection = res.getBoolean( + R.bool.text_decorator_only_for_auto_correction); + mShowCommitIndicatorOnlyForOutOfVocabulary = res.getBoolean( + R.bool.text_decorator_only_for_out_of_vocabulary); + mTextHighlightColorForCommitIndicator = res.getColor( + R.color.text_decorator_commit_indicator_text_highlight_color); + mTextHighlightColorForAddToDictionaryIndicator = res.getColor( + R.color.text_decorator_add_to_dictionary_indicator_text_highlight_color); mIsInternal = Settings.isInternal(prefs); mKeyPreviewShowUpDuration = Settings.readKeyPreviewAnimationDuration( prefs, DebugSettings.PREF_KEY_PREVIEW_SHOW_UP_DURATION, @@ -396,6 +410,14 @@ public final class SettingsValues { sb.append("" + (null == awu ? "null" : awu.toString())); sb.append("\n mAdditionalFeaturesSettingValues = "); sb.append("" + Arrays.toString(mAdditionalFeaturesSettingValues)); + sb.append("\n mShowCommitIndicatorOnlyForAutoCorrection = "); + sb.append("" + mShowCommitIndicatorOnlyForAutoCorrection); + sb.append("\n mShowCommitIndicatorOnlyForOutOfVocabulary = "); + sb.append("" + mShowCommitIndicatorOnlyForOutOfVocabulary); + sb.append("\n mTextHighlightColorForCommitIndicator = "); + sb.append("" + mTextHighlightColorForCommitIndicator); + sb.append("\n mTextHighlightColorForAddToDictionaryIndicator = "); + sb.append("" + mTextHighlightColorForAddToDictionaryIndicator); sb.append("\n mIsInternal = "); sb.append("" + mIsInternal); sb.append("\n mKeyPreviewShowUpDuration = ");