SettingsValues.java revision ac88f3d8459e17236654aa38debea749ecb631d1
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.inputmethod.latin.settings;
18
19import android.content.Context;
20import android.content.SharedPreferences;
21import android.content.pm.PackageInfo;
22import android.content.res.Configuration;
23import android.content.res.Resources;
24import android.util.Log;
25import android.view.inputmethod.EditorInfo;
26
27import com.android.inputmethod.compat.AppWorkaroundsUtils;
28import com.android.inputmethod.latin.InputAttributes;
29import com.android.inputmethod.latin.R;
30import com.android.inputmethod.latin.RichInputMethodManager;
31import com.android.inputmethod.latin.SubtypeSwitcher;
32import com.android.inputmethod.latin.utils.AsyncResultHolder;
33import com.android.inputmethod.latin.utils.ResourceUtils;
34import com.android.inputmethod.latin.utils.TargetPackageInfoGetterTask;
35
36import java.util.Arrays;
37import java.util.Locale;
38
39/**
40 * When you call the constructor of this class, you may want to change the current system locale by
41 * using {@link com.android.inputmethod.latin.utils.RunInLocale}.
42 */
43public final class SettingsValues {
44    private static final String TAG = SettingsValues.class.getSimpleName();
45    // "floatMaxValue" and "floatNegativeInfinity" are special marker strings for
46    // Float.NEGATIVE_INFINITE and Float.MAX_VALUE. Currently used for auto-correction settings.
47    private static final String FLOAT_MAX_VALUE_MARKER_STRING = "floatMaxValue";
48    private static final String FLOAT_NEGATIVE_INFINITY_MARKER_STRING = "floatNegativeInfinity";
49    private static final int TIMEOUT_TO_GET_TARGET_PACKAGE = 5; // seconds
50
51    // From resources:
52    public final SpacingAndPunctuations mSpacingAndPunctuations;
53    public final int mDelayInMillisecondsToUpdateOldSuggestions;
54    public final long mDoubleSpacePeriodTimeout;
55
56    // From preferences, in the same order as xml/prefs.xml:
57    public final boolean mAutoCap;
58    public final boolean mVibrateOn;
59    public final boolean mSoundOn;
60    public final boolean mKeyPreviewPopupOn;
61    public final boolean mShowsVoiceInputKey;
62    public final boolean mIncludesOtherImesInLanguageSwitchList;
63    public final boolean mShowsLanguageSwitchKey;
64    public final boolean mUseContactsDict;
65    public final boolean mUsePersonalizedDicts;
66    public final boolean mUseDoubleSpacePeriod;
67    public final boolean mBlockPotentiallyOffensive;
68    // Use bigrams to predict the next word when there is no input for it yet
69    public final boolean mBigramPredictionEnabled;
70    public final boolean mGestureInputEnabled;
71    public final boolean mGestureTrailEnabled;
72    public final boolean mGestureFloatingPreviewTextEnabled;
73    public final boolean mSlidingKeyInputPreviewEnabled;
74    public final boolean mPhraseGestureEnabled;
75    public final int mKeyLongpressTimeout;
76    public final Locale mLocale;
77    public final boolean mEnableMetricsLogging;
78    public final boolean mShouldShowUiToAcceptTypedWord;
79
80    // From the input box
81    public final InputAttributes mInputAttributes;
82
83    // Deduced settings
84    public final int mKeypressVibrationDuration;
85    public final float mKeypressSoundVolume;
86    public final int mKeyPreviewPopupDismissDelay;
87    private final boolean mAutoCorrectEnabled;
88    public final float mAutoCorrectionThreshold;
89    public final boolean mAutoCorrectionEnabledPerUserSettings;
90    private final boolean mSuggestionsEnabledPerUserSettings;
91    public final int mDisplayOrientation;
92    private final AsyncResultHolder<AppWorkaroundsUtils> mAppWorkarounds;
93
94    // Setting values for additional features
95    public final int[] mAdditionalFeaturesSettingValues =
96            new int[AdditionalFeaturesSettingUtils.ADDITIONAL_FEATURES_SETTINGS_SIZE];
97
98    // TextDecorator
99    public final int mTextHighlightColorForCommitIndicator;
100    public final int mTextHighlightColorForAddToDictionaryIndicator;
101    public final boolean mShowCommitIndicatorOnlyForAutoCorrection;
102    public final boolean mShowCommitIndicatorOnlyForOutOfVocabulary;
103
104    // Debug settings
105    public final boolean mIsInternal;
106    public final boolean mHasCustomKeyPreviewAnimationParams;
107    public final int mKeyPreviewShowUpDuration;
108    public final int mKeyPreviewDismissDuration;
109    public final float mKeyPreviewShowUpStartXScale;
110    public final float mKeyPreviewShowUpStartYScale;
111    public final float mKeyPreviewDismissEndXScale;
112    public final float mKeyPreviewDismissEndYScale;
113
114    public SettingsValues(final Context context, final SharedPreferences prefs, final Resources res,
115            final InputAttributes inputAttributes) {
116        mLocale = res.getConfiguration().locale;
117        // Get the resources
118        mDelayInMillisecondsToUpdateOldSuggestions =
119                res.getInteger(R.integer.config_delay_in_milliseconds_to_update_old_suggestions);
120        mSpacingAndPunctuations = new SpacingAndPunctuations(res);
121
122        // Store the input attributes
123        if (null == inputAttributes) {
124            mInputAttributes = new InputAttributes(
125                    null, false /* isFullscreenMode */, context.getPackageName());
126        } else {
127            mInputAttributes = inputAttributes;
128        }
129
130        // Get the settings preferences
131        mAutoCap = prefs.getBoolean(Settings.PREF_AUTO_CAP, true);
132        mVibrateOn = Settings.readVibrationEnabled(prefs, res);
133        mSoundOn = Settings.readKeypressSoundEnabled(prefs, res);
134        mKeyPreviewPopupOn = Settings.readKeyPreviewPopupEnabled(prefs, res);
135        mSlidingKeyInputPreviewEnabled = prefs.getBoolean(
136                DebugSettings.PREF_SLIDING_KEY_INPUT_PREVIEW, true);
137        mShowsVoiceInputKey = needsToShowVoiceInputKey(prefs, res)
138                && mInputAttributes.mShouldShowVoiceInputKey
139                && SubtypeSwitcher.getInstance().isShortcutImeEnabled();
140        final String autoCorrectionThresholdRawValue = prefs.getString(
141                Settings.PREF_AUTO_CORRECTION_THRESHOLD,
142                res.getString(R.string.auto_correction_threshold_mode_index_modest));
143        mIncludesOtherImesInLanguageSwitchList = Settings.ENABLE_SHOW_LANGUAGE_SWITCH_KEY_SETTINGS
144                ? prefs.getBoolean(Settings.PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST, false)
145                : true /* forcibly */;
146        mShowsLanguageSwitchKey = Settings.ENABLE_SHOW_LANGUAGE_SWITCH_KEY_SETTINGS
147                ? Settings.readShowsLanguageSwitchKey(prefs) : true /* forcibly */;
148        mUseContactsDict = prefs.getBoolean(Settings.PREF_KEY_USE_CONTACTS_DICT, true);
149        mUsePersonalizedDicts = prefs.getBoolean(Settings.PREF_KEY_USE_PERSONALIZED_DICTS, true);
150        mUseDoubleSpacePeriod = prefs.getBoolean(Settings.PREF_KEY_USE_DOUBLE_SPACE_PERIOD, true);
151        mBlockPotentiallyOffensive = Settings.readBlockPotentiallyOffensive(prefs, res);
152        mAutoCorrectEnabled = Settings.readAutoCorrectEnabled(autoCorrectionThresholdRawValue, res);
153        mBigramPredictionEnabled = readBigramPredictionEnabled(prefs, res);
154        mDoubleSpacePeriodTimeout = res.getInteger(R.integer.config_double_space_period_timeout);
155        mEnableMetricsLogging = prefs.getBoolean(Settings.PREF_ENABLE_METRICS_LOGGING, true);
156        mShouldShowUiToAcceptTypedWord = Settings.HAS_UI_TO_ACCEPT_TYPED_WORD
157                && prefs.getBoolean(DebugSettings.PREF_SHOW_UI_TO_ACCEPT_TYPED_WORD, true);
158        // Compute other readable settings
159        mKeyLongpressTimeout = Settings.readKeyLongpressTimeout(prefs, res);
160        mKeypressVibrationDuration = Settings.readKeypressVibrationDuration(prefs, res);
161        mKeypressSoundVolume = Settings.readKeypressSoundVolume(prefs, res);
162        mKeyPreviewPopupDismissDelay = Settings.readKeyPreviewPopupDismissDelay(prefs, res);
163        mAutoCorrectionThreshold = readAutoCorrectionThreshold(res,
164                autoCorrectionThresholdRawValue);
165        mGestureInputEnabled = Settings.readGestureInputEnabled(prefs, res);
166        mGestureTrailEnabled = prefs.getBoolean(Settings.PREF_GESTURE_PREVIEW_TRAIL, true);
167        mGestureFloatingPreviewTextEnabled = prefs.getBoolean(
168                Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true);
169        mPhraseGestureEnabled = Settings.readPhraseGestureEnabled(prefs, res);
170        mAutoCorrectionEnabledPerUserSettings = mAutoCorrectEnabled
171                && !mInputAttributes.mInputTypeNoAutoCorrect;
172        mSuggestionsEnabledPerUserSettings = readSuggestionsEnabled(prefs);
173        AdditionalFeaturesSettingUtils.readAdditionalFeaturesPreferencesIntoArray(
174                prefs, mAdditionalFeaturesSettingValues);
175        mShowCommitIndicatorOnlyForAutoCorrection = res.getBoolean(
176                R.bool.text_decorator_only_for_auto_correction);
177        mShowCommitIndicatorOnlyForOutOfVocabulary = res.getBoolean(
178                R.bool.text_decorator_only_for_out_of_vocabulary);
179        mTextHighlightColorForCommitIndicator = res.getColor(
180                R.color.text_decorator_commit_indicator_text_highlight_color);
181        mTextHighlightColorForAddToDictionaryIndicator = res.getColor(
182                R.color.text_decorator_add_to_dictionary_indicator_text_highlight_color);
183        mIsInternal = Settings.isInternal(prefs);
184        mHasCustomKeyPreviewAnimationParams = prefs.getBoolean(
185                DebugSettings.PREF_HAS_CUSTOM_KEY_PREVIEW_ANIMATION_PARAMS, false);
186        mKeyPreviewShowUpDuration = Settings.readKeyPreviewAnimationDuration(
187                prefs, DebugSettings.PREF_KEY_PREVIEW_SHOW_UP_DURATION,
188                res.getInteger(R.integer.config_key_preview_show_up_duration));
189        mKeyPreviewDismissDuration = Settings.readKeyPreviewAnimationDuration(
190                prefs, DebugSettings.PREF_KEY_PREVIEW_DISMISS_DURATION,
191                res.getInteger(R.integer.config_key_preview_dismiss_duration));
192        final float defaultKeyPreviewShowUpStartScale = ResourceUtils.getFloatFromFraction(
193                res, R.fraction.config_key_preview_show_up_start_scale);
194        final float defaultKeyPreviewDismissEndScale = ResourceUtils.getFloatFromFraction(
195                res, R.fraction.config_key_preview_dismiss_end_scale);
196        mKeyPreviewShowUpStartXScale = Settings.readKeyPreviewAnimationScale(
197                prefs, DebugSettings.PREF_KEY_PREVIEW_SHOW_UP_START_X_SCALE,
198                defaultKeyPreviewShowUpStartScale);
199        mKeyPreviewShowUpStartYScale = Settings.readKeyPreviewAnimationScale(
200                prefs, DebugSettings.PREF_KEY_PREVIEW_SHOW_UP_START_Y_SCALE,
201                defaultKeyPreviewShowUpStartScale);
202        mKeyPreviewDismissEndXScale = Settings.readKeyPreviewAnimationScale(
203                prefs, DebugSettings.PREF_KEY_PREVIEW_DISMISS_END_X_SCALE,
204                defaultKeyPreviewDismissEndScale);
205        mKeyPreviewDismissEndYScale = Settings.readKeyPreviewAnimationScale(
206                prefs, DebugSettings.PREF_KEY_PREVIEW_DISMISS_END_Y_SCALE,
207                defaultKeyPreviewDismissEndScale);
208        mDisplayOrientation = res.getConfiguration().orientation;
209        mAppWorkarounds = new AsyncResultHolder<>();
210        final PackageInfo packageInfo = TargetPackageInfoGetterTask.getCachedPackageInfo(
211                mInputAttributes.mTargetApplicationPackageName);
212        if (null != packageInfo) {
213            mAppWorkarounds.set(new AppWorkaroundsUtils(packageInfo));
214        } else {
215            new TargetPackageInfoGetterTask(context, mAppWorkarounds)
216                    .execute(mInputAttributes.mTargetApplicationPackageName);
217        }
218    }
219
220    public boolean isApplicationSpecifiedCompletionsOn() {
221        return mInputAttributes.mApplicationSpecifiedCompletionOn;
222    }
223
224    public boolean needsToLookupSuggestions() {
225        return mInputAttributes.mShouldShowSuggestions
226                && (mAutoCorrectionEnabledPerUserSettings || isSuggestionsEnabledPerUserSettings());
227    }
228
229    public boolean isSuggestionsEnabledPerUserSettings() {
230        return mSuggestionsEnabledPerUserSettings;
231    }
232
233    public boolean isWordSeparator(final int code) {
234        return mSpacingAndPunctuations.isWordSeparator(code);
235    }
236
237    public boolean isWordConnector(final int code) {
238        return mSpacingAndPunctuations.isWordConnector(code);
239    }
240
241    public boolean isWordCodePoint(final int code) {
242        return Character.isLetter(code) || isWordConnector(code)
243                || Character.COMBINING_SPACING_MARK == Character.getType(code);
244    }
245
246    public boolean isUsuallyPrecededBySpace(final int code) {
247        return mSpacingAndPunctuations.isUsuallyPrecededBySpace(code);
248    }
249
250    public boolean isUsuallyFollowedBySpace(final int code) {
251        return mSpacingAndPunctuations.isUsuallyFollowedBySpace(code);
252    }
253
254    public boolean shouldInsertSpacesAutomatically() {
255        return mInputAttributes.mShouldInsertSpacesAutomatically;
256    }
257
258    public boolean isLanguageSwitchKeyEnabled() {
259        if (!mShowsLanguageSwitchKey) {
260            return false;
261        }
262        final RichInputMethodManager imm = RichInputMethodManager.getInstance();
263        if (mIncludesOtherImesInLanguageSwitchList) {
264            return imm.hasMultipleEnabledIMEsOrSubtypes(false /* include aux subtypes */);
265        } else {
266            return imm.hasMultipleEnabledSubtypesInThisIme(false /* include aux subtypes */);
267        }
268    }
269
270    public boolean isSameInputType(final EditorInfo editorInfo) {
271        return mInputAttributes.isSameInputType(editorInfo);
272    }
273
274    public boolean hasSameOrientation(final Configuration configuration) {
275        return mDisplayOrientation == configuration.orientation;
276    }
277
278    public boolean isBeforeJellyBean() {
279        final AppWorkaroundsUtils appWorkaroundUtils
280                = mAppWorkarounds.get(null, TIMEOUT_TO_GET_TARGET_PACKAGE);
281        return null == appWorkaroundUtils ? false : appWorkaroundUtils.isBeforeJellyBean();
282    }
283
284    public boolean isBrokenByRecorrection() {
285        final AppWorkaroundsUtils appWorkaroundUtils
286                = mAppWorkarounds.get(null, TIMEOUT_TO_GET_TARGET_PACKAGE);
287        return null == appWorkaroundUtils ? false : appWorkaroundUtils.isBrokenByRecorrection();
288    }
289
290    private static final String SUGGESTIONS_VISIBILITY_HIDE_VALUE_OBSOLETE = "2";
291
292    private static boolean readSuggestionsEnabled(final SharedPreferences prefs) {
293        if (prefs.contains(Settings.PREF_SHOW_SUGGESTIONS_SETTING_OBSOLETE)) {
294            final boolean alwaysHide = SUGGESTIONS_VISIBILITY_HIDE_VALUE_OBSOLETE.equals(
295                    prefs.getString(Settings.PREF_SHOW_SUGGESTIONS_SETTING_OBSOLETE, null));
296            prefs.edit()
297                    .remove(Settings.PREF_SHOW_SUGGESTIONS_SETTING_OBSOLETE)
298                    .putBoolean(Settings.PREF_SHOW_SUGGESTIONS, !alwaysHide)
299                    .apply();
300        }
301        return prefs.getBoolean(Settings.PREF_SHOW_SUGGESTIONS, true);
302    }
303
304    private static boolean readBigramPredictionEnabled(final SharedPreferences prefs,
305            final Resources res) {
306        return prefs.getBoolean(Settings.PREF_BIGRAM_PREDICTIONS, res.getBoolean(
307                R.bool.config_default_next_word_prediction));
308    }
309
310    private static float readAutoCorrectionThreshold(final Resources res,
311            final String currentAutoCorrectionSetting) {
312        final String[] autoCorrectionThresholdValues = res.getStringArray(
313                R.array.auto_correction_threshold_values);
314        // When autoCorrectionThreshold is greater than 1.0, it's like auto correction is off.
315        final float autoCorrectionThreshold;
316        try {
317            final int arrayIndex = Integer.parseInt(currentAutoCorrectionSetting);
318            if (arrayIndex >= 0 && arrayIndex < autoCorrectionThresholdValues.length) {
319                final String val = autoCorrectionThresholdValues[arrayIndex];
320                if (FLOAT_MAX_VALUE_MARKER_STRING.equals(val)) {
321                    autoCorrectionThreshold = Float.MAX_VALUE;
322                } else if (FLOAT_NEGATIVE_INFINITY_MARKER_STRING.equals(val)) {
323                    autoCorrectionThreshold = Float.NEGATIVE_INFINITY;
324                } else {
325                    autoCorrectionThreshold = Float.parseFloat(val);
326                }
327            } else {
328                autoCorrectionThreshold = Float.MAX_VALUE;
329            }
330        } catch (final NumberFormatException e) {
331            // Whenever the threshold settings are correct, never come here.
332            Log.w(TAG, "Cannot load auto correction threshold setting."
333                    + " currentAutoCorrectionSetting: " + currentAutoCorrectionSetting
334                    + ", autoCorrectionThresholdValues: "
335                    + Arrays.toString(autoCorrectionThresholdValues), e);
336            return Float.MAX_VALUE;
337        }
338        return autoCorrectionThreshold;
339    }
340
341    private static boolean needsToShowVoiceInputKey(final SharedPreferences prefs,
342            final Resources res) {
343        // Migrate preference from {@link Settings#PREF_VOICE_MODE_OBSOLETE} to
344        // {@link Settings#PREF_VOICE_INPUT_KEY}.
345        if (prefs.contains(Settings.PREF_VOICE_MODE_OBSOLETE)) {
346            final String voiceModeMain = res.getString(R.string.voice_mode_main);
347            final String voiceMode = prefs.getString(
348                    Settings.PREF_VOICE_MODE_OBSOLETE, voiceModeMain);
349            final boolean shouldShowVoiceInputKey = voiceModeMain.equals(voiceMode);
350            prefs.edit()
351                    .putBoolean(Settings.PREF_VOICE_INPUT_KEY, shouldShowVoiceInputKey)
352                    // Remove the obsolete preference if exists.
353                    .remove(Settings.PREF_VOICE_MODE_OBSOLETE)
354                    .apply();
355        }
356        return prefs.getBoolean(Settings.PREF_VOICE_INPUT_KEY, true);
357    }
358
359    public String dump() {
360        final StringBuilder sb = new StringBuilder("Current settings :");
361        sb.append("\n   mSpacingAndPunctuations = ");
362        sb.append("" + mSpacingAndPunctuations.dump());
363        sb.append("\n   mDelayInMillisecondsToUpdateOldSuggestions = ");
364        sb.append("" + mDelayInMillisecondsToUpdateOldSuggestions);
365        sb.append("\n   mAutoCap = ");
366        sb.append("" + mAutoCap);
367        sb.append("\n   mVibrateOn = ");
368        sb.append("" + mVibrateOn);
369        sb.append("\n   mSoundOn = ");
370        sb.append("" + mSoundOn);
371        sb.append("\n   mKeyPreviewPopupOn = ");
372        sb.append("" + mKeyPreviewPopupOn);
373        sb.append("\n   mShowsVoiceInputKey = ");
374        sb.append("" + mShowsVoiceInputKey);
375        sb.append("\n   mIncludesOtherImesInLanguageSwitchList = ");
376        sb.append("" + mIncludesOtherImesInLanguageSwitchList);
377        sb.append("\n   mShowsLanguageSwitchKey = ");
378        sb.append("" + mShowsLanguageSwitchKey);
379        sb.append("\n   mUseContactsDict = ");
380        sb.append("" + mUseContactsDict);
381        sb.append("\n   mUsePersonalizedDicts = ");
382        sb.append("" + mUsePersonalizedDicts);
383        sb.append("\n   mUseDoubleSpacePeriod = ");
384        sb.append("" + mUseDoubleSpacePeriod);
385        sb.append("\n   mBlockPotentiallyOffensive = ");
386        sb.append("" + mBlockPotentiallyOffensive);
387        sb.append("\n   mBigramPredictionEnabled = ");
388        sb.append("" + mBigramPredictionEnabled);
389        sb.append("\n   mGestureInputEnabled = ");
390        sb.append("" + mGestureInputEnabled);
391        sb.append("\n   mGestureTrailEnabled = ");
392        sb.append("" + mGestureTrailEnabled);
393        sb.append("\n   mGestureFloatingPreviewTextEnabled = ");
394        sb.append("" + mGestureFloatingPreviewTextEnabled);
395        sb.append("\n   mSlidingKeyInputPreviewEnabled = ");
396        sb.append("" + mSlidingKeyInputPreviewEnabled);
397        sb.append("\n   mPhraseGestureEnabled = ");
398        sb.append("" + mPhraseGestureEnabled);
399        sb.append("\n   mKeyLongpressTimeout = ");
400        sb.append("" + mKeyLongpressTimeout);
401        sb.append("\n   mLocale = ");
402        sb.append("" + mLocale);
403        sb.append("\n   mInputAttributes = ");
404        sb.append("" + mInputAttributes);
405        sb.append("\n   mKeypressVibrationDuration = ");
406        sb.append("" + mKeypressVibrationDuration);
407        sb.append("\n   mKeypressSoundVolume = ");
408        sb.append("" + mKeypressSoundVolume);
409        sb.append("\n   mKeyPreviewPopupDismissDelay = ");
410        sb.append("" + mKeyPreviewPopupDismissDelay);
411        sb.append("\n   mAutoCorrectEnabled = ");
412        sb.append("" + mAutoCorrectEnabled);
413        sb.append("\n   mAutoCorrectionThreshold = ");
414        sb.append("" + mAutoCorrectionThreshold);
415        sb.append("\n   mAutoCorrectionEnabledPerUserSettings = ");
416        sb.append("" + mAutoCorrectionEnabledPerUserSettings);
417        sb.append("\n   mSuggestionsEnabledPerUserSettings = ");
418        sb.append("" + mSuggestionsEnabledPerUserSettings);
419        sb.append("\n   mDisplayOrientation = ");
420        sb.append("" + mDisplayOrientation);
421        sb.append("\n   mAppWorkarounds = ");
422        final AppWorkaroundsUtils awu = mAppWorkarounds.get(null, 0);
423        sb.append("" + (null == awu ? "null" : awu.toString()));
424        sb.append("\n   mAdditionalFeaturesSettingValues = ");
425        sb.append("" + Arrays.toString(mAdditionalFeaturesSettingValues));
426        sb.append("\n   mShowCommitIndicatorOnlyForAutoCorrection = ");
427        sb.append("" + mShowCommitIndicatorOnlyForAutoCorrection);
428        sb.append("\n   mShowCommitIndicatorOnlyForOutOfVocabulary = ");
429        sb.append("" + mShowCommitIndicatorOnlyForOutOfVocabulary);
430        sb.append("\n   mTextHighlightColorForCommitIndicator = ");
431        sb.append("" + mTextHighlightColorForCommitIndicator);
432        sb.append("\n   mTextHighlightColorForAddToDictionaryIndicator = ");
433        sb.append("" + mTextHighlightColorForAddToDictionaryIndicator);
434        sb.append("\n   mIsInternal = ");
435        sb.append("" + mIsInternal);
436        sb.append("\n   mKeyPreviewShowUpDuration = ");
437        sb.append("" + mKeyPreviewShowUpDuration);
438        sb.append("\n   mKeyPreviewDismissDuration = ");
439        sb.append("" + mKeyPreviewDismissDuration);
440        sb.append("\n   mKeyPreviewShowUpStartScaleX = ");
441        sb.append("" + mKeyPreviewShowUpStartXScale);
442        sb.append("\n   mKeyPreviewShowUpStartScaleY = ");
443        sb.append("" + mKeyPreviewShowUpStartYScale);
444        sb.append("\n   mKeyPreviewDismissEndScaleX = ");
445        sb.append("" + mKeyPreviewDismissEndXScale);
446        sb.append("\n   mKeyPreviewDismissEndScaleY = ");
447        sb.append("" + mKeyPreviewDismissEndYScale);
448        return sb.toString();
449    }
450}
451