diff options
Diffstat (limited to 'java')
74 files changed, 98 insertions, 128 deletions
diff --git a/java/res/drawable-hdpi/sym_keyboard_delete_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_delete_lxx_dark.png Binary files differnew file mode 100644 index 000000000..5f5eb3fe7 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_delete_lxx_dark.png diff --git a/java/res/drawable-hdpi/sym_keyboard_done_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_done_lxx_dark.png Binary files differnew file mode 100644 index 000000000..f81130d1a --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_done_lxx_dark.png diff --git a/java/res/drawable-hdpi/sym_keyboard_go_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_go_lxx_dark.png Binary files differnew file mode 100644 index 000000000..516a7f1c7 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_go_lxx_dark.png diff --git a/java/res/drawable-hdpi/sym_keyboard_language_switch_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_language_switch_lxx_dark.png Binary files differnew file mode 100644 index 000000000..edf9a20de --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_language_switch_lxx_dark.png diff --git a/java/res/drawable-hdpi/sym_keyboard_next_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_next_lxx_dark.png Binary files differnew file mode 100644 index 000000000..99ac30912 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_next_lxx_dark.png diff --git a/java/res/drawable-hdpi/sym_keyboard_previous_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_previous_lxx_dark.png Binary files differnew file mode 100644 index 000000000..9019ebdd6 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_previous_lxx_dark.png diff --git a/java/res/drawable-hdpi/sym_keyboard_search_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_search_lxx_dark.png Binary files differnew file mode 100644 index 000000000..de117d35b --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_search_lxx_dark.png diff --git a/java/res/drawable-hdpi/sym_keyboard_send_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_send_lxx_dark.png Binary files differnew file mode 100644 index 000000000..6db6d56df --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_send_lxx_dark.png diff --git a/java/res/drawable-hdpi/sym_keyboard_settings_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_settings_lxx_dark.png Binary files differnew file mode 100644 index 000000000..f2613023f --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_settings_lxx_dark.png diff --git a/java/res/drawable-hdpi/sym_keyboard_smiley_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_smiley_lxx_dark.png Binary files differnew file mode 100644 index 000000000..3999d1e2d --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_smiley_lxx_dark.png diff --git a/java/res/drawable-hdpi/sym_keyboard_space_led_holo.9.png b/java/res/drawable-hdpi/sym_keyboard_space_led_holo.9.png Binary files differdeleted file mode 100644 index 34a1ebde2..000000000 --- a/java/res/drawable-hdpi/sym_keyboard_space_led_holo.9.png +++ /dev/null diff --git a/java/res/drawable-hdpi/sym_keyboard_voice_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_voice_lxx_dark.png Binary files differnew file mode 100644 index 000000000..6b68c8af5 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_voice_lxx_dark.png diff --git a/java/res/drawable-hdpi/sym_keyboard_voice_off_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_voice_off_lxx_dark.png Binary files differnew file mode 100644 index 000000000..e67697b3f --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_voice_off_lxx_dark.png diff --git a/java/res/drawable-mdpi/sym_keyboard_delete_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_delete_lxx_dark.png Binary files differnew file mode 100644 index 000000000..2d3ac9749 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_delete_lxx_dark.png diff --git a/java/res/drawable-mdpi/sym_keyboard_done_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_done_lxx_dark.png Binary files differnew file mode 100644 index 000000000..8a63c116a --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_done_lxx_dark.png diff --git a/java/res/drawable-mdpi/sym_keyboard_go_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_go_lxx_dark.png Binary files differnew file mode 100644 index 000000000..89051722a --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_go_lxx_dark.png diff --git a/java/res/drawable-mdpi/sym_keyboard_language_switch_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_language_switch_lxx_dark.png Binary files differnew file mode 100644 index 000000000..a90bf757c --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_language_switch_lxx_dark.png diff --git a/java/res/drawable-mdpi/sym_keyboard_next_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_next_lxx_dark.png Binary files differnew file mode 100644 index 000000000..61c10145c --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_next_lxx_dark.png diff --git a/java/res/drawable-mdpi/sym_keyboard_previous_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_previous_lxx_dark.png Binary files differnew file mode 100644 index 000000000..f176956ca --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_previous_lxx_dark.png diff --git a/java/res/drawable-mdpi/sym_keyboard_search_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_search_lxx_dark.png Binary files differnew file mode 100644 index 000000000..722d40258 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_search_lxx_dark.png diff --git a/java/res/drawable-mdpi/sym_keyboard_send_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_send_lxx_dark.png Binary files differnew file mode 100644 index 000000000..a75a6083a --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_send_lxx_dark.png diff --git a/java/res/drawable-mdpi/sym_keyboard_settings_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_settings_lxx_dark.png Binary files differnew file mode 100644 index 000000000..dea7addfe --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_settings_lxx_dark.png diff --git a/java/res/drawable-mdpi/sym_keyboard_smiley_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_smiley_lxx_dark.png Binary files differnew file mode 100644 index 000000000..8276d992c --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_smiley_lxx_dark.png diff --git a/java/res/drawable-mdpi/sym_keyboard_space_led_holo.9.png b/java/res/drawable-mdpi/sym_keyboard_space_led_holo.9.png Binary files differdeleted file mode 100644 index abd8b742e..000000000 --- a/java/res/drawable-mdpi/sym_keyboard_space_led_holo.9.png +++ /dev/null diff --git a/java/res/drawable-mdpi/sym_keyboard_voice_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_voice_lxx_dark.png Binary files differnew file mode 100644 index 000000000..5661f6b33 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_voice_lxx_dark.png diff --git a/java/res/drawable-mdpi/sym_keyboard_voice_off_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_voice_off_lxx_dark.png Binary files differnew file mode 100644 index 000000000..5182f1e8f --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_voice_off_lxx_dark.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_delete_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_delete_lxx_dark.png Binary files differnew file mode 100644 index 000000000..7c9f34f12 --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_delete_lxx_dark.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_done_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_done_lxx_dark.png Binary files differnew file mode 100644 index 000000000..f25e3dfd9 --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_done_lxx_dark.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_go_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_go_lxx_dark.png Binary files differnew file mode 100644 index 000000000..6cd43cf8a --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_go_lxx_dark.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_language_switch_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_language_switch_lxx_dark.png Binary files differnew file mode 100644 index 000000000..f964346c1 --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_language_switch_lxx_dark.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_next_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_next_lxx_dark.png Binary files differnew file mode 100644 index 000000000..9e05e84b9 --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_next_lxx_dark.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_previous_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_previous_lxx_dark.png Binary files differnew file mode 100644 index 000000000..8995d8797 --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_previous_lxx_dark.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_search_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_search_lxx_dark.png Binary files differnew file mode 100644 index 000000000..28a4bd329 --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_search_lxx_dark.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_send_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_send_lxx_dark.png Binary files differnew file mode 100644 index 000000000..9927af4ff --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_send_lxx_dark.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_settings_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_settings_lxx_dark.png Binary files differnew file mode 100644 index 000000000..8c83d9fb6 --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_settings_lxx_dark.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_smiley_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_smiley_lxx_dark.png Binary files differnew file mode 100644 index 000000000..78923fadb --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_smiley_lxx_dark.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_space_led_holo.9.png b/java/res/drawable-xhdpi/sym_keyboard_space_led_holo.9.png Binary files differdeleted file mode 100644 index ba4e9ec49..000000000 --- a/java/res/drawable-xhdpi/sym_keyboard_space_led_holo.9.png +++ /dev/null diff --git a/java/res/drawable-xhdpi/sym_keyboard_voice_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_voice_lxx_dark.png Binary files differnew file mode 100644 index 000000000..4e9631e7b --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_voice_lxx_dark.png diff --git a/java/res/drawable-xhdpi/sym_keyboard_voice_off_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_voice_off_lxx_dark.png Binary files differnew file mode 100644 index 000000000..66c0e3c56 --- /dev/null +++ b/java/res/drawable-xhdpi/sym_keyboard_voice_off_lxx_dark.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_delete_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_delete_lxx_dark.png Binary files differnew file mode 100644 index 000000000..dd95be61e --- /dev/null +++ b/java/res/drawable-xxhdpi/sym_keyboard_delete_lxx_dark.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_done_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_done_lxx_dark.png Binary files differnew file mode 100644 index 000000000..ccd270e78 --- /dev/null +++ b/java/res/drawable-xxhdpi/sym_keyboard_done_lxx_dark.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_go_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_go_lxx_dark.png Binary files differnew file mode 100644 index 000000000..0617c15e3 --- /dev/null +++ b/java/res/drawable-xxhdpi/sym_keyboard_go_lxx_dark.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_language_switch_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_language_switch_lxx_dark.png Binary files differnew file mode 100644 index 000000000..fc85e512d --- /dev/null +++ b/java/res/drawable-xxhdpi/sym_keyboard_language_switch_lxx_dark.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_next_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_next_lxx_dark.png Binary files differnew file mode 100644 index 000000000..a04a41c39 --- /dev/null +++ b/java/res/drawable-xxhdpi/sym_keyboard_next_lxx_dark.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_previous_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_previous_lxx_dark.png Binary files differnew file mode 100644 index 000000000..c87d8f029 --- /dev/null +++ b/java/res/drawable-xxhdpi/sym_keyboard_previous_lxx_dark.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_search_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_search_lxx_dark.png Binary files differnew file mode 100644 index 000000000..a32b6c5d9 --- /dev/null +++ b/java/res/drawable-xxhdpi/sym_keyboard_search_lxx_dark.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_send_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_send_lxx_dark.png Binary files differnew file mode 100644 index 000000000..8073e2c9d --- /dev/null +++ b/java/res/drawable-xxhdpi/sym_keyboard_send_lxx_dark.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_settings_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_settings_lxx_dark.png Binary files differnew file mode 100644 index 000000000..d513ad9e6 --- /dev/null +++ b/java/res/drawable-xxhdpi/sym_keyboard_settings_lxx_dark.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_smiley_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_smiley_lxx_dark.png Binary files differnew file mode 100644 index 000000000..a4df3bb0e --- /dev/null +++ b/java/res/drawable-xxhdpi/sym_keyboard_smiley_lxx_dark.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_voice_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_voice_lxx_dark.png Binary files differnew file mode 100644 index 000000000..a36724cac --- /dev/null +++ b/java/res/drawable-xxhdpi/sym_keyboard_voice_lxx_dark.png diff --git a/java/res/drawable-xxhdpi/sym_keyboard_voice_off_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_voice_off_lxx_dark.png Binary files differnew file mode 100644 index 000000000..2706dca57 --- /dev/null +++ b/java/res/drawable-xxhdpi/sym_keyboard_voice_off_lxx_dark.png diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 79cc139a2..7363b6108 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -72,8 +72,6 @@ </declare-styleable> <declare-styleable name="MainKeyboardView"> - <attr name="autoCorrectionSpacebarLedEnabled" format="boolean" /> - <attr name="autoCorrectionSpacebarLedIcon" format="reference" /> <!-- Size of the text for spacebar language label, in the proportion of key height. --> <attr name="languageOnSpacebarTextRatio" format="fraction" /> <attr name="languageOnSpacebarTextColor" format="color" /> @@ -311,6 +309,9 @@ <flag name="shiftedLetterActivated" value="0x20000" /> <!-- If true, use EditorInfo.actionLabel for the key label. --> <flag name="fromCustomActionLabel" value="0x40000" /> + <!-- If true, use functionalTextColor instead of ketTextColor to drawing the label on + the key --> + <flag name="followFunctionalTextColor" value="0x80000" /> <!-- If true, disable keyHintLabel. --> <flag name="disableKeyHintLabel" value="0x40000000" /> <!-- If true, disable additionalMoreKeys. --> @@ -367,6 +368,8 @@ <attr name="keyTextShadowColor" format="color" /> <!-- Color to use for the label in a key when in inactivated state. --> <attr name="keyTextInactivatedColor" format="color" /> + <!-- Color to use for the label in a key that has followFunctionalTextColor keyLabelFlags. --> + <attr name="functionalTextColor" format="color" /> <!-- Key hint letter (= one character hint label) color --> <attr name="keyHintLetterColor" format="color" /> <!-- Key hint label color --> diff --git a/java/res/values/keyboard-icons-lxx.xml b/java/res/values/keyboard-icons-lxx.xml index ea4b6e65c..8a3886316 100644 --- a/java/res/values/keyboard-icons-lxx.xml +++ b/java/res/values/keyboard-icons-lxx.xml @@ -21,27 +21,27 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="KeyboardIcons.LXX"> <!-- Keyboard icons --> + <!-- TODO: Update those icons for LXX theme. --> <item name="iconShiftKey">@drawable/sym_keyboard_shift_holo_dark</item> - <item name="iconDeleteKey">@drawable/sym_keyboard_delete_holo_dark</item> - <item name="iconSettingsKey">@drawable/sym_keyboard_settings_holo_dark</item> + <item name="iconDeleteKey">@drawable/sym_keyboard_delete_lxx_dark</item> + <item name="iconSettingsKey">@drawable/sym_keyboard_settings_lxx_dark</item> <item name="iconSpaceKey">@drawable/sym_keyboard_space_holo_dark</item> <item name="iconEnterKey">@drawable/sym_keyboard_return_holo_dark</item> - <!-- TODO: Uncomment those icon definitions once we have those icon assets. --> - <!-- <item name="iconGoKey">@drawable/sym_keyboard_go_holo_dark</item> --> - <item name="iconSearchKey">@drawable/sym_keyboard_search_holo_dark</item> - <!-- <item name="iconSendKey">@drawable/sym_keyboard_send_holo_dark</item> --> - <!-- <item name="iconNextKey">@drawable/sym_keyboard_next_holo_dark</item> --> - <!-- <item name="iconDoneKey">@drawable/sym_keyboard_done_holo_dark</item> --> - <!-- <item name="iconPreviousKey">@drawable/sym_keyboard_previous_holo_dark</item> --> + <item name="iconGoKey">@drawable/sym_keyboard_go_lxx_dark</item> + <item name="iconSearchKey">@drawable/sym_keyboard_search_lxx_dark</item> + <item name="iconSendKey">@drawable/sym_keyboard_send_lxx_dark</item> + <item name="iconNextKey">@drawable/sym_keyboard_next_lxx_dark</item> + <item name="iconDoneKey">@drawable/sym_keyboard_done_lxx_dark</item> + <item name="iconPreviousKey">@drawable/sym_keyboard_previous_lxx_dark</item> <item name="iconTabKey">@drawable/sym_keyboard_tab_holo_dark</item> - <item name="iconShortcutKey">@drawable/sym_keyboard_voice_holo_dark</item> + <item name="iconShortcutKey">@drawable/sym_keyboard_voice_lxx_dark</item> <item name="iconSpaceKeyForNumberLayout">@drawable/sym_keyboard_space_holo_dark</item> <item name="iconShiftKeyShifted">@drawable/sym_keyboard_shift_locked_holo_dark</item> - <item name="iconShortcutKeyDisabled">@drawable/sym_keyboard_voice_off_holo_dark</item> + <item name="iconShortcutKeyDisabled">@drawable/sym_keyboard_voice_off_lxx_dark</item> <item name="iconTabKeyPreview">@drawable/sym_keyboard_feedback_tab</item> - <item name="iconLanguageSwitchKey">@drawable/sym_keyboard_language_switch_dark</item> + <item name="iconLanguageSwitchKey">@drawable/sym_keyboard_language_switch_lxx_dark</item> <item name="iconZwnjKey">@drawable/sym_keyboard_zwnj_holo_dark</item> <item name="iconZwjKey">@drawable/sym_keyboard_zwj_holo_dark</item> - <item name="iconEmojiKey">@drawable/sym_keyboard_smiley_holo_dark</item> + <item name="iconEmojiKey">@drawable/sym_keyboard_smiley_lxx_dark</item> </style> </resources> diff --git a/java/res/values/themes-ics.xml b/java/res/values/themes-ics.xml index 560cfc505..22fb2c822 100644 --- a/java/res/values/themes-ics.xml +++ b/java/res/values/themes-ics.xml @@ -53,6 +53,7 @@ <item name="keyTypeface">bold</item> <item name="keyTextColor">@color/key_text_color_holo</item> <item name="keyTextInactivatedColor">@color/key_text_inactivated_color_holo</item> + <item name="functionalTextColor">@color/key_text_color_holo</item> <item name="keyHintLetterColor">@color/key_hint_letter_color_holo</item> <item name="keyHintLabelColor">@color/key_hint_label_color_holo</item> <item name="keyShiftedLetterHintInactivatedColor">@color/key_shifted_letter_hint_inactivated_color_holo</item> @@ -70,8 +71,6 @@ <item name="gestureFloatingPreviewColor">@color/gesture_floating_preview_color_holo</item> <item name="gestureTrailColor">@color/highlight_color_ics</item> <item name="slidingKeyInputPreviewColor">@color/highlight_translucent_color_ics</item> - <item name="autoCorrectionSpacebarLedEnabled">false</item> - <item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led_holo</item> <item name="languageOnSpacebarTextColor">@color/spacebar_text_color_holo</item> <item name="languageOnSpacebarTextShadowRadius">1.0</item> <item name="languageOnSpacebarTextShadowColor">@color/spacebar_text_shadow_color_holo</item> diff --git a/java/res/values/themes-klp.xml b/java/res/values/themes-klp.xml index 453e5cbce..212f5db01 100644 --- a/java/res/values/themes-klp.xml +++ b/java/res/values/themes-klp.xml @@ -53,6 +53,7 @@ <item name="keyTypeface">bold</item> <item name="keyTextColor">@color/key_text_color_holo</item> <item name="keyTextInactivatedColor">@color/key_text_inactivated_color_holo</item> + <item name="functionalTextColor">@color/key_text_color_holo</item> <item name="keyHintLetterColor">@color/key_hint_letter_color_holo</item> <item name="keyHintLabelColor">@color/key_hint_label_color_holo</item> <item name="keyShiftedLetterHintInactivatedColor">@color/key_shifted_letter_hint_inactivated_color_holo</item> @@ -70,8 +71,6 @@ <item name="gestureFloatingPreviewColor">@color/gesture_floating_preview_color_holo</item> <item name="gestureTrailColor">@color/highlight_color_klp</item> <item name="slidingKeyInputPreviewColor">@color/highlight_translucent_color_klp</item> - <item name="autoCorrectionSpacebarLedEnabled">false</item> - <item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led_holo</item> <item name="languageOnSpacebarTextColor">@color/spacebar_text_color_holo</item> <item name="languageOnSpacebarTextShadowRadius">1.0</item> <item name="languageOnSpacebarTextShadowColor">@color/spacebar_text_shadow_color_holo</item> diff --git a/java/res/values/themes-lxx.xml b/java/res/values/themes-lxx.xml index 4f3ee80c9..3c7a2b511 100644 --- a/java/res/values/themes-lxx.xml +++ b/java/res/values/themes-lxx.xml @@ -53,6 +53,7 @@ <item name="keyTypeface">bold</item> <item name="keyTextColor">@color/key_text_color_holo</item> <item name="keyTextInactivatedColor">@color/key_text_inactive_color_lxx</item> + <item name="functionalTextColor">@color/key_hint_letter_color_lxx</item> <item name="keyHintLetterColor">@color/key_hint_letter_color_lxx</item> <item name="keyHintLabelColor">@color/key_text_inactive_color_lxx</item> <item name="keyShiftedLetterHintInactivatedColor">@color/key_text_inactive_color_lxx</item> @@ -70,8 +71,6 @@ <item name="gestureFloatingPreviewColor">@color/gesture_floating_preview_color_holo</item> <item name="gestureTrailColor">@color/highlight_color_lxx</item> <item name="slidingKeyInputPreviewColor">@color/highlight_translucent_color_lxx</item> - <item name="autoCorrectionSpacebarLedEnabled">false</item> - <item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led_holo</item> <item name="languageOnSpacebarTextColor">@color/key_text_inactive_color_lxx</item> <!-- A negative value to disable text shadow layer. --> <item name="languageOnSpacebarTextShadowRadius">-1.0</item> diff --git a/java/res/xml-sw600dp/key_styles_common.xml b/java/res/xml-sw600dp/key_styles_common.xml index f9b959b76..35b3576af 100644 --- a/java/res/xml-sw600dp/key_styles_common.xml +++ b/java/res/xml-sw600dp/key_styles_common.xml @@ -140,7 +140,7 @@ </switch> <key-style latin:styleName="baseForLayoutSwitchKeyStyle" - latin:keyLabelFlags="preserveCase" + latin:keyLabelFlags="preserveCase|followFunctionalTextColor" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style diff --git a/java/res/xml-sw600dp/key_styles_enter.xml b/java/res/xml-sw600dp/key_styles_enter.xml index 99ac10873..742bb3ec3 100644 --- a/java/res/xml-sw600dp/key_styles_enter.xml +++ b/java/res/xml-sw600dp/key_styles_enter.xml @@ -100,7 +100,7 @@ <key-style latin:styleName="defaultEnterKeyStyle" latin:keySpec="!icon/enter_key|!code/key_enter" - latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio" + latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio|followFunctionalTextColor" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" latin:parentStyle="navigateMoreKeysStyle" /> diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml index 773995fa8..f8b4a2a60 100644 --- a/java/res/xml/key_styles_common.xml +++ b/java/res/xml/key_styles_common.xml @@ -128,7 +128,7 @@ latin:keyIconPreview="!icon/tab_key_preview" /> <key-style latin:styleName="baseForLayoutSwitchKeyStyle" - latin:keyLabelFlags="preserveCase" + latin:keyLabelFlags="preserveCase|followFunctionalTextColor" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style diff --git a/java/res/xml/key_styles_enter.xml b/java/res/xml/key_styles_enter.xml index 8bba136bd..1d46dd523 100644 --- a/java/res/xml/key_styles_enter.xml +++ b/java/res/xml/key_styles_enter.xml @@ -255,7 +255,7 @@ <!-- Enter key style --> <key-style latin:styleName="defaultEnterKeyStyle" - latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio" + latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio|followFunctionalTextColor" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" latin:parentStyle="navigateMoreKeysStyle" /> diff --git a/java/res/xml/key_styles_number.xml b/java/res/xml/key_styles_number.xml index 5c108cf58..df4448c25 100644 --- a/java/res/xml/key_styles_number.xml +++ b/java/res/xml/key_styles_number.xml @@ -30,7 +30,7 @@ latin:parentStyle="numKeyBaseStyle" /> <key-style latin:styleName="numModeKeyStyle" - latin:keyLabelFlags="fontNormal|followKeyLetterRatio" + latin:keyLabelFlags="fontNormal|followKeyLetterRatio|followFunctionalTextColor" latin:parentStyle="numKeyBaseStyle" /> <key-style latin:styleName="numFunctionalKeyStyle" diff --git a/java/res/xml/rows_number_normal.xml b/java/res/xml/rows_number_normal.xml index 859a1624a..d8d15080e 100644 --- a/java/res/xml/rows_number_normal.xml +++ b/java/res/xml/rows_number_normal.xml @@ -90,11 +90,6 @@ latin:keyWidth="fillRight" /> </Row> <Row> - <Key - latin:keyStyle="numSpaceKeyStyle" /> - <Key - latin:keySpec="0" - latin:keyStyle="numKeyStyle" /> <switch> <case latin:mode="date" @@ -125,6 +120,11 @@ </default> </switch> <Key + latin:keySpec="0" + latin:keyStyle="numKeyStyle" /> + <Key + latin:keyStyle="numSpaceKeyStyle" /> + <Key latin:keyStyle="enterKeyStyle" latin:keyWidth="fillRight" /> </Row> diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index 4c2250740..a1269c801 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -86,6 +86,7 @@ public class Key implements Comparable<Key> { private static final int LABEL_FLAGS_PRESERVE_CASE = 0x10000; private static final int LABEL_FLAGS_SHIFTED_LETTER_ACTIVATED = 0x20000; private static final int LABEL_FLAGS_FROM_CUSTOM_ACTION_LABEL = 0x40000; + private static final int LABEL_FLAGS_FOLLOW_FUNCTIONAL_TEXT_COLOR = 0x80000; private static final int LABEL_FLAGS_DISABLE_HINT_LABEL = 0x40000000; private static final int LABEL_FLAGS_DISABLE_ADDITIONAL_MORE_KEYS = 0x80000000; @@ -583,6 +584,9 @@ public class Key implements Comparable<Key> { } public final int selectTextColor(final KeyDrawParams params) { + if ((mLabelFlags & LABEL_FLAGS_FOLLOW_FUNCTIONAL_TEXT_COLOR) != 0) { + return params.mFunctionalTextColor; + } return isShiftedLetterActivated() ? params.mTextInactivatedColor : params.mTextColor; } diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index fc9faa6e3..61d51d1c9 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -61,10 +61,6 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { private final KeyboardTextsSet mKeyboardTextsSet = new KeyboardTextsSet(); private SettingsValues mCurrentSettingsValues; - /** mIsAutoCorrectionActive indicates that auto corrected word will be input instead of - * what user actually typed. */ - private boolean mIsAutoCorrectionActive; - private KeyboardTheme mKeyboardTheme; private Context mThemeContext; @@ -142,12 +138,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { } } - public void onFinishInputView() { - mIsAutoCorrectionActive = false; - } - public void onHideWindow() { - mIsAutoCorrectionActive = false; if (mKeyboardView != null) { mKeyboardView.onHideWindow(); } @@ -168,7 +159,6 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { mCurrentSettingsValues.mKeyPreviewShowUpDuration, mCurrentSettingsValues.mKeyPreviewDismissEndScale, mCurrentSettingsValues.mKeyPreviewDismissDuration); - keyboardView.updateAutoCorrectionState(mIsAutoCorrectionActive); keyboardView.updateShortcutKey(mSubtypeSwitcher.isShortcutImeReady()); final boolean subtypeChanged = (oldKeyboard == null) || !keyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale); @@ -254,7 +244,7 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { // Implements {@link KeyboardState.SwitchActions}. @Override public void setEmojiKeyboard() { - final Keyboard keyboard = mKeyboardView.getKeyboard(); + final Keyboard keyboard = mKeyboardLayoutSet.getKeyboard(KeyboardId.ELEMENT_ALPHABET); mMainKeyboardFrame.setVisibility(View.GONE); mEmojiPalettesView.startEmojiPalettes( mKeyboardTextsSet.getText(KeyboardTextsSet.SWITCH_TO_ALPHA_KEY_LABEL), @@ -367,15 +357,6 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions { } } - public void onAutoCorrectionStateChanged(final boolean isAutoCorrection) { - if (mIsAutoCorrectionActive != isAutoCorrection) { - mIsAutoCorrectionActive = isAutoCorrection; - if (mKeyboardView != null) { - mKeyboardView.updateAutoCorrectionState(isAutoCorrection); - } - } - } - public int getKeyboardShiftMode() { final Keyboard keyboard = getKeyboard(); if (keyboard == null) { diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java index 4a0976845..ac11dca97 100644 --- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java @@ -70,8 +70,6 @@ import java.util.WeakHashMap; /** * A view that is responsible for detecting key presses and touch movements. * - * @attr ref R.styleable#MainKeyboardView_autoCorrectionSpacebarLedEnabled - * @attr ref R.styleable#MainKeyboardView_autoCorrectionSpacebarLedIcon * @attr ref R.styleable#MainKeyboardView_languageOnSpacebarTextRatio * @attr ref R.styleable#MainKeyboardView_languageOnSpacebarTextColor * @attr ref R.styleable#MainKeyboardView_languageOnSpacebarTextShadowRadius @@ -133,11 +131,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack private static final float LANGUAGE_ON_SPACEBAR_TEXT_SHADOW_RADIUS_DISABLED = -1.0f; // The minimum x-scale to fit the language name on spacebar. private static final float MINIMUM_XSCALE_OF_LANGUAGE_NAME = 0.8f; - // Stuff to draw auto correction LED on spacebar. - private boolean mAutoCorrectionSpacebarLedOn; - private final boolean mAutoCorrectionSpacebarLedEnabled; - private final Drawable mAutoCorrectionSpacebarLedIcon; - private static final int SPACE_LED_LENGTH_PERCENT = 80; // Stuff to draw altCodeWhileTyping keys. private final ObjectAnimator mAltCodeKeyWhileTypingFadeoutAnimator; @@ -221,10 +214,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack R.styleable.MainKeyboardView_backgroundDimAlpha, 0); mBackgroundDimAlphaPaint.setColor(Color.BLACK); mBackgroundDimAlphaPaint.setAlpha(backgroundDimAlpha); - mAutoCorrectionSpacebarLedEnabled = mainKeyboardViewAttr.getBoolean( - R.styleable.MainKeyboardView_autoCorrectionSpacebarLedEnabled, false); - mAutoCorrectionSpacebarLedIcon = mainKeyboardViewAttr.getDrawable( - R.styleable.MainKeyboardView_autoCorrectionSpacebarLedIcon); mLanguageOnSpacebarTextRatio = mainKeyboardViewAttr.getFraction( R.styleable.MainKeyboardView_languageOnSpacebarTextRatio, 1, 1, 1.0f); mLanguageOnSpacebarTextColor = mainKeyboardViewAttr.getColor( @@ -834,14 +823,6 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack invalidateKey(mSpaceKey); } - public void updateAutoCorrectionState(final boolean isAutoCorrection) { - if (!mAutoCorrectionSpacebarLedEnabled) { - return; - } - mAutoCorrectionSpacebarLedOn = isAutoCorrection; - invalidateKey(mSpaceKey); - } - private void dimEntireKeyboard(final boolean dimmed) { final boolean needsRedrawing = mNeedsToDimEntireKeyboard != dimmed; mNeedsToDimEntireKeyboard = dimmed; @@ -946,13 +927,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack } // Draw the spacebar icon at the bottom - if (mAutoCorrectionSpacebarLedOn) { - final int iconWidth = width * SPACE_LED_LENGTH_PERCENT / 100; - final int iconHeight = mAutoCorrectionSpacebarLedIcon.getIntrinsicHeight(); - int x = (width - iconWidth) / 2; - int y = height - iconHeight; - drawIcon(canvas, mAutoCorrectionSpacebarLedIcon, x, y, iconWidth, iconHeight); - } else if (mSpacebarIcon != null) { + if (mSpacebarIcon != null) { final int iconWidth = mSpacebarIcon.getIntrinsicWidth(); final int iconHeight = mSpacebarIcon.getIntrinsicHeight(); int x = (width - iconWidth) / 2; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java b/java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java index 1716fa049..07ac06bab 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java @@ -35,6 +35,7 @@ public final class KeyDrawParams { public int mTextColor; public int mTextInactivatedColor; public int mTextShadowColor; + public int mFunctionalTextColor; public int mHintLetterColor; public int mHintLabelColor; public int mShiftedLetterHintInactivatedColor; @@ -60,6 +61,7 @@ public final class KeyDrawParams { mTextColor = copyFrom.mTextColor; mTextInactivatedColor = copyFrom.mTextInactivatedColor; mTextShadowColor = copyFrom.mTextShadowColor; + mFunctionalTextColor = copyFrom.mFunctionalTextColor; mHintLetterColor = copyFrom.mHintLetterColor; mHintLabelColor = copyFrom.mHintLabelColor; mShiftedLetterHintInactivatedColor = copyFrom.mShiftedLetterHintInactivatedColor; @@ -93,6 +95,7 @@ public final class KeyDrawParams { mTextColor = selectColor(attr.mTextColor, mTextColor); mTextInactivatedColor = selectColor(attr.mTextInactivatedColor, mTextInactivatedColor); mTextShadowColor = selectColor(attr.mTextShadowColor, mTextShadowColor); + mFunctionalTextColor = selectColor(attr.mFunctionalTextColor, mFunctionalTextColor); mHintLetterColor = selectColor(attr.mHintLetterColor, mHintLetterColor); mHintLabelColor = selectColor(attr.mHintLabelColor, mHintLabelColor); mShiftedLetterHintInactivatedColor = selectColor( diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java b/java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java index df386fce4..133462ac7 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java @@ -40,6 +40,7 @@ public final class KeyVisualAttributes { public final int mTextColor; public final int mTextInactivatedColor; public final int mTextShadowColor; + public final int mFunctionalTextColor; public final int mHintLetterColor; public final int mHintLabelColor; public final int mShiftedLetterHintInactivatedColor; @@ -61,6 +62,7 @@ public final class KeyVisualAttributes { R.styleable.Keyboard_Key_keyTextColor, R.styleable.Keyboard_Key_keyTextInactivatedColor, R.styleable.Keyboard_Key_keyTextShadowColor, + R.styleable.Keyboard_Key_functionalTextColor, R.styleable.Keyboard_Key_keyHintLetterColor, R.styleable.Keyboard_Key_keyHintLabelColor, R.styleable.Keyboard_Key_keyShiftedLetterHintInactivatedColor, @@ -122,6 +124,7 @@ public final class KeyVisualAttributes { mTextInactivatedColor = keyAttr.getColor( R.styleable.Keyboard_Key_keyTextInactivatedColor, 0); mTextShadowColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyTextShadowColor, 0); + mFunctionalTextColor = keyAttr.getColor(R.styleable.Keyboard_Key_functionalTextColor, 0); mHintLetterColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyHintLetterColor, 0); mHintLabelColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyHintLabelColor, 0); mShiftedLetterHintInactivatedColor = keyAttr.getColor( diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index 999508e92..1e31c96ec 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -214,8 +214,6 @@ public final class BinaryDictionary extends Dictionary { private static native void removeBigramWordsNative(long dict, int[] word0, int[] word1); private static native int addMultipleDictionaryEntriesNative(long dict, LanguageModelParam[] languageModelParams, int startIndex); - private static native int calculateProbabilityNative(long dict, int unigramProbability, - int bigramProbability); private static native String getPropertyNative(long dict, String query); private static native boolean isCorruptedNative(long dict); private static native boolean migrateNative(long dict, String dictFilePath, @@ -552,12 +550,6 @@ public final class BinaryDictionary extends Dictionary { } @UsedForTesting - public int calculateProbability(final int unigramProbability, final int bigramProbability) { - if (!isValidDictionary()) return NOT_A_PROBABILITY; - return calculateProbabilityNative(mNativeDict, unigramProbability, bigramProbability); - } - - @UsedForTesting public String getPropertyForTest(final String query) { if (!isValidDictionary()) return ""; return getPropertyNative(mNativeDict, query); diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 8a2ed1088..74b83c1bb 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -84,6 +84,7 @@ import com.android.inputmethod.latin.utils.CapsModeUtils; import com.android.inputmethod.latin.utils.CoordinateUtils; import com.android.inputmethod.latin.utils.DialogUtils; import com.android.inputmethod.latin.utils.DistracterFilter; +import com.android.inputmethod.latin.utils.DistracterFilterUtils; import com.android.inputmethod.latin.utils.ImportantNoticeUtils; import com.android.inputmethod.latin.utils.IntentUtils; import com.android.inputmethod.latin.utils.JniUtils; @@ -480,6 +481,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen KeyboardSwitcher.init(this); AudioAndHapticFeedbackManager.init(this); AccessibilityUtils.init(this); + StatsUtils.init(this); super.onCreate(); @@ -519,7 +521,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen DictionaryDecayBroadcastReciever.setUpIntervalAlarmForDictionaryDecaying(this); - StatsUtils.onCreateCompleted(this); + StatsUtils.onCreate(mSettings.getCurrent()); } // Has to be package-visible for unit tests @@ -538,6 +540,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen resetSuggestForLocale(locale); } refreshPersonalizationDictionarySession(); + StatsUtils.onLoadSettings(currentSettingsValues); } private void refreshPersonalizationDictionarySession() { @@ -902,7 +905,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void onFinishInputViewInternal(final boolean finishingInput) { super.onFinishInputView(finishingInput); - mKeyboardSwitcher.onFinishInputView(); mKeyboardSwitcher.deallocateMemory(); // Remove pending messages related to update suggestions mHandler.cancelUpdateSuggestionStrip(); @@ -1385,7 +1387,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (!hasSuggestionStripView()) { return; } - mKeyboardSwitcher.onAutoCorrectionStateChanged(suggestedWords.mWillAutoCorrect); if (!onEvaluateInputViewShown()) { return; } @@ -1745,7 +1746,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen @UsedForTesting /* package for test */ DistracterFilter createDistracterFilter() { - return DistracterFilter.createDistracterFilter(mInputLogic.mSuggest, mKeyboardSwitcher); + return DistracterFilterUtils.createDistracterFilter( + mInputLogic.mSuggest, mKeyboardSwitcher); } public void dumpDictionaryForDebug(final String dictName) { diff --git a/java/src/com/android/inputmethod/latin/settings/Settings.java b/java/src/com/android/inputmethod/latin/settings/Settings.java index 4e4c8885c..d4f6bcd10 100644 --- a/java/src/com/android/inputmethod/latin/settings/Settings.java +++ b/java/src/com/android/inputmethod/latin/settings/Settings.java @@ -87,6 +87,8 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang public static final String PREF_DEBUG_SETTINGS = "debug_settings"; public static final String PREF_KEY_IS_INTERNAL = "pref_key_is_internal"; + public static final String PREF_ENABLE_METRICS_LOGGING = "pref_enable_metrics_logging"; + // This preference key is deprecated. Use {@link #PREF_SHOW_LANGUAGE_SWITCH_KEY} instead. // This is being used only for the backward compatibility. private static final String PREF_SUPPRESS_LANGUAGE_SWITCH_KEY = diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java index de2eb951e..16fd05877 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java @@ -73,6 +73,7 @@ public final class SettingsValues { public final boolean mPhraseGestureEnabled; public final int mKeyLongpressTimeout; public final Locale mLocale; + public final boolean mEnableMetricsLogging; // From the input box public final InputAttributes mInputAttributes; @@ -134,7 +135,7 @@ public final class SettingsValues { mAutoCorrectEnabled = Settings.readAutoCorrectEnabled(autoCorrectionThresholdRawValue, res); mBigramPredictionEnabled = readBigramPredictionEnabled(prefs, res); mDoubleSpacePeriodTimeout = res.getInteger(R.integer.config_double_space_period_timeout); - + mEnableMetricsLogging = prefs.getBoolean(Settings.PREF_ENABLE_METRICS_LOGGING, true); // Compute other readable settings mKeyLongpressTimeout = Settings.readKeyLongpressTimeout(prefs, res); mKeypressVibrationDuration = Settings.readKeypressVibrationDuration(prefs, res); diff --git a/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java b/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java index f0963f7b1..0a0379982 100644 --- a/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java +++ b/java/src/com/android/inputmethod/latin/utils/DistracterFilter.java @@ -17,8 +17,6 @@ package com.android.inputmethod.latin.utils; import com.android.inputmethod.keyboard.Keyboard; -import com.android.inputmethod.keyboard.KeyboardSwitcher; -import com.android.inputmethod.keyboard.MainKeyboardView; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.Suggest; import com.android.inputmethod.latin.Suggest.OnGetSuggestedWordsCallback; @@ -54,18 +52,6 @@ public class DistracterFilter { mKeyboard = keyboard; } - public static DistracterFilter createDistracterFilter(final Suggest suggest, - final KeyboardSwitcher keyboardSwitcher) { - final MainKeyboardView mainKeyboardView = keyboardSwitcher.getMainKeyboardView(); - // TODO: Create Keyboard when mainKeyboardView is null. - // TODO: Figure out the most reasonable keyboard for the filter. Refer to the - // spellchecker's logic. - final Keyboard keyboard = (mainKeyboardView != null) ? - mainKeyboardView.getKeyboard() : null; - final DistracterFilter distracterFilter = new DistracterFilter(suggest, keyboard); - return distracterFilter; - } - private static boolean suggestionExceedsDistracterThreshold( final SuggestedWordInfo suggestion, final String consideredWord, final float distracterThreshold) { diff --git a/java/src/com/android/inputmethod/latin/utils/DistracterFilterUtils.java b/java/src/com/android/inputmethod/latin/utils/DistracterFilterUtils.java new file mode 100644 index 000000000..df07f976c --- /dev/null +++ b/java/src/com/android/inputmethod/latin/utils/DistracterFilterUtils.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.inputmethod.latin.utils; + +import com.android.inputmethod.keyboard.Keyboard; +import com.android.inputmethod.keyboard.KeyboardSwitcher; +import com.android.inputmethod.keyboard.MainKeyboardView; +import com.android.inputmethod.latin.Suggest; + +public class DistracterFilterUtils { + private DistracterFilterUtils() { + // This utility class is not publicly instantiable. + } + + public static final DistracterFilter createDistracterFilter(final Suggest suggest, + final KeyboardSwitcher keyboardSwitcher) { + final MainKeyboardView mainKeyboardView = keyboardSwitcher.getMainKeyboardView(); + // TODO: Create Keyboard when mainKeyboardView is null. + // TODO: Figure out the most reasonable keyboard for the filter. Refer to the + // spellchecker's logic. + final Keyboard keyboard = (mainKeyboardView != null) ? + mainKeyboardView.getKeyboard() : null; + final DistracterFilter distracterFilter = new DistracterFilter(suggest, keyboard); + return distracterFilter; + } +} diff --git a/java/src/com/android/inputmethod/latin/utils/StatsUtils.java b/java/src/com/android/inputmethod/latin/utils/StatsUtils.java index a059f877b..79c19d077 100644 --- a/java/src/com/android/inputmethod/latin/utils/StatsUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/StatsUtils.java @@ -17,37 +17,18 @@ package com.android.inputmethod.latin.utils; import android.content.Context; -import android.content.SharedPreferences; -import android.preference.PreferenceManager; -import android.util.Log; - -import com.android.inputmethod.latin.settings.Settings; +import com.android.inputmethod.latin.settings.SettingsValues; public final class StatsUtils { - private static final String TAG = StatsUtils.class.getSimpleName(); - private static final StatsUtils sInstance = new StatsUtils(); - - public static void onCreateCompleted(final Context context) { - sInstance.onCreateCompletedInternal(context); + public static void init(final Context context) { } - private void onCreateCompletedInternal(final Context context) { - mContext = context; - final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); - final Boolean usePersonalizedDict = - prefs.getBoolean(Settings.PREF_KEY_USE_PERSONALIZED_DICTS, true); - Log.d(TAG, "onCreateCompleted. context: " + context.toString() + "usePersonalizedDict: " - + usePersonalizedDict); + public static void onCreate(final SettingsValues settingsValues) { } - public static void onDestroy() { - sInstance.onDestroyInternal(); + public static void onLoadSettings(final SettingsValues settingsValues) { } - private void onDestroyInternal() { - Log.d(TAG, "onDestroy. context: " + mContext.toString()); - mContext = null; + public static void onDestroy() { } - - private Context mContext; } |