aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/proguard.flags4
-rw-r--r--java/res/anim/key_preview_fadein.xml29
-rw-r--r--java/res/anim/key_preview_fadeout.xml29
-rw-r--r--java/res/anim/mini_keyboard_fadein.xml2
-rw-r--r--java/res/anim/mini_keyboard_fadeout.xml2
-rw-r--r--java/res/drawable-hdpi/btn_candidate_normal.9.pngbin248 -> 0 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_dark_normal.9.pngbin472 -> 511 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_dark_normal_off.9.pngbin649 -> 760 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on.9.pngbin944 -> 1088 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_dark_pressed.9.pngbin663 -> 730 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off.9.pngbin869 -> 940 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on.9.pngbin1119 -> 1260 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_fulltrans_normal.9.pngbin1370 -> 1649 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_fulltrans_pressed.9.pngbin1315 -> 1696 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_light_normal.9.pngbin448 -> 461 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_light_popup_normal.9.pngbin126 -> 332 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_light_popup_selected.9.pngbin453 -> 498 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_light_pressed.9.pngbin649 -> 811 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_normal.9.pngbin904 -> 715 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_normal_off.9.pngbin1076 -> 1001 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_normal_off_stone.9.pngbin2059 -> 2389 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_normal_on.9.pngbin1137 -> 1077 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_normal_on_stone.9.pngbin2029 -> 2408 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_normal_stone.9.pngbin1719 -> 2213 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_pressed.9.pngbin831 -> 745 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_pressed_off.9.pngbin1041 -> 1042 bytes
-rw-r--r--java/res/drawable-hdpi/btn_keyboard_key_pressed_on.9.pngbin1086 -> 1105 bytes
-rw-r--r--java/res/drawable-hdpi/cancel.pngbin9335 -> 3992 bytes
-rw-r--r--java/res/drawable-hdpi/candidate_feedback_background.9.pngbin1607 -> 833 bytes
-rw-r--r--java/res/drawable-hdpi/caution.pngbin2451 -> 1641 bytes
-rw-r--r--java/res/drawable-hdpi/dialog_bubble_step02.9.pngbin1422 -> 1475 bytes
-rw-r--r--java/res/drawable-hdpi/dialog_bubble_step07.9.pngbin7031 -> 6012 bytes
-rw-r--r--java/res/drawable-hdpi/highlight_pressed.pngbin1152 -> 0 bytes
-rw-r--r--java/res/drawable-hdpi/hint_popup.9.pngbin242 -> 226 bytes
-rw-r--r--java/res/drawable-hdpi/ic_dialog_keyboard.pngbin1157 -> 807 bytes
-rw-r--r--java/res/drawable-hdpi/ic_mic_dialog.pngbin4083 -> 3634 bytes
-rw-r--r--java/res/drawable-hdpi/ic_subtype_keyboard.pngbin812 -> 1068 bytes
-rw-r--r--java/res/drawable-hdpi/ic_subtype_mic.pngbin892 -> 681 bytes
-rw-r--r--java/res/drawable-hdpi/ic_suggest_strip_microphone.pngbin970 -> 548 bytes
-rw-r--r--java/res/drawable-hdpi/ic_suggest_strip_microphone_swipe.pngbin795 -> 438 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_background.9.pngbin207 -> 200 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_dark_background.9.pngbin210 -> 1041 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_hint_0.9.pngbin377 -> 379 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_hint_1.9.pngbin347 -> 301 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_hint_2.9.pngbin382 -> 404 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_hint_3.9.pngbin401 -> 413 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_hint_4.9.pngbin375 -> 341 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_hint_5.9.pngbin402 -> 388 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_hint_6.9.pngbin392 -> 413 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_hint_7.9.pngbin379 -> 367 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_hint_8.9.pngbin400 -> 417 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_hint_9.9.pngbin395 -> 417 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_key_feedback_background.9.pngbin937 -> 1099 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_key_feedback_background_holo.9.pngbin136 -> 4040 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_key_feedback_more_background.9.pngbin1099 -> 1310 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_popup_panel_background.9.pngbin1204 -> 1494 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_suggest_strip.9.pngbin248 -> 215 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_suggest_strip_divider.pngbin2946 -> 1012 bytes
-rw-r--r--java/res/drawable-hdpi/mic_slash.pngbin12569 -> 6995 bytes
-rw-r--r--java/res/drawable-hdpi/ok_cancel.pngbin4043 -> 774 bytes
-rw-r--r--java/res/drawable-hdpi/speak_now_level0.pngbin7411 -> 6017 bytes
-rw-r--r--java/res/drawable-hdpi/speak_now_level1.pngbin7471 -> 6267 bytes
-rw-r--r--java/res/drawable-hdpi/speak_now_level2.pngbin7526 -> 6359 bytes
-rw-r--r--java/res/drawable-hdpi/speak_now_level3.pngbin7676 -> 6506 bytes
-rw-r--r--java/res/drawable-hdpi/speak_now_level4.pngbin7672 -> 6542 bytes
-rw-r--r--java/res/drawable-hdpi/speak_now_level5.pngbin7498 -> 6463 bytes
-rw-r--r--java/res/drawable-hdpi/speak_now_level6.pngbin11212 -> 6782 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_123_mic.pngbin2583 -> 2576 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_delete.pngbin1856 -> 2314 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_done.pngbin1837 -> 1588 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_mic.pngbin1453 -> 1410 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_num0.pngbin1928 -> 1903 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_num1.pngbin899 -> 792 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_num2.pngbin2805 -> 3241 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_num3.pngbin2578 -> 2829 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_num4.pngbin2489 -> 2638 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_num5.pngbin2287 -> 2532 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_num6.pngbin3017 -> 3568 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_num7.pngbin3108 -> 3687 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_num8.pngbin2719 -> 2952 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_num9.pngbin3330 -> 3887 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_numalt.pngbin2724 -> 2971 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_numpound.pngbin1633 -> 1577 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_numstar.pngbin1675 -> 1742 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_return.pngbin1426 -> 1111 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_search.pngbin2045 -> 1612 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_settings.pngbin1710 -> 729 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_shift.pngbin1820 -> 1474 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_shift_locked.pngbin1467 -> 1115 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_space.pngbin790 -> 358 bytes
-rw-r--r--java/res/drawable-hdpi/sym_bkeyboard_tab.pngbin1123 -> 1008 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_123_mic.pngbin2510 -> 2575 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_delete.pngbin4003 -> 599 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_done.pngbin1827 -> 1593 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_123_mic.pngbin6061 -> 3541 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_delete.pngbin4019 -> 681 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_done.pngbin1711 -> 1068 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_language_arrows_left.pngbin3397 -> 1275 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_language_arrows_right.pngbin3388 -> 1329 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_mic.pngbin4637 -> 2494 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_numalt.pngbin5931 -> 3797 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_return.pngbin4346 -> 2018 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_search.pngbin4658 -> 2335 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_settings.pngbin4641 -> 1558 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_shift.pngbin3865 -> 677 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.pngbin3845 -> 652 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_space.pngbin3908 -> 1336 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_feedback_tab.pngbin4111 -> 1707 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_language_arrows_left.pngbin3220 -> 1253 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_language_arrows_right.pngbin3286 -> 1372 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_mic.pngbin3893 -> 886 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_num0.pngbin1872 -> 1931 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_num1.pngbin867 -> 809 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_num2.pngbin2720 -> 3214 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_num3.pngbin2523 -> 2805 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_num4.pngbin2419 -> 2647 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_num5.pngbin2230 -> 2536 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_num6.pngbin2950 -> 3573 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_num7.pngbin3035 -> 3684 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_num8.pngbin2628 -> 2904 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_num9.pngbin3255 -> 3860 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_numalt.pngbin2664 -> 2919 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_numpound.pngbin1583 -> 1600 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_numstar.pngbin1618 -> 1749 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_return.pngbin4024 -> 1719 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_search.pngbin4248 -> 1260 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_settings.pngbin4015 -> 1094 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_shift.pngbin3740 -> 640 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_shift_locked.pngbin3686 -> 593 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_space.pngbin3331 -> 326 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_space_led.9.pngbin557 -> 3249 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_tab.pngbin3792 -> 1434 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_voice_off_holo.pngbin1328 -> 900 bytes
-rw-r--r--java/res/drawable-hdpi/voice_ime_background.9.pngbin1348 -> 1271 bytes
-rw-r--r--java/res/drawable-hdpi/voice_swipe_hint.pngbin4028 -> 5965 bytes
-rwxr-xr-x[-rw-r--r--]java/res/drawable-hdpi/working.pngbin4179 -> 1180 bytes
-rw-r--r--java/res/drawable-mdpi/btn_candidate_normal.9.pngbin205 -> 0 bytes
-rw-r--r--java/res/drawable-mdpi/highlight_pressed.pngbin593 -> 0 bytes
-rw-r--r--java/res/drawable-mdpi/keyboard_key_feedback_background_holo.9.pngbin1004 -> 3804 bytes
-rw-r--r--java/res/drawable-mdpi/sym_keyboard_voice_off_holo.pngbin1587 -> 386 bytes
-rw-r--r--java/res/drawable-mdpi/top_suggest_line_holo.9.pngbin1012 -> 0 bytes
-rw-r--r--java/res/drawable/btn_candidate.xml2
-rw-r--r--java/res/drawable/ic_suggest_scroll_background.xml25
-rw-r--r--java/res/drawable/keyboard_key_feedback_honeycomb.xml2
-rw-r--r--java/res/layout-xlarge/candidate.xml15
-rw-r--r--java/res/layout-xlarge/candidates.xml43
-rw-r--r--java/res/layout-xlarge/keyboard_popup_honeycomb.xml41
-rw-r--r--java/res/layout/candidate.xml15
-rw-r--r--java/res/layout/candidates.xml14
-rw-r--r--java/res/layout/input_basic.xml1
-rw-r--r--java/res/layout/input_basic_highcontrast.xml2
-rw-r--r--java/res/layout/input_gingerbread.xml3
-rw-r--r--java/res/layout/input_honeycomb.xml5
-rw-r--r--java/res/layout/input_stone_bold.xml3
-rw-r--r--java/res/layout/input_stone_normal.xml3
-rw-r--r--java/res/layout/key_preview_honeycomb.xml2
-rw-r--r--java/res/layout/keyboard_popup.xml9
-rw-r--r--java/res/layout/keyboard_popup_honeycomb.xml9
-rw-r--r--java/res/layout/keyboard_popup_stone.xml (renamed from java/res/layout/input_stone_popup.xml)1
-rw-r--r--java/res/layout/recognition_status.xml2
-rw-r--r--java/res/values-ar/strings.xml2
-rw-r--r--java/res/values-bg/strings.xml2
-rw-r--r--java/res/values-ca/strings.xml2
-rw-r--r--java/res/values-cs/strings.xml2
-rw-r--r--java/res/values-da/strings.xml2
-rw-r--r--java/res/values-de/strings.xml8
-rw-r--r--java/res/values-el/strings.xml2
-rw-r--r--java/res/values-en-rGB/strings.xml2
-rw-r--r--java/res/values-es-rUS/strings.xml2
-rw-r--r--java/res/values-es/strings.xml2
-rw-r--r--java/res/values-fa/strings.xml2
-rw-r--r--java/res/values-fi/strings.xml2
-rw-r--r--java/res/values-fr/strings.xml2
-rw-r--r--java/res/values-hr/strings.xml2
-rw-r--r--java/res/values-hu/strings.xml2
-rw-r--r--java/res/values-in/strings.xml2
-rw-r--r--java/res/values-it/strings.xml2
-rw-r--r--java/res/values-iw/strings.xml2
-rw-r--r--java/res/values-ja/strings.xml2
-rw-r--r--java/res/values-ko/strings.xml2
-rw-r--r--java/res/values-land/dimens.xml1
-rw-r--r--java/res/values-lt/strings.xml2
-rw-r--r--java/res/values-lv/strings.xml2
-rw-r--r--java/res/values-nb/strings.xml2
-rw-r--r--java/res/values-nl/strings.xml2
-rw-r--r--java/res/values-pl/strings.xml2
-rw-r--r--java/res/values-pt-rPT/strings.xml2
-rw-r--r--java/res/values-pt/strings.xml2
-rw-r--r--java/res/values-rm/strings.xml4
-rw-r--r--java/res/values-ro/strings.xml2
-rw-r--r--java/res/values-ru/strings.xml2
-rw-r--r--java/res/values-sk/strings.xml2
-rw-r--r--java/res/values-sl/strings.xml2
-rw-r--r--java/res/values-sr/strings.xml2
-rw-r--r--java/res/values-sv/strings.xml2
-rw-r--r--java/res/values-th/strings.xml2
-rw-r--r--java/res/values-tl/strings.xml2
-rw-r--r--java/res/values-tr/strings.xml2
-rw-r--r--java/res/values-uk/strings.xml2
-rw-r--r--java/res/values-vi/strings.xml2
-rw-r--r--java/res/values-xlarge-land/dimens.xml8
-rw-r--r--java/res/values-xlarge/config.xml3
-rw-r--r--java/res/values-xlarge/dimens.xml13
-rw-r--r--java/res/values-zh-rCN/strings.xml2
-rw-r--r--java/res/values-zh-rTW/strings.xml2
-rw-r--r--java/res/values/attrs.xml7
-rw-r--r--java/res/values/colors.xml2
-rw-r--r--java/res/values/config.xml2
-rw-r--r--java/res/values/dimens.xml21
-rw-r--r--java/res/values/donottranslate-altchars.xml4
-rw-r--r--java/res/values/strings.xml5
-rw-r--r--java/res/values/styles.xml4
-rw-r--r--java/res/xml-ar/kbd_qwerty.xml (renamed from java/res/xml/kbd_popup_narrow_template.xml)21
-rw-r--r--java/res/xml-iw/kbd_qwerty.xml98
-rw-r--r--java/res/xml-xlarge/kbd_ar_rows.xml139
-rw-r--r--java/res/xml-xlarge/kbd_iw_rows.xml130
-rw-r--r--java/res/xml-xlarge/kbd_key_styles.xml2
-rw-r--r--java/res/xml/kbd_ar_rows.xml119
-rw-r--r--java/res/xml/kbd_azerty_rows.xml2
-rw-r--r--java/res/xml/kbd_iw_rows.xml106
-rw-r--r--java/res/xml/kbd_key_styles.xml47
-rw-r--r--java/res/xml/kbd_qwerty_black_symbol.xml84
-rw-r--r--java/res/xml/kbd_qwerty_f1.xml19
-rw-r--r--java/res/xml/kbd_qwerty_row3.xml2
-rw-r--r--java/res/xml/kbd_qwertz_rows.xml2
-rw-r--r--java/res/xml/kbd_symbols.xml2
-rw-r--r--java/res/xml/kbd_symbols_f1.xml11
-rw-r--r--java/res/xml/kbd_symbols_shift.xml2
-rw-r--r--java/res/xml/method.xml216
-rw-r--r--java/res/xml/prefs.xml153
-rw-r--r--java/src/com/android/inputmethod/compat/AbstractCompatWrapper.java39
-rw-r--r--java/src/com/android/inputmethod/compat/CompatUtils.java159
-rw-r--r--java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java99
-rw-r--r--java/src/com/android/inputmethod/compat/InputConnectionCompatUtils.java91
-rw-r--r--java/src/com/android/inputmethod/compat/InputMethodInfoCompatWrapper.java59
-rw-r--r--java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java223
-rw-r--r--java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java78
-rw-r--r--java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatWrapper.java151
-rw-r--r--java/src/com/android/inputmethod/compat/InputTypeCompatUtils.java95
-rw-r--r--java/src/com/android/inputmethod/compat/VibratorCompatWrapper.java47
-rw-r--r--java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java85
-rw-r--r--java/src/com/android/inputmethod/deprecated/VoiceProxy.java (renamed from java/src/com/android/inputmethod/voice/VoiceIMEConnector.java)144
-rw-r--r--java/src/com/android/inputmethod/deprecated/compat/VoiceInputLoggerCompatUtils.java36
-rw-r--r--java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java (renamed from java/src/com/android/inputmethod/latin/LanguageSwitcher.java)59
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/FieldContext.java (renamed from java/src/com/android/inputmethod/voice/FieldContext.java)2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/Hints.java (renamed from java/src/com/android/inputmethod/voice/Hints.java)2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/RecognitionView.java (renamed from java/src/com/android/inputmethod/voice/RecognitionView.java)3
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/SettingsUtil.java (renamed from java/src/com/android/inputmethod/voice/SettingsUtil.java)2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/SoundIndicator.java (renamed from java/src/com/android/inputmethod/voice/SoundIndicator.java)2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/VoiceInput.java (renamed from java/src/com/android/inputmethod/voice/VoiceInput.java)2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java (renamed from java/src/com/android/inputmethod/voice/VoiceInputLogger.java)12
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/WaveformImage.java (renamed from java/src/com/android/inputmethod/voice/WaveformImage.java)2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/Whitelist.java (renamed from java/src/com/android/inputmethod/voice/Whitelist.java)2
-rw-r--r--java/src/com/android/inputmethod/keyboard/Key.java49
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyStyles.java2
-rw-r--r--java/src/com/android/inputmethod/keyboard/Keyboard.java6
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardId.java31
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardParser.java17
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java17
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardView.java136
-rw-r--r--java/src/com/android/inputmethod/keyboard/LatinKeyboard.java4
-rw-r--r--java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java4
-rw-r--r--java/src/com/android/inputmethod/keyboard/PointerTracker.java55
-rw-r--r--java/src/com/android/inputmethod/keyboard/SlidingLocaleDrawable.java2
-rw-r--r--java/src/com/android/inputmethod/latin/AssetFileAddress.java52
-rw-r--r--java/src/com/android/inputmethod/latin/AutoCorrection.java10
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionary.java120
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java141
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java96
-rw-r--r--java/src/com/android/inputmethod/latin/CandidateView.java1
-rw-r--r--java/src/com/android/inputmethod/latin/Dictionary.java8
-rw-r--r--java/src/com/android/inputmethod/latin/DictionaryPackInstallBroadcastReceiver.java89
-rw-r--r--java/src/com/android/inputmethod/latin/EditingUtils.java82
-rw-r--r--java/src/com/android/inputmethod/latin/ExpandableDictionary.java31
-rw-r--r--java/src/com/android/inputmethod/latin/InputLanguageSelection.java4
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java344
-rw-r--r--java/src/com/android/inputmethod/latin/LatinImeLogger.java7
-rw-r--r--java/src/com/android/inputmethod/latin/PrivateBinaryDictionaryGetter.java28
-rw-r--r--java/src/com/android/inputmethod/latin/Settings.java52
-rw-r--r--java/src/com/android/inputmethod/latin/SubtypeSwitcher.java338
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java127
-rw-r--r--java/src/com/android/inputmethod/latin/TextEntryState.java18
-rw-r--r--java/src/com/android/inputmethod/latin/UserBigramDictionary.java6
-rw-r--r--java/src/com/android/inputmethod/latin/Utils.java143
284 files changed, 3555 insertions, 1437 deletions
diff --git a/java/proguard.flags b/java/proguard.flags
index 729f4ad61..914bd7595 100644
--- a/java/proguard.flags
+++ b/java/proguard.flags
@@ -18,3 +18,7 @@
-keep class com.android.inputmethod.latin.AutoCorrection {
java.lang.CharSequence getAutoCorrectionWord();
}
+
+-keep class com.android.inputmethod.latin.Utils {
+ boolean equalsIgnoreCase(...);
+}
diff --git a/java/res/anim/key_preview_fadein.xml b/java/res/anim/key_preview_fadein.xml
deleted file mode 100644
index 9fad7b9a7..000000000
--- a/java/res/anim/key_preview_fadein.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2010, 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.
-*/
--->
-
-<set
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@android:anim/decelerate_interpolator"
->
- <alpha
- android:fromAlpha="0.5"
- android:toAlpha="1.0"
- android:duration="@integer/config_preview_fadein_anim_time" />
-</set>
diff --git a/java/res/anim/key_preview_fadeout.xml b/java/res/anim/key_preview_fadeout.xml
deleted file mode 100644
index 7de5123cd..000000000
--- a/java/res/anim/key_preview_fadeout.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2010, 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.
-*/
--->
-
-<set
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@android:anim/accelerate_interpolator"
->
- <alpha
- android:fromAlpha="1.0"
- android:toAlpha="0.0"
- android:duration="@integer/config_preview_fadeout_anim_time" />
-</set>
diff --git a/java/res/anim/mini_keyboard_fadein.xml b/java/res/anim/mini_keyboard_fadein.xml
index 9fad7b9a7..f80e8b8de 100644
--- a/java/res/anim/mini_keyboard_fadein.xml
+++ b/java/res/anim/mini_keyboard_fadein.xml
@@ -25,5 +25,5 @@
<alpha
android:fromAlpha="0.5"
android:toAlpha="1.0"
- android:duration="@integer/config_preview_fadein_anim_time" />
+ android:duration="@integer/config_mini_keyboard_fadein_anim_time" />
</set>
diff --git a/java/res/anim/mini_keyboard_fadeout.xml b/java/res/anim/mini_keyboard_fadeout.xml
index 7de5123cd..535b100ae 100644
--- a/java/res/anim/mini_keyboard_fadeout.xml
+++ b/java/res/anim/mini_keyboard_fadeout.xml
@@ -25,5 +25,5 @@
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.0"
- android:duration="@integer/config_preview_fadeout_anim_time" />
+ android:duration="@integer/config_mini_keyboard_fadeout_anim_time" />
</set>
diff --git a/java/res/drawable-hdpi/btn_candidate_normal.9.png b/java/res/drawable-hdpi/btn_candidate_normal.9.png
deleted file mode 100644
index 7cab5a899..000000000
--- a/java/res/drawable-hdpi/btn_candidate_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal.9.png
index 50cc49fdb..01fc8ca78 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_off.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_off.9.png
index dabf77ec6..af4017e2c 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_off.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_off.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on.9.png
index 6e7d74c88..4c35aca95 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed.9.png
index ddb77c224..174f3452c 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off.9.png
index 1e9227e1c..1fcbd9a88 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on.9.png
index 7207b2ece..072753f37 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_fulltrans_normal.9.png b/java/res/drawable-hdpi/btn_keyboard_key_fulltrans_normal.9.png
index a524168c9..b6c234c04 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_fulltrans_normal.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_fulltrans_normal.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_fulltrans_pressed.9.png b/java/res/drawable-hdpi/btn_keyboard_key_fulltrans_pressed.9.png
index 4395e978a..73a8cd1c3 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_fulltrans_pressed.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_fulltrans_pressed.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_light_normal.9.png b/java/res/drawable-hdpi/btn_keyboard_key_light_normal.9.png
index 9d85c7b74..1ad746053 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_light_normal.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_light_normal.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_light_popup_normal.9.png b/java/res/drawable-hdpi/btn_keyboard_key_light_popup_normal.9.png
index 2ed1b3447..e3a77d61b 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_light_popup_normal.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_light_popup_normal.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_light_popup_selected.9.png b/java/res/drawable-hdpi/btn_keyboard_key_light_popup_selected.9.png
index 77e17dbae..431c44967 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_light_popup_selected.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_light_popup_selected.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_light_pressed.9.png b/java/res/drawable-hdpi/btn_keyboard_key_light_pressed.9.png
index a409639e7..ccd59d5fa 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_light_pressed.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_light_pressed.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_normal.9.png b/java/res/drawable-hdpi/btn_keyboard_key_normal.9.png
index 6ec7e6592..42c7c146d 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_normal.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_normal.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_normal_off.9.png b/java/res/drawable-hdpi/btn_keyboard_key_normal_off.9.png
index 995780cbf..01e2506b0 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_normal_off.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_normal_off.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_normal_off_stone.9.png b/java/res/drawable-hdpi/btn_keyboard_key_normal_off_stone.9.png
index 1388b6694..fad0ec458 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_normal_off_stone.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_normal_off_stone.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_normal_on.9.png b/java/res/drawable-hdpi/btn_keyboard_key_normal_on.9.png
index 7215782eb..83c6eb3fc 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_normal_on.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_normal_on.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_normal_on_stone.9.png b/java/res/drawable-hdpi/btn_keyboard_key_normal_on_stone.9.png
index 5a94cb6ac..215f8157c 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_normal_on_stone.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_normal_on_stone.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_normal_stone.9.png b/java/res/drawable-hdpi/btn_keyboard_key_normal_stone.9.png
index c6373a8af..88acdd748 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_normal_stone.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_normal_stone.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_pressed.9.png b/java/res/drawable-hdpi/btn_keyboard_key_pressed.9.png
index 0bd49a0e7..e047eaff1 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_pressed.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_pressed.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_pressed_off.9.png b/java/res/drawable-hdpi/btn_keyboard_key_pressed_off.9.png
index 634419f1b..218a2d29e 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_pressed_off.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_pressed_off.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/btn_keyboard_key_pressed_on.9.png b/java/res/drawable-hdpi/btn_keyboard_key_pressed_on.9.png
index 8474f9f42..afe49512e 100644
--- a/java/res/drawable-hdpi/btn_keyboard_key_pressed_on.9.png
+++ b/java/res/drawable-hdpi/btn_keyboard_key_pressed_on.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/cancel.png b/java/res/drawable-hdpi/cancel.png
index fdf01dba6..506cf99d0 100644
--- a/java/res/drawable-hdpi/cancel.png
+++ b/java/res/drawable-hdpi/cancel.png
Binary files differ
diff --git a/java/res/drawable-hdpi/candidate_feedback_background.9.png b/java/res/drawable-hdpi/candidate_feedback_background.9.png
index 16499002e..203c4e640 100644
--- a/java/res/drawable-hdpi/candidate_feedback_background.9.png
+++ b/java/res/drawable-hdpi/candidate_feedback_background.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/caution.png b/java/res/drawable-hdpi/caution.png
index caed9419d..5cb6c54b9 100644
--- a/java/res/drawable-hdpi/caution.png
+++ b/java/res/drawable-hdpi/caution.png
Binary files differ
diff --git a/java/res/drawable-hdpi/dialog_bubble_step02.9.png b/java/res/drawable-hdpi/dialog_bubble_step02.9.png
index 2a3ac18c0..b338364c5 100644
--- a/java/res/drawable-hdpi/dialog_bubble_step02.9.png
+++ b/java/res/drawable-hdpi/dialog_bubble_step02.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/dialog_bubble_step07.9.png b/java/res/drawable-hdpi/dialog_bubble_step07.9.png
index 0a5046b07..94b915432 100644
--- a/java/res/drawable-hdpi/dialog_bubble_step07.9.png
+++ b/java/res/drawable-hdpi/dialog_bubble_step07.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/highlight_pressed.png b/java/res/drawable-hdpi/highlight_pressed.png
deleted file mode 100644
index 638df19bc..000000000
--- a/java/res/drawable-hdpi/highlight_pressed.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-hdpi/hint_popup.9.png b/java/res/drawable-hdpi/hint_popup.9.png
index 5b2ad5388..b5ec003e6 100644
--- a/java/res/drawable-hdpi/hint_popup.9.png
+++ b/java/res/drawable-hdpi/hint_popup.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/ic_dialog_keyboard.png b/java/res/drawable-hdpi/ic_dialog_keyboard.png
index fb6d89879..c7729566c 100644
--- a/java/res/drawable-hdpi/ic_dialog_keyboard.png
+++ b/java/res/drawable-hdpi/ic_dialog_keyboard.png
Binary files differ
diff --git a/java/res/drawable-hdpi/ic_mic_dialog.png b/java/res/drawable-hdpi/ic_mic_dialog.png
index 6498cd589..349dc4b37 100644
--- a/java/res/drawable-hdpi/ic_mic_dialog.png
+++ b/java/res/drawable-hdpi/ic_mic_dialog.png
Binary files differ
diff --git a/java/res/drawable-hdpi/ic_subtype_keyboard.png b/java/res/drawable-hdpi/ic_subtype_keyboard.png
index b5a9fa866..7015e266a 100644
--- a/java/res/drawable-hdpi/ic_subtype_keyboard.png
+++ b/java/res/drawable-hdpi/ic_subtype_keyboard.png
Binary files differ
diff --git a/java/res/drawable-hdpi/ic_subtype_mic.png b/java/res/drawable-hdpi/ic_subtype_mic.png
index 5d68e85a6..cb86a5598 100644
--- a/java/res/drawable-hdpi/ic_subtype_mic.png
+++ b/java/res/drawable-hdpi/ic_subtype_mic.png
Binary files differ
diff --git a/java/res/drawable-hdpi/ic_suggest_strip_microphone.png b/java/res/drawable-hdpi/ic_suggest_strip_microphone.png
index 0462bdd16..c00b4aaa6 100644
--- a/java/res/drawable-hdpi/ic_suggest_strip_microphone.png
+++ b/java/res/drawable-hdpi/ic_suggest_strip_microphone.png
Binary files differ
diff --git a/java/res/drawable-hdpi/ic_suggest_strip_microphone_swipe.png b/java/res/drawable-hdpi/ic_suggest_strip_microphone_swipe.png
index 80c20f691..256dc3d61 100644
--- a/java/res/drawable-hdpi/ic_suggest_strip_microphone_swipe.png
+++ b/java/res/drawable-hdpi/ic_suggest_strip_microphone_swipe.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_background.9.png b/java/res/drawable-hdpi/keyboard_background.9.png
index d57463fb6..edffac5b8 100644
--- a/java/res/drawable-hdpi/keyboard_background.9.png
+++ b/java/res/drawable-hdpi/keyboard_background.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_dark_background.9.png b/java/res/drawable-hdpi/keyboard_dark_background.9.png
index fa3d449f7..f315cbdd4 100644
--- a/java/res/drawable-hdpi/keyboard_dark_background.9.png
+++ b/java/res/drawable-hdpi/keyboard_dark_background.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_hint_0.9.png b/java/res/drawable-hdpi/keyboard_hint_0.9.png
index da52e0f5b..271264e92 100644
--- a/java/res/drawable-hdpi/keyboard_hint_0.9.png
+++ b/java/res/drawable-hdpi/keyboard_hint_0.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_hint_1.9.png b/java/res/drawable-hdpi/keyboard_hint_1.9.png
index 7325c4cbb..eaf374262 100644
--- a/java/res/drawable-hdpi/keyboard_hint_1.9.png
+++ b/java/res/drawable-hdpi/keyboard_hint_1.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_hint_2.9.png b/java/res/drawable-hdpi/keyboard_hint_2.9.png
index 35b7f2527..8a1657117 100644
--- a/java/res/drawable-hdpi/keyboard_hint_2.9.png
+++ b/java/res/drawable-hdpi/keyboard_hint_2.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_hint_3.9.png b/java/res/drawable-hdpi/keyboard_hint_3.9.png
index 1ae284838..34b501109 100644
--- a/java/res/drawable-hdpi/keyboard_hint_3.9.png
+++ b/java/res/drawable-hdpi/keyboard_hint_3.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_hint_4.9.png b/java/res/drawable-hdpi/keyboard_hint_4.9.png
index b67d6dd51..d4cc250dd 100644
--- a/java/res/drawable-hdpi/keyboard_hint_4.9.png
+++ b/java/res/drawable-hdpi/keyboard_hint_4.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_hint_5.9.png b/java/res/drawable-hdpi/keyboard_hint_5.9.png
index ec52198d8..6a054b42f 100644
--- a/java/res/drawable-hdpi/keyboard_hint_5.9.png
+++ b/java/res/drawable-hdpi/keyboard_hint_5.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_hint_6.9.png b/java/res/drawable-hdpi/keyboard_hint_6.9.png
index 66dcf67e5..66e91400a 100644
--- a/java/res/drawable-hdpi/keyboard_hint_6.9.png
+++ b/java/res/drawable-hdpi/keyboard_hint_6.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_hint_7.9.png b/java/res/drawable-hdpi/keyboard_hint_7.9.png
index 9d5499272..5eae24f4f 100644
--- a/java/res/drawable-hdpi/keyboard_hint_7.9.png
+++ b/java/res/drawable-hdpi/keyboard_hint_7.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_hint_8.9.png b/java/res/drawable-hdpi/keyboard_hint_8.9.png
index beba1624c..ea7f512fd 100644
--- a/java/res/drawable-hdpi/keyboard_hint_8.9.png
+++ b/java/res/drawable-hdpi/keyboard_hint_8.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_hint_9.9.png b/java/res/drawable-hdpi/keyboard_hint_9.9.png
index 31ea54f32..0bf85de93 100644
--- a/java/res/drawable-hdpi/keyboard_hint_9.9.png
+++ b/java/res/drawable-hdpi/keyboard_hint_9.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_background.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_background.9.png
index 27d992375..762a25704 100644
--- a/java/res/drawable-hdpi/keyboard_key_feedback_background.9.png
+++ b/java/res/drawable-hdpi/keyboard_key_feedback_background.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_background_holo.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_background_holo.9.png
index 943f9e4bc..8d6acacfb 100644
--- a/java/res/drawable-hdpi/keyboard_key_feedback_background_holo.9.png
+++ b/java/res/drawable-hdpi/keyboard_key_feedback_background_holo.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_more_background.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_more_background.9.png
index 33263b9d7..141d2d6be 100644
--- a/java/res/drawable-hdpi/keyboard_key_feedback_more_background.9.png
+++ b/java/res/drawable-hdpi/keyboard_key_feedback_more_background.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_popup_panel_background.9.png b/java/res/drawable-hdpi/keyboard_popup_panel_background.9.png
index baff80950..d6b2c7936 100644
--- a/java/res/drawable-hdpi/keyboard_popup_panel_background.9.png
+++ b/java/res/drawable-hdpi/keyboard_popup_panel_background.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_suggest_strip.9.png b/java/res/drawable-hdpi/keyboard_suggest_strip.9.png
index 7cab5a899..0ccdb6ab2 100644
--- a/java/res/drawable-hdpi/keyboard_suggest_strip.9.png
+++ b/java/res/drawable-hdpi/keyboard_suggest_strip.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_suggest_strip_divider.png b/java/res/drawable-hdpi/keyboard_suggest_strip_divider.png
index 7fca8c608..7ca3e6131 100644
--- a/java/res/drawable-hdpi/keyboard_suggest_strip_divider.png
+++ b/java/res/drawable-hdpi/keyboard_suggest_strip_divider.png
Binary files differ
diff --git a/java/res/drawable-hdpi/mic_slash.png b/java/res/drawable-hdpi/mic_slash.png
index 71f4dc506..dc8da6252 100644
--- a/java/res/drawable-hdpi/mic_slash.png
+++ b/java/res/drawable-hdpi/mic_slash.png
Binary files differ
diff --git a/java/res/drawable-hdpi/ok_cancel.png b/java/res/drawable-hdpi/ok_cancel.png
index 48c00f094..f11e57a38 100644
--- a/java/res/drawable-hdpi/ok_cancel.png
+++ b/java/res/drawable-hdpi/ok_cancel.png
Binary files differ
diff --git a/java/res/drawable-hdpi/speak_now_level0.png b/java/res/drawable-hdpi/speak_now_level0.png
index 31571f75b..342849cfe 100644
--- a/java/res/drawable-hdpi/speak_now_level0.png
+++ b/java/res/drawable-hdpi/speak_now_level0.png
Binary files differ
diff --git a/java/res/drawable-hdpi/speak_now_level1.png b/java/res/drawable-hdpi/speak_now_level1.png
index c8d0aae5d..8947a4306 100644
--- a/java/res/drawable-hdpi/speak_now_level1.png
+++ b/java/res/drawable-hdpi/speak_now_level1.png
Binary files differ
diff --git a/java/res/drawable-hdpi/speak_now_level2.png b/java/res/drawable-hdpi/speak_now_level2.png
index 123eea66e..44fc58c4e 100644
--- a/java/res/drawable-hdpi/speak_now_level2.png
+++ b/java/res/drawable-hdpi/speak_now_level2.png
Binary files differ
diff --git a/java/res/drawable-hdpi/speak_now_level3.png b/java/res/drawable-hdpi/speak_now_level3.png
index a8a2c5cff..cfa5c1b87 100644
--- a/java/res/drawable-hdpi/speak_now_level3.png
+++ b/java/res/drawable-hdpi/speak_now_level3.png
Binary files differ
diff --git a/java/res/drawable-hdpi/speak_now_level4.png b/java/res/drawable-hdpi/speak_now_level4.png
index b84d7b0e9..a050d8836 100644
--- a/java/res/drawable-hdpi/speak_now_level4.png
+++ b/java/res/drawable-hdpi/speak_now_level4.png
Binary files differ
diff --git a/java/res/drawable-hdpi/speak_now_level5.png b/java/res/drawable-hdpi/speak_now_level5.png
index 8dd2b607f..8cd5ae7ad 100644
--- a/java/res/drawable-hdpi/speak_now_level5.png
+++ b/java/res/drawable-hdpi/speak_now_level5.png
Binary files differ
diff --git a/java/res/drawable-hdpi/speak_now_level6.png b/java/res/drawable-hdpi/speak_now_level6.png
index 888d0e5c7..9f4481eb4 100644
--- a/java/res/drawable-hdpi/speak_now_level6.png
+++ b/java/res/drawable-hdpi/speak_now_level6.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_123_mic.png b/java/res/drawable-hdpi/sym_bkeyboard_123_mic.png
index 24edfaa1c..3e4eff698 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_123_mic.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_123_mic.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_delete.png b/java/res/drawable-hdpi/sym_bkeyboard_delete.png
index 4ccd218ac..1d24cc85c 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_delete.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_delete.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_done.png b/java/res/drawable-hdpi/sym_bkeyboard_done.png
index 6959aeeef..b77803d21 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_done.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_done.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_mic.png b/java/res/drawable-hdpi/sym_bkeyboard_mic.png
index 6876fb64a..512f46080 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_mic.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_mic.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num0.png b/java/res/drawable-hdpi/sym_bkeyboard_num0.png
index 08df3f3dd..678a790de 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_num0.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_num0.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num1.png b/java/res/drawable-hdpi/sym_bkeyboard_num1.png
index 36d8e5696..4e68e35b3 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_num1.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_num1.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num2.png b/java/res/drawable-hdpi/sym_bkeyboard_num2.png
index c67fe2ea4..546663fda 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_num2.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_num2.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num3.png b/java/res/drawable-hdpi/sym_bkeyboard_num3.png
index cf80b2745..57f9a8d8e 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_num3.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_num3.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num4.png b/java/res/drawable-hdpi/sym_bkeyboard_num4.png
index bfbb55a8f..de504388f 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_num4.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_num4.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num5.png b/java/res/drawable-hdpi/sym_bkeyboard_num5.png
index 9f121ec12..1d2e1ef89 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_num5.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_num5.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num6.png b/java/res/drawable-hdpi/sym_bkeyboard_num6.png
index 256186f3a..39788b727 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_num6.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_num6.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num7.png b/java/res/drawable-hdpi/sym_bkeyboard_num7.png
index 7c8ce205e..fff6f27bf 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_num7.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_num7.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num8.png b/java/res/drawable-hdpi/sym_bkeyboard_num8.png
index 4cfe7b11c..8cc1a955e 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_num8.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_num8.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num9.png b/java/res/drawable-hdpi/sym_bkeyboard_num9.png
index d19c15cc8..021742509 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_num9.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_num9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_numalt.png b/java/res/drawable-hdpi/sym_bkeyboard_numalt.png
index 762fd8cd7..200714f66 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_numalt.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_numalt.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_numpound.png b/java/res/drawable-hdpi/sym_bkeyboard_numpound.png
index 2bd800d68..0a46122b2 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_numpound.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_numpound.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_numstar.png b/java/res/drawable-hdpi/sym_bkeyboard_numstar.png
index b574f83f3..ca22bd535 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_numstar.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_numstar.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_return.png b/java/res/drawable-hdpi/sym_bkeyboard_return.png
index 2f9631a20..426e1599e 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_return.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_return.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_search.png b/java/res/drawable-hdpi/sym_bkeyboard_search.png
index 7a5a0aab8..1b6f884fa 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_search.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_search.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_settings.png b/java/res/drawable-hdpi/sym_bkeyboard_settings.png
index 8a8caa895..08ba18f28 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_settings.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_settings.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_shift.png b/java/res/drawable-hdpi/sym_bkeyboard_shift.png
index 1e3d5ec14..5a22dd309 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_shift.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_shift.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_shift_locked.png b/java/res/drawable-hdpi/sym_bkeyboard_shift_locked.png
index e8a4d6423..566449126 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_shift_locked.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_shift_locked.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_space.png b/java/res/drawable-hdpi/sym_bkeyboard_space.png
index 9937a6288..cd0ebe2f4 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_space.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_space.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_bkeyboard_tab.png b/java/res/drawable-hdpi/sym_bkeyboard_tab.png
index 8dee747d2..3466e1271 100644
--- a/java/res/drawable-hdpi/sym_bkeyboard_tab.png
+++ b/java/res/drawable-hdpi/sym_bkeyboard_tab.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_123_mic.png b/java/res/drawable-hdpi/sym_keyboard_123_mic.png
index 6f8292912..62669803d 100644
--- a/java/res/drawable-hdpi/sym_keyboard_123_mic.png
+++ b/java/res/drawable-hdpi/sym_keyboard_123_mic.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_delete.png b/java/res/drawable-hdpi/sym_keyboard_delete.png
index 8db099a7a..459ebcff8 100644
--- a/java/res/drawable-hdpi/sym_keyboard_delete.png
+++ b/java/res/drawable-hdpi/sym_keyboard_delete.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_done.png b/java/res/drawable-hdpi/sym_keyboard_done.png
index 6ba51d58c..471c5021b 100644
--- a/java/res/drawable-hdpi/sym_keyboard_done.png
+++ b/java/res/drawable-hdpi/sym_keyboard_done.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_123_mic.png b/java/res/drawable-hdpi/sym_keyboard_feedback_123_mic.png
index 4867298fa..eef789680 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_123_mic.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_123_mic.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_delete.png b/java/res/drawable-hdpi/sym_keyboard_feedback_delete.png
index 7c12f79a1..8322e8e1d 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_delete.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_delete.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_done.png b/java/res/drawable-hdpi/sym_keyboard_feedback_done.png
index e79bbb382..7015e266a 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_done.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_done.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_language_arrows_left.png b/java/res/drawable-hdpi/sym_keyboard_feedback_language_arrows_left.png
index 4f4923b85..889477cfb 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_language_arrows_left.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_language_arrows_left.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_language_arrows_right.png b/java/res/drawable-hdpi/sym_keyboard_feedback_language_arrows_right.png
index ed2ebe66c..b0f6d7feb 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_language_arrows_right.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_language_arrows_right.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_mic.png b/java/res/drawable-hdpi/sym_keyboard_feedback_mic.png
index f228910c3..f82c33ae3 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_mic.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_mic.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_numalt.png b/java/res/drawable-hdpi/sym_keyboard_feedback_numalt.png
index bb69300d1..819236c8e 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_numalt.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_numalt.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_return.png b/java/res/drawable-hdpi/sym_keyboard_feedback_return.png
index 99fa13cae..f038d3abe 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_return.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_return.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_search.png b/java/res/drawable-hdpi/sym_keyboard_feedback_search.png
index c006866d2..337f9e4fe 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_search.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_search.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_settings.png b/java/res/drawable-hdpi/sym_keyboard_feedback_settings.png
index 5c685f9c3..8a02be07e 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_settings.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_settings.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_shift.png b/java/res/drawable-hdpi/sym_keyboard_feedback_shift.png
index 5b91afb82..abf15f8f9 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_shift.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_shift.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.png b/java/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.png
index 77e6a5fe9..1fd822ea6 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_space.png b/java/res/drawable-hdpi/sym_keyboard_feedback_space.png
index 2d1b4a4b4..70debca9b 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_space.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_space.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_tab.png b/java/res/drawable-hdpi/sym_keyboard_feedback_tab.png
index 82280c608..d2efb1619 100644
--- a/java/res/drawable-hdpi/sym_keyboard_feedback_tab.png
+++ b/java/res/drawable-hdpi/sym_keyboard_feedback_tab.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_language_arrows_left.png b/java/res/drawable-hdpi/sym_keyboard_language_arrows_left.png
index 34b8e931a..dcc4bd59b 100644
--- a/java/res/drawable-hdpi/sym_keyboard_language_arrows_left.png
+++ b/java/res/drawable-hdpi/sym_keyboard_language_arrows_left.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_language_arrows_right.png b/java/res/drawable-hdpi/sym_keyboard_language_arrows_right.png
index b6ea3362b..ecf61a98e 100644
--- a/java/res/drawable-hdpi/sym_keyboard_language_arrows_right.png
+++ b/java/res/drawable-hdpi/sym_keyboard_language_arrows_right.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_mic.png b/java/res/drawable-hdpi/sym_keyboard_mic.png
index 7207f8a92..c8dca62a0 100644
--- a/java/res/drawable-hdpi/sym_keyboard_mic.png
+++ b/java/res/drawable-hdpi/sym_keyboard_mic.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_num0.png b/java/res/drawable-hdpi/sym_keyboard_num0.png
index 169efe21e..10ac70b9d 100644
--- a/java/res/drawable-hdpi/sym_keyboard_num0.png
+++ b/java/res/drawable-hdpi/sym_keyboard_num0.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_num1.png b/java/res/drawable-hdpi/sym_keyboard_num1.png
index 5b868489f..0fc03efa5 100644
--- a/java/res/drawable-hdpi/sym_keyboard_num1.png
+++ b/java/res/drawable-hdpi/sym_keyboard_num1.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_num2.png b/java/res/drawable-hdpi/sym_keyboard_num2.png
index ddbe2199c..283560b35 100644
--- a/java/res/drawable-hdpi/sym_keyboard_num2.png
+++ b/java/res/drawable-hdpi/sym_keyboard_num2.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_num3.png b/java/res/drawable-hdpi/sym_keyboard_num3.png
index 1de90f3b1..9a3b3294b 100644
--- a/java/res/drawable-hdpi/sym_keyboard_num3.png
+++ b/java/res/drawable-hdpi/sym_keyboard_num3.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_num4.png b/java/res/drawable-hdpi/sym_keyboard_num4.png
index c67ba5206..f13ff1ae9 100644
--- a/java/res/drawable-hdpi/sym_keyboard_num4.png
+++ b/java/res/drawable-hdpi/sym_keyboard_num4.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_num5.png b/java/res/drawable-hdpi/sym_keyboard_num5.png
index 8410f2537..c251329fa 100644
--- a/java/res/drawable-hdpi/sym_keyboard_num5.png
+++ b/java/res/drawable-hdpi/sym_keyboard_num5.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_num6.png b/java/res/drawable-hdpi/sym_keyboard_num6.png
index 22fa29d3f..4acba4c91 100644
--- a/java/res/drawable-hdpi/sym_keyboard_num6.png
+++ b/java/res/drawable-hdpi/sym_keyboard_num6.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_num7.png b/java/res/drawable-hdpi/sym_keyboard_num7.png
index a3798ea34..14931c18c 100644
--- a/java/res/drawable-hdpi/sym_keyboard_num7.png
+++ b/java/res/drawable-hdpi/sym_keyboard_num7.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_num8.png b/java/res/drawable-hdpi/sym_keyboard_num8.png
index 7e963ad6b..d4973fdc9 100644
--- a/java/res/drawable-hdpi/sym_keyboard_num8.png
+++ b/java/res/drawable-hdpi/sym_keyboard_num8.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_num9.png b/java/res/drawable-hdpi/sym_keyboard_num9.png
index 1160d8545..49cec66f4 100644
--- a/java/res/drawable-hdpi/sym_keyboard_num9.png
+++ b/java/res/drawable-hdpi/sym_keyboard_num9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_numalt.png b/java/res/drawable-hdpi/sym_keyboard_numalt.png
index f3a73deb0..3cc5311cd 100644
--- a/java/res/drawable-hdpi/sym_keyboard_numalt.png
+++ b/java/res/drawable-hdpi/sym_keyboard_numalt.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_numpound.png b/java/res/drawable-hdpi/sym_keyboard_numpound.png
index 471f4fda3..d09133929 100644
--- a/java/res/drawable-hdpi/sym_keyboard_numpound.png
+++ b/java/res/drawable-hdpi/sym_keyboard_numpound.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_numstar.png b/java/res/drawable-hdpi/sym_keyboard_numstar.png
index 017c0f461..e838e169f 100644
--- a/java/res/drawable-hdpi/sym_keyboard_numstar.png
+++ b/java/res/drawable-hdpi/sym_keyboard_numstar.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_return.png b/java/res/drawable-hdpi/sym_keyboard_return.png
index 984db426e..9d97e1efd 100644
--- a/java/res/drawable-hdpi/sym_keyboard_return.png
+++ b/java/res/drawable-hdpi/sym_keyboard_return.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_search.png b/java/res/drawable-hdpi/sym_keyboard_search.png
index 179e725f6..1aa22d7e2 100644
--- a/java/res/drawable-hdpi/sym_keyboard_search.png
+++ b/java/res/drawable-hdpi/sym_keyboard_search.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_settings.png b/java/res/drawable-hdpi/sym_keyboard_settings.png
index 164117812..35d1ed6e6 100644
--- a/java/res/drawable-hdpi/sym_keyboard_settings.png
+++ b/java/res/drawable-hdpi/sym_keyboard_settings.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_shift.png b/java/res/drawable-hdpi/sym_keyboard_shift.png
index 2b3bd668d..bf217d147 100644
--- a/java/res/drawable-hdpi/sym_keyboard_shift.png
+++ b/java/res/drawable-hdpi/sym_keyboard_shift.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_shift_locked.png b/java/res/drawable-hdpi/sym_keyboard_shift_locked.png
index 8a34a98a3..d11b39712 100644
--- a/java/res/drawable-hdpi/sym_keyboard_shift_locked.png
+++ b/java/res/drawable-hdpi/sym_keyboard_shift_locked.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_space.png b/java/res/drawable-hdpi/sym_keyboard_space.png
index dacc97d0a..fcd20de7d 100644
--- a/java/res/drawable-hdpi/sym_keyboard_space.png
+++ b/java/res/drawable-hdpi/sym_keyboard_space.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_space_led.9.png b/java/res/drawable-hdpi/sym_keyboard_space_led.9.png
index c76f64b94..2c6f4a925 100644
--- a/java/res/drawable-hdpi/sym_keyboard_space_led.9.png
+++ b/java/res/drawable-hdpi/sym_keyboard_space_led.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_tab.png b/java/res/drawable-hdpi/sym_keyboard_tab.png
index efd740b5b..51d17d989 100644
--- a/java/res/drawable-hdpi/sym_keyboard_tab.png
+++ b/java/res/drawable-hdpi/sym_keyboard_tab.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_voice_off_holo.png b/java/res/drawable-hdpi/sym_keyboard_voice_off_holo.png
index 8a445eb56..6e6279a8a 100644
--- a/java/res/drawable-hdpi/sym_keyboard_voice_off_holo.png
+++ b/java/res/drawable-hdpi/sym_keyboard_voice_off_holo.png
Binary files differ
diff --git a/java/res/drawable-hdpi/voice_ime_background.9.png b/java/res/drawable-hdpi/voice_ime_background.9.png
index a604f497c..42868522f 100644
--- a/java/res/drawable-hdpi/voice_ime_background.9.png
+++ b/java/res/drawable-hdpi/voice_ime_background.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/voice_swipe_hint.png b/java/res/drawable-hdpi/voice_swipe_hint.png
index 976fd56d6..130f83a9c 100644
--- a/java/res/drawable-hdpi/voice_swipe_hint.png
+++ b/java/res/drawable-hdpi/voice_swipe_hint.png
Binary files differ
diff --git a/java/res/drawable-hdpi/working.png b/java/res/drawable-hdpi/working.png
index c43439e93..5ea702307 100644..100755
--- a/java/res/drawable-hdpi/working.png
+++ b/java/res/drawable-hdpi/working.png
Binary files differ
diff --git a/java/res/drawable-mdpi/btn_candidate_normal.9.png b/java/res/drawable-mdpi/btn_candidate_normal.9.png
deleted file mode 100644
index fa6c0feff..000000000
--- a/java/res/drawable-mdpi/btn_candidate_normal.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-mdpi/highlight_pressed.png b/java/res/drawable-mdpi/highlight_pressed.png
deleted file mode 100644
index d27f1061a..000000000
--- a/java/res/drawable-mdpi/highlight_pressed.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_background_holo.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_background_holo.9.png
index a7acb4a4d..286cf84fc 100644
--- a/java/res/drawable-mdpi/keyboard_key_feedback_background_holo.9.png
+++ b/java/res/drawable-mdpi/keyboard_key_feedback_background_holo.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/sym_keyboard_voice_off_holo.png b/java/res/drawable-mdpi/sym_keyboard_voice_off_holo.png
index 081a13096..44919dfcc 100644
--- a/java/res/drawable-mdpi/sym_keyboard_voice_off_holo.png
+++ b/java/res/drawable-mdpi/sym_keyboard_voice_off_holo.png
Binary files differ
diff --git a/java/res/drawable-mdpi/top_suggest_line_holo.9.png b/java/res/drawable-mdpi/top_suggest_line_holo.9.png
deleted file mode 100644
index 8fdffd317..000000000
--- a/java/res/drawable-mdpi/top_suggest_line_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable/btn_candidate.xml b/java/res/drawable/btn_candidate.xml
index b0c1c3038..efcee9f54 100644
--- a/java/res/drawable/btn_candidate.xml
+++ b/java/res/drawable/btn_candidate.xml
@@ -24,6 +24,4 @@
<item
android:state_pressed="true"
android:drawable="@drawable/btn_candidate_pressed" />
- <item
- android:drawable="@drawable/btn_candidate_normal" />
</selector>
diff --git a/java/res/drawable/ic_suggest_scroll_background.xml b/java/res/drawable/ic_suggest_scroll_background.xml
deleted file mode 100644
index 9d246e40e..000000000
--- a/java/res/drawable/ic_suggest_scroll_background.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-
- <item android:state_pressed="false"
- android:drawable="@android:color/transparent" />
-
- <item android:state_pressed="true"
- android:drawable="@drawable/highlight_pressed" />
-
-</selector> \ No newline at end of file
diff --git a/java/res/drawable/keyboard_key_feedback_honeycomb.xml b/java/res/drawable/keyboard_key_feedback_honeycomb.xml
index dd9b53e46..a3ea140cd 100644
--- a/java/res/drawable/keyboard_key_feedback_honeycomb.xml
+++ b/java/res/drawable/keyboard_key_feedback_honeycomb.xml
@@ -16,6 +16,6 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_long_pressable="true"
- android:drawable="@drawable/keyboard_key_feedback_more_background" />
+ android:drawable="@drawable/keyboard_key_feedback_more_background_holo" />
<item android:drawable="@drawable/keyboard_key_feedback_background_holo" />
</selector>
diff --git a/java/res/layout-xlarge/candidate.xml b/java/res/layout-xlarge/candidate.xml
index 74532a1e2..6d3e4ab17 100644
--- a/java/res/layout-xlarge/candidate.xml
+++ b/java/res/layout-xlarge/candidate.xml
@@ -20,24 +20,24 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="@dimen/candidate_strip_height"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingRight="@dimen/candidate_padding"
>
<ImageView
android:id="@+id/candidate_divider"
android:layout_width="wrap_content"
- android:layout_height="@dimen/candidate_strip_height"
+ android:layout_height="match_parent"
+ android:src="@drawable/keyboard_suggest_strip_divider"
android:visibility="gone"
android:focusable="false"
android:clickable="false"
- android:src="@drawable/keyboard_suggest_strip_divider"
android:gravity="center_vertical|center_horizontal" />
<Button
android:id="@+id/candidate_word"
android:layout_width="wrap_content"
- android:layout_height="@dimen/candidate_strip_height"
+ android:layout_height="match_parent"
android:minWidth="@dimen/candidate_min_width"
android:textSize="@dimen/candidate_text_size"
android:textColor="@color/candidate_normal"
@@ -49,12 +49,11 @@
<TextView
android:id="@+id/candidate_debug_info"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:visibility="gone"
android:textSize="10dip"
android:textColor="#ff808080"
android:focusable="false"
android:clickable="false"
- android:gravity="bottom"
- android:paddingLeft="4dip" />
+ android:gravity="bottom" />
</LinearLayout>
diff --git a/java/res/layout-xlarge/candidates.xml b/java/res/layout-xlarge/candidates.xml
index e2ddb84b1..096a0adf1 100644
--- a/java/res/layout-xlarge/candidates.xml
+++ b/java/res/layout-xlarge/candidates.xml
@@ -21,25 +21,34 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
+ android:gravity="bottom"
android:layout_width="match_parent"
- android:layout_height="@dimen/candidate_strip_height"
- android:background="@drawable/keyboard_suggest_strip_holo"
- android:paddingRight="@dimen/candidate_strip_padding"
- android:paddingLeft="@dimen/candidate_strip_padding"
+ android:layout_height="wrap_content"
+ android:minHeight="@dimen/candidate_strip_minimum_height"
>
- <HorizontalScrollView
- android:id="@+id/candidates_scroll_view"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/candidate_strip_height"
- android:fadingEdge="horizontal"
- android:fadingEdgeLength="@dimen/candidate_strip_fading_edge_length"
- android:scrollbars="none"
+ <!-- On tablets, the candidate strip is centered with horizontal paddings on both sides because
+ width of the landscape mode is too long for the candidate strip. This LinearLayout is
+ required to hold the paddings. -->
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/keyboard_suggest_strip_holo"
+ android:paddingRight="@dimen/candidate_strip_padding"
+ android:paddingLeft="@dimen/candidate_strip_padding"
>
- <com.android.inputmethod.latin.CandidateView
- android:id="@+id/candidates"
- android:orientation="horizontal"
+ <HorizontalScrollView
android:layout_width="match_parent"
- android:layout_height="@dimen/candidate_strip_height"
- android:background="@drawable/keyboard_suggest_strip_holo" />
- </HorizontalScrollView>
+ android:layout_height="wrap_content"
+ android:fadingEdge="horizontal"
+ android:fadingEdgeLength="@dimen/candidate_strip_fading_edge_length"
+ android:scrollbars="none"
+ >
+ <com.android.inputmethod.latin.CandidateView
+ android:id="@+id/candidates"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/candidate_strip_height"
+ android:gravity="center_vertical" />
+ </HorizontalScrollView>
+ </LinearLayout>
</LinearLayout>
diff --git a/java/res/layout-xlarge/keyboard_popup_honeycomb.xml b/java/res/layout-xlarge/keyboard_popup_honeycomb.xml
deleted file mode 100644
index 0b8229ca5..000000000
--- a/java/res/layout-xlarge/keyboard_popup_honeycomb.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2010, 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.
-*/
--->
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:background="@drawable/keyboard_popup_panel_background_holo"
- android:paddingLeft="40dip"
- android:paddingRight="40dip"
- >
- <com.android.inputmethod.keyboard.KeyboardView
- xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
- android:id="@+id/KeyboardView"
- android:layout_alignParentBottom="true"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/latinkeyboard_transparent"
-
- latin:keyBackground="@drawable/btn_keyboard_key_honeycomb_popup"
- latin:keyHysteresisDistance="0dip"
- latin:verticalCorrection="@dimen/mini_keyboard_vertical_correction"
- />
-</LinearLayout>
diff --git a/java/res/layout/candidate.xml b/java/res/layout/candidate.xml
index f2c4126b3..78d2750eb 100644
--- a/java/res/layout/candidate.xml
+++ b/java/res/layout/candidate.xml
@@ -20,24 +20,24 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="@dimen/candidate_strip_height"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingRight="@dimen/candidate_padding"
>
<ImageView
android:id="@+id/candidate_divider"
android:layout_width="wrap_content"
- android:layout_height="@dimen/candidate_strip_height"
+ android:layout_height="match_parent"
+ android:src="@drawable/keyboard_suggest_strip_divider"
android:visibility="gone"
android:focusable="false"
android:clickable="false"
- android:src="@drawable/keyboard_suggest_strip_divider"
android:gravity="center_vertical|center_horizontal" />
<Button
android:id="@+id/candidate_word"
android:layout_width="wrap_content"
- android:layout_height="@dimen/candidate_strip_height"
+ android:layout_height="match_parent"
android:minWidth="@dimen/candidate_min_width"
android:textSize="@dimen/candidate_text_size"
android:textColor="@color/candidate_normal"
@@ -49,12 +49,11 @@
<TextView
android:id="@+id/candidate_debug_info"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:visibility="gone"
android:textSize="10dip"
android:textColor="#ff808080"
android:focusable="false"
android:clickable="false"
- android:gravity="bottom"
- android:paddingLeft="4dip" />
+ android:gravity="bottom" />
</LinearLayout>
diff --git a/java/res/layout/candidates.xml b/java/res/layout/candidates.xml
index 1b8d04183..3d91c1d20 100644
--- a/java/res/layout/candidates.xml
+++ b/java/res/layout/candidates.xml
@@ -21,25 +21,25 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
+ android:gravity="bottom"
android:layout_width="match_parent"
- android:layout_height="@dimen/candidate_strip_height"
- android:background="@drawable/keyboard_suggest_strip"
+ android:layout_height="wrap_content"
+ android:minHeight="@dimen/candidate_strip_minimum_height"
android:paddingRight="@dimen/candidate_strip_padding"
android:paddingLeft="@dimen/candidate_strip_padding"
>
<HorizontalScrollView
- android:id="@+id/candidates_scroll_view"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/candidate_strip_height"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/keyboard_suggest_strip"
android:fadingEdge="horizontal"
android:fadingEdgeLength="@dimen/candidate_strip_fading_edge_length"
android:scrollbars="none"
>
<com.android.inputmethod.latin.CandidateView
android:id="@+id/candidates"
- android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="@dimen/candidate_strip_height"
- android:background="@drawable/keyboard_suggest_strip" />
+ android:gravity="center_vertical" />
</HorizontalScrollView>
</LinearLayout>
diff --git a/java/res/layout/input_basic.xml b/java/res/layout/input_basic.xml
index 7b85bae94..86ae82d51 100644
--- a/java/res/layout/input_basic.xml
+++ b/java/res/layout/input_basic.xml
@@ -25,6 +25,7 @@
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:padding="0dip"
android:background="@drawable/keyboard_background"
latin:keyBackground="@drawable/btn_keyboard_key"
diff --git a/java/res/layout/input_basic_highcontrast.xml b/java/res/layout/input_basic_highcontrast.xml
index d9200fd5e..03b22ef07 100644
--- a/java/res/layout/input_basic_highcontrast.xml
+++ b/java/res/layout/input_basic_highcontrast.xml
@@ -21,11 +21,11 @@
<com.android.inputmethod.keyboard.LatinKeyboardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-
android:id="@+id/LatinkeyboardBaseView"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:padding="0dip"
android:background="@android:color/black"
latin:keyBackground="@drawable/btn_keyboard_key3"
diff --git a/java/res/layout/input_gingerbread.xml b/java/res/layout/input_gingerbread.xml
index 6233e6dc6..9332f9ddf 100644
--- a/java/res/layout/input_gingerbread.xml
+++ b/java/res/layout/input_gingerbread.xml
@@ -25,8 +25,7 @@
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingTop="@dimen/keyboard_top_padding"
- android:paddingBottom="@dimen/keyboard_bottom_padding"
+ android:padding="0dip"
android:background="@drawable/keyboard_dark_background"
latin:keyBackground="@drawable/btn_keyboard_key_gingerbread"
diff --git a/java/res/layout/input_honeycomb.xml b/java/res/layout/input_honeycomb.xml
index 6ccc63c2b..42bedb43c 100644
--- a/java/res/layout/input_honeycomb.xml
+++ b/java/res/layout/input_honeycomb.xml
@@ -25,12 +25,13 @@
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingTop="@dimen/keyboard_top_padding"
- android:paddingBottom="@dimen/keyboard_bottom_padding"
+ android:padding="0dip"
android:background="@drawable/keyboard_background_holo"
latin:keyBackground="@drawable/btn_keyboard_key_honeycomb"
latin:keyPreviewLayout="@layout/key_preview_honeycomb"
+ latin:keyPreviewHeight="@dimen/key_preview_height_holo"
+ latin:keyPreviewOffset="@dimen/key_preview_offset_holo"
latin:popupLayout="@layout/keyboard_popup_honeycomb"
latin:keyTextColorDisabled="#FF63666D"
latin:keyLetterStyle="bold"
diff --git a/java/res/layout/input_stone_bold.xml b/java/res/layout/input_stone_bold.xml
index 6fdc93855..22ac14eb1 100644
--- a/java/res/layout/input_stone_bold.xml
+++ b/java/res/layout/input_stone_bold.xml
@@ -25,6 +25,7 @@
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:padding="0dip"
android:background="@drawable/keyboard_background"
latin:keyBackground="@drawable/btn_keyboard_key_stone"
@@ -33,5 +34,5 @@
latin:shadowColor="@color/latinkeyboard_key_color_white"
latin:keyLetterStyle="bold"
latin:colorScheme="black"
- latin:popupLayout="@layout/input_stone_popup"
+ latin:popupLayout="@layout/keyboard_popup_stone"
/>
diff --git a/java/res/layout/input_stone_normal.xml b/java/res/layout/input_stone_normal.xml
index 6ae9aed55..8baecabdb 100644
--- a/java/res/layout/input_stone_normal.xml
+++ b/java/res/layout/input_stone_normal.xml
@@ -25,6 +25,7 @@
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:padding="0dip"
android:background="@drawable/keyboard_background"
latin:keyBackground="@drawable/btn_keyboard_key_stone"
@@ -32,5 +33,5 @@
latin:keyTextColorDisabled="#FF808080"
latin:shadowColor="@color/latinkeyboard_key_color_white"
latin:colorScheme="black"
- latin:popupLayout="@layout/input_stone_popup"
+ latin:popupLayout="@layout/keyboard_popup_stone"
/>
diff --git a/java/res/layout/key_preview_honeycomb.xml b/java/res/layout/key_preview_honeycomb.xml
index a90fe5588..2fbfbb517 100644
--- a/java/res/layout/key_preview_honeycomb.xml
+++ b/java/res/layout/key_preview_honeycomb.xml
@@ -23,7 +23,7 @@
android:layout_height="80sp"
android:textSize="40sp"
android:textColor="@color/latinkeyboard_key_color_white"
- android:minWidth="24dip"
+ android:minWidth="32dip"
android:gravity="center"
android:background="@drawable/keyboard_key_feedback_honeycomb"
/>
diff --git a/java/res/layout/keyboard_popup.xml b/java/res/layout/keyboard_popup.xml
index ac8134bfb..013662240 100644
--- a/java/res/layout/keyboard_popup.xml
+++ b/java/res/layout/keyboard_popup.xml
@@ -19,20 +19,19 @@
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/keyboard_popup_panel_background"
- android:paddingLeft="16dip"
- android:paddingRight="16dip"
+ android:paddingLeft="@dimen/mini_keyboard_horizontal_padding"
+ android:paddingRight="@dimen/mini_keyboard_horizontal_padding"
>
<com.android.inputmethod.keyboard.KeyboardView
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
android:id="@+id/KeyboardView"
android:layout_alignParentBottom="true"
- android:layout_width="match_parent"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:background="@color/latinkeyboard_transparent"
latin:keyBackground="@drawable/btn_keyboard_key_gingerbread_popup"
latin:keyHysteresisDistance="0dip"
diff --git a/java/res/layout/keyboard_popup_honeycomb.xml b/java/res/layout/keyboard_popup_honeycomb.xml
index e5fcbd44c..96c519dd4 100644
--- a/java/res/layout/keyboard_popup_honeycomb.xml
+++ b/java/res/layout/keyboard_popup_honeycomb.xml
@@ -19,20 +19,19 @@
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/keyboard_popup_panel_background_holo"
- android:paddingLeft="24dip"
- android:paddingRight="24dip"
+ android:paddingLeft="@dimen/mini_keyboard_horizontal_padding_holo"
+ android:paddingRight="@dimen/mini_keyboard_horizontal_padding_holo"
>
<com.android.inputmethod.keyboard.KeyboardView
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
android:id="@+id/KeyboardView"
android:layout_alignParentBottom="true"
- android:layout_width="match_parent"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:background="@color/latinkeyboard_transparent"
latin:keyBackground="@drawable/btn_keyboard_key_honeycomb_popup"
latin:keyHysteresisDistance="0dip"
diff --git a/java/res/layout/input_stone_popup.xml b/java/res/layout/keyboard_popup_stone.xml
index b4da04536..e6acee374 100644
--- a/java/res/layout/input_stone_popup.xml
+++ b/java/res/layout/keyboard_popup_stone.xml
@@ -36,6 +36,5 @@
latin:keyBackground="@drawable/btn_keyboard_key_stone"
latin:keyTextColor="@color/latinkeyboard_key_color_black"
latin:shadowColor="@color/latinkeyboard_key_color_white"
- latin:popupLayout="@layout/input_stone_popup"
/>
</LinearLayout>
diff --git a/java/res/layout/recognition_status.xml b/java/res/layout/recognition_status.xml
index 9474d6f58..45f68974a 100644
--- a/java/res/layout/recognition_status.xml
+++ b/java/res/layout/recognition_status.xml
@@ -45,7 +45,7 @@
android:layout_height="0dip"
android:layout_width="match_parent"
android:layout_weight="1.0">
- <com.android.inputmethod.voice.SoundIndicator
+ <com.android.inputmethod.deprecated.voice.SoundIndicator
android:id="@+id/sound_indicator"
android:src="@drawable/mic_full"
android:background="@drawable/mic_base"
diff --git a/java/res/values-ar/strings.xml b/java/res/values-ar/strings.xml
index d1d70ff74..4c04fce9a 100644
--- a/java/res/values-ar/strings.xml
+++ b/java/res/values-ar/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"المس الكلمات التي تم إدخالها لتصحيحها، وذلك فقط عندما تكون الاقتراحات مرئية."</string>
<string name="keyboard_layout" msgid="437433231038683666">"مظهر لوحة المفاتيح"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"لوحة مفاتيح تشيكية"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"لوحة المفاتيح العربية"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"لوحة مفاتيح دانماركية"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"لوحة مفاتيح ألمانية"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"لوحة مفاتيح إنجليزية (بريطانيا)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"لوحة مفاتيح فرنسية"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"لوحة مفاتيح فرنسية (كندا)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"لوحة مفاتيح فرنسية (سويسرا)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"لوحة المفاتيح العبرية"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"لوحة مفاتيح إيطالية"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"لوحة مفاتيح نرويجية"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"لوحة مفاتيح بولندية"</string>
diff --git a/java/res/values-bg/strings.xml b/java/res/values-bg/strings.xml
index 418bb18a1..de00621ae 100644
--- a/java/res/values-bg/strings.xml
+++ b/java/res/values-bg/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Докоснете въведените думи, за да ги поправите – само когато предложенията са видими"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Тема на клавиатурата"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"чешка клавиатура"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"клавиатура на арабски"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"датска клавиатура"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"немска клавиатура"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"английска (Великобрит.) клавиатура"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"френска клавиатура"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"френска (Канада) клавиатура"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"френска (Швейцария) клавиатура"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"клавиатура на иврит"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"италианска клавиатура"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"норвежка клавиатура"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"нидерландска клавиатура"</string>
diff --git a/java/res/values-ca/strings.xml b/java/res/values-ca/strings.xml
index 1bfa3a9ab..2923d1347 100644
--- a/java/res/values-ca/strings.xml
+++ b/java/res/values-ca/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Toca les paraules introduïdes per corregir-les, només quan els suggeriments siguin visibles"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tema del teclat"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Teclat txec"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Teclat àrab"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Teclat danès"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Teclat alemany"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Teclat anglès (Regne Unit)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Teclat francès"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Teclat francès (Canadà)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Teclat francès (Suïssa)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Teclat hebreu"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Teclat italià"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Teclat noruec"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Teclat holandès"</string>
diff --git a/java/res/values-cs/strings.xml b/java/res/values-cs/strings.xml
index b0cb7daf7..09e68725c 100644
--- a/java/res/values-cs/strings.xml
+++ b/java/res/values-cs/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Klepnutím na zadaná slova tato slova opravíte, musí však být viditelné návrhy."</string>
<string name="keyboard_layout" msgid="437433231038683666">"Motiv klávesnice"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Klávesnice – čeština"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Klávesnice – arabština"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Klávesnice – dánština"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Klávesnice – němčina"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Klávesnice – angličtina (VB)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Klávesnice – francouzština"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Klávesnice – francouzština (Kanada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Klávesnice – francouzština (Švýc.)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Klávesnice – hebrejština"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Klávesnice – italština"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Klávesnice – norština"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Klávesnice – holandština"</string>
diff --git a/java/res/values-da/strings.xml b/java/res/values-da/strings.xml
index eb79888d6..d9d1b43c5 100644
--- a/java/res/values-da/strings.xml
+++ b/java/res/values-da/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Tryk på de indtastede ord for at rette dem. Kun når der er synlige forslag."</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tastaturtema"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Tjekkisk tastatur"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arabisk tastatur"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Dansk tastatur"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Tysk tastatur"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Engelsk tastatur (Storbritannien)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Fransk tastatur"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Fransk tastatur (Canada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Fransk tastatur (Schweiz)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Hebraisk tastatur"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Italiensk tastatur"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Norsk tastatur"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Hollandsk tastatur"</string>
diff --git a/java/res/values-de/strings.xml b/java/res/values-de/strings.xml
index 396d74dd8..74c1041a0 100644
--- a/java/res/values-de/strings.xml
+++ b/java/res/values-de/strings.xml
@@ -40,11 +40,11 @@
<string name="settings_key_mode_auto_name" msgid="2993460277873684680">"Automatisch"</string>
<string name="settings_key_mode_always_show_name" msgid="3047567041784760575">"Immer anzeigen"</string>
<string name="settings_key_mode_always_hide_name" msgid="7833948046716923994">"Immer ausblenden"</string>
- <string name="auto_correction" msgid="4979925752001319458">"Auto-Korrektur"</string>
+ <string name="auto_correction" msgid="4979925752001319458">"Autokorrektur"</string>
<string name="auto_correction_summary" msgid="5625751551134658006">"Korrektur fehlerhafter Wörter durch Leertaste und Satzzeichen"</string>
<string name="auto_correction_threshold_mode_off" msgid="8470882665417944026">"Aus"</string>
<string name="auto_correction_threshold_mode_modest" msgid="8788366690620799097">"Mäßig"</string>
- <string name="auto_correction_threshold_mode_aggeressive" msgid="3524029103734923819">"Aggressiv"</string>
+ <string name="auto_correction_threshold_mode_aggeressive" msgid="3524029103734923819">"Stark"</string>
<string name="bigram_suggestion" msgid="1323347224043514969">"Bigramm-Vorschläge"</string>
<string name="bigram_suggestion_summary" msgid="4383845146070101531">"Zur Verbesserung des Vorschlags vorheriges Wort verwenden"</string>
<string name="added_word" msgid="8993883354622484372">"<xliff:g id="WORD">%s</xliff:g>: gespeichert"</string>
@@ -94,7 +94,7 @@
<string name="voice_input_modes_off" msgid="3745699748218082014">"Aus"</string>
<string name="voice_input_modes_summary_main_keyboard" msgid="6586544292900314339">"Mikro auf Haupttastatur"</string>
<string name="voice_input_modes_summary_symbols_keyboard" msgid="5233725927281932391">"Mikro auf Symboltastatur"</string>
- <string name="voice_input_modes_summary_off" msgid="63875609591897607">"Spracheing. deaktiviert"</string>
+ <string name="voice_input_modes_summary_off" msgid="63875609591897607">"Spracheingabe deaktiviert"</string>
<string name="selectInputMethod" msgid="315076553378705821">"Eingabemethode auswählen"</string>
<string name="language_selection_title" msgid="1651299598555326750">"Eingabesprachen"</string>
<string name="language_selection_summary" msgid="187110938289512256">"Finger über die Leertaste bewegen, um die Eingabesprache zu wechseln"</string>
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Tippen Sie zum Korrigieren auf eingegebene Wörter (nur, wenn Vorschläge angezeigt werden)."</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tastaturdesign"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Tschechische Tastatur"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arabische Tastatur"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Dänische Tastatur"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Deutsche Tastatur"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Englische Tastatur (GB)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Französische Tastatur"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Französische Tastatur (Kanada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Französische Tastatur (Schweiz)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Hebräische Tastatur"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Italienische Tastatur"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Norwegische Tastatur"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Niederländische Tastatur"</string>
diff --git a/java/res/values-el/strings.xml b/java/res/values-el/strings.xml
index 6d0869bf1..70f1d48c5 100644
--- a/java/res/values-el/strings.xml
+++ b/java/res/values-el/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Αγγίξτε τις λέξες για να τις διορθώσετε, μόνο όταν οι προτάσεις είναι ορατές"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Θέμα πληκτρολογίου"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Τσεχικό πληκτρολόγιο"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Πληκτρολόγιο με αραβική γραφή"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Δανικό πληκτρολόγιο"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Γερμανικό πληκτρολόγιο"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Αγγλικό (ΗΒ) πληκτρολόγιο"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Γαλλικό πληκτρολόγιο"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Γαλλικό (Καναδάς) πληκτρολόγιο"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Γαλλικό (Ελβετία) πληκτρολόγιο"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Πληκτρολόγιο με εβραϊκή γραφή"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Ιταλικό πληκτρολόγιο"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Νορβηγικό πληκτρολόγιο"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Ολλανδικό πληκτρολόγιο"</string>
diff --git a/java/res/values-en-rGB/strings.xml b/java/res/values-en-rGB/strings.xml
index b2e62b0cd..64006345a 100644
--- a/java/res/values-en-rGB/strings.xml
+++ b/java/res/values-en-rGB/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Touch words entered to correct them, only when suggestions are visible"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Keyboard Theme"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Czech Keyboard"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arabic Keyboard"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Danish Keyboard"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"German Keyboard"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"English (UK) Keyboard"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"French Keyboard"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"French (Canada) Keyboard"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"French (Switzerland) Keyboard"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Hebrew Keyboard"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Italian Keyboard"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Norwegian Keyboard"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Dutch Keyboard"</string>
diff --git a/java/res/values-es-rUS/strings.xml b/java/res/values-es-rUS/strings.xml
index 02f36ff79..a00005098 100644
--- a/java/res/values-es-rUS/strings.xml
+++ b/java/res/values-es-rUS/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Toca las palabras ingresadas que desees corregir solo cuando las sugerencias estén visibles."</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tema del teclado"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Teclado en checo"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Teclado árabe"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Teclado en danés"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Teclado en alemán"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Teclado en inglés (Reino Unido)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Teclado en francés"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Teclado en francés (Canadá)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Teclado en francés (Suiza)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Teclado hebreo"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Teclado en italiano"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Teclado en noruego"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Teclado en holandés"</string>
diff --git a/java/res/values-es/strings.xml b/java/res/values-es/strings.xml
index f9a86ffd6..b5439d453 100644
--- a/java/res/values-es/strings.xml
+++ b/java/res/values-es/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Toca las palabras introducidas para corregirlas, solo cuando las sugerencias sean visibles."</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tema de teclado"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Teclado checo"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Teclado árabe"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Teclado danés"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Teclado alemán"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Teclado inglés (Reino Unido)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Teclado francés"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Teclado francés (Canadá)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Teclado francés (Suiza)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Teclado hebreo"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Teclado italiano"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Teclado noruego"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Teclado holandés"</string>
diff --git a/java/res/values-fa/strings.xml b/java/res/values-fa/strings.xml
index b594411ac..ca7c1412d 100644
--- a/java/res/values-fa/strings.xml
+++ b/java/res/values-fa/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"فقط هنگامی که پیشنهادات قابل مشاهده هستند، برای تصحیح کلمات وارد شده آنها را لمس کنید"</string>
<string name="keyboard_layout" msgid="437433231038683666">"طرح زمینه صفحه کلید"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"صفحه کلید چک"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"صفحه کلید عربی"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"صفحه کلید دانمارکی"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"صفحه کلید آلمانی"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"صفحه کلید انگلیسی (بریتانیایی)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"صفحه کلید فرانسوی"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"صفحه کلید فرانسوی (کانادایی)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"صفحه کلید فرانسوی (سوئیس)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"صفحه کلید عبری"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"صفحه کلید ایتالیایی"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"صفحه کلید نروژی"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"صفحه کلید هلندی"</string>
diff --git a/java/res/values-fi/strings.xml b/java/res/values-fi/strings.xml
index 0bf385552..56d2df721 100644
--- a/java/res/values-fi/strings.xml
+++ b/java/res/values-fi/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Korjaa annetut sanat napauttamalla. (Vain, kun ehdotuksia on näkyvillä.)"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Näppäimistön teema"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Näppäimistö: tšekki"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arabiankielinen näppäimistö"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Näppäimistö: tanska"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Näppäimistö: saksa"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Näppäimistö: englanti (UK)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Näppäimistö: ranska"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Näppäimistö: ranska (Kanada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Näppäimistö: ranska (Sveitsi)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Hepreankielinen näppäimistö"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Näppäimistö: italia"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Näppäimistö: norja"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Näppäimistö: hollanti"</string>
diff --git a/java/res/values-fr/strings.xml b/java/res/values-fr/strings.xml
index 65e88c1ff..86e37b32d 100644
--- a/java/res/values-fr/strings.xml
+++ b/java/res/values-fr/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Appuyer sur les mots saisis pour les corriger, uniquement lorsque des suggestions sont visibles"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Thème du clavier"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Clavier tchèque"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Clavier arabe"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Clavier danois"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Clavier allemand"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Clavier anglais (Royaume-Uni)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Clavier français"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Clavier français (Canada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Clavier français (Suisse)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Clavier hébreu"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Clavier italien"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Clavier norvégien"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Clavier néerlandais"</string>
diff --git a/java/res/values-hr/strings.xml b/java/res/values-hr/strings.xml
index e6879a6d1..24e70cf8e 100644
--- a/java/res/values-hr/strings.xml
+++ b/java/res/values-hr/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Dodirnite unesene riječi da biste ih ispravili samo kada su prijedlozi vidljivi"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tema tipkovnice"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Češka tipkovnica"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arapska tipkovnica"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Danska tipkovnica"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Njemačka tipkovnica"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Engleska (UK) tipkovnica"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Francuska tipkovnica"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Francuska (Kanada) tipkovnica"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Francuska (Švicarska) tipkovnica"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Hebrejska tipkovnica"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Talijanska tipkovnica"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Norveška tipkovnica"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Nizozemska tipkovnica"</string>
diff --git a/java/res/values-hu/strings.xml b/java/res/values-hu/strings.xml
index a8bf98367..cfcdf45ad 100644
--- a/java/res/values-hu/strings.xml
+++ b/java/res/values-hu/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"A beírt szavakat csak akkor javíthatja ki megérintve, ha látszanak javaslatok"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Billentyűzettéma"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Cseh billentyűzet"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arab billentyűzet"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Dán billentyűzet"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Német billentyűzet"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Angol (UK) billentyűzet"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Francia billentyűzet"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Francia (kanadai) billentyűzet"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Francia (svájci) billentyűzet"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Héber billentyűzet"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Olasz billentyűzet"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Norvég billentyűzet"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Holland billentyűzet"</string>
diff --git a/java/res/values-in/strings.xml b/java/res/values-in/strings.xml
index 4df7f1e7f..5dfcbf0ff 100644
--- a/java/res/values-in/strings.xml
+++ b/java/res/values-in/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Sentuh kata yang dimasukkan untuk memperbaikinya, hanya saat saran dapat dilihat"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tema Keyboard"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Keyboard Cheska"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Papan Tombol Arab"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Keyboard Denmark"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Keyboard Jerman"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Keyboard Inggris (Britania Raya)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Keyboard Prancis"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Keyboard Prancis (Kanada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Keyboard Prancis (Swiss)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Papan tombol Ibrani"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Keyboard Italia"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Keyboard Norwegia"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Keyboard Belanda"</string>
diff --git a/java/res/values-it/strings.xml b/java/res/values-it/strings.xml
index 9bf4f9e30..64bbf654b 100644
--- a/java/res/values-it/strings.xml
+++ b/java/res/values-it/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Tocca le parole inserite per correggerle, solo quando sono visibili i suggerimenti"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tema della tastiera"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Tastiera ceca"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Tastiera araba"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Tastiera danese"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Tastiera tedesca"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Tastiera inglese (Regno Unito)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Tastiera francese"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Tastiera francese (Canada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Tastiera francese (Svizzera)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Tastiera ebraica"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Tastiera italiana"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Tastiera norvegese"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Tastiera olandese"</string>
diff --git a/java/res/values-iw/strings.xml b/java/res/values-iw/strings.xml
index af0854c97..2ad86c910 100644
--- a/java/res/values-iw/strings.xml
+++ b/java/res/values-iw/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"גע במילים שהוזנו כדי לתקן אותן, רק כאשר הצעות מוצגות"</string>
<string name="keyboard_layout" msgid="437433231038683666">"עיצוב מקלדת"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"מקלדת צ\'כית"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"מקלדת בשפה הערבית"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"מקלדת דנית"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"מקלדת גרמנית "</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"מקלדת אנגלית (בריטניה)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"מקלדת צרפתית"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"מקלדת צרפתית (קנדה)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"מקלדת צרפתית (שוויץ)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"מקלדת בשפה העברית"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"מקלדת איטלקית"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"מקלדת נורווגית"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"מקלדת הולנדית"</string>
diff --git a/java/res/values-ja/strings.xml b/java/res/values-ja/strings.xml
index cd2cf8070..768122c60 100644
--- a/java/res/values-ja/strings.xml
+++ b/java/res/values-ja/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"候補が表示されているときのみ、入力した語句をタップして修正する"</string>
<string name="keyboard_layout" msgid="437433231038683666">"キーボードテーマ"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"チェコ語のキーボード"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"アラビア語のキーボード"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"デンマーク語のキーボード"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"ドイツ語のキーボード"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"英語(英国)のキーボード"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"フランス語のキーボード"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"フランス語(カナダ)のキーボード"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"フランス語(スイス)のキーボード"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"ヘブライ語のキーボード"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"イタリア語のキーボード"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"ノルウェー語のキーボード"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"オランダ語のキーボード"</string>
diff --git a/java/res/values-ko/strings.xml b/java/res/values-ko/strings.xml
index 7a09da880..850981cca 100644
--- a/java/res/values-ko/strings.xml
+++ b/java/res/values-ko/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"입력한 단어를 터치하여 수정(추천 단어가 표시되는 경우에만)"</string>
<string name="keyboard_layout" msgid="437433231038683666">"키보드 테마"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"체코어 키보드"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"아랍어 키보드"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"덴마크어 키보드"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"독일어 키보드"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"영어(영국) 키보드"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"프랑스어 키보드"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"프랑스어(캐나다) 키보드"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"프랑스어(스위스) 키보드"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"히브리어 키보드"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"이탈리아어 키보드"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"노르웨이어 키보드"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"네덜란드어 키보드"</string>
diff --git a/java/res/values-land/dimens.xml b/java/res/values-land/dimens.xml
index 7df124bfc..6954ba2ae 100644
--- a/java/res/values-land/dimens.xml
+++ b/java/res/values-land/dimens.xml
@@ -27,6 +27,7 @@
<dimen name="popup_key_height">0.270in</dimen>
<dimen name="keyboard_top_padding">0.0in</dimen>
<dimen name="keyboard_bottom_padding">0.0in</dimen>
+ <dimen name="keyboard_horizontal_edges_padding">0.0in</dimen>
<dimen name="candidate_strip_height">38dip</dimen>
<dimen name="candidate_strip_fading_edge_length">63dip</dimen>
<dimen name="spacebar_vertical_correction">2dip</dimen>
diff --git a/java/res/values-lt/strings.xml b/java/res/values-lt/strings.xml
index c12c62aaa..247e201fb 100644
--- a/java/res/values-lt/strings.xml
+++ b/java/res/values-lt/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Jei norite ištaisyti įvestus žodžius, palieskite juos tik tada, kai matomi pasiūlymai"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Klaviatūros tema"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Čekiška klaviatūra"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arabiška klaviatūra"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Daniška klaviatūra"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Vokiška klaviatūra"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Angliška (JK) klaviatūra"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Prancūziška klaviatūra"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Prancūziška (Kanada) klaviatūra"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Prancūziška (Šveicarija) klaviatūra"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Hebrajiška klaviatūra"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Itališka klaviatūra"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Norvegiška klaviatūra"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Olandiška klaviatūra"</string>
diff --git a/java/res/values-lv/strings.xml b/java/res/values-lv/strings.xml
index 8b975b033..5d0c0ae7e 100644
--- a/java/res/values-lv/strings.xml
+++ b/java/res/values-lv/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Pieskarties ievadītajiem vārdiem, lai tos labotu (tikai tad, ja tiek rādīti ieteikumi)."</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tastatūras motīvs"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Čehu tastatūra"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arābu tastatūra"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Dāņu tastatūra"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Vācu tastatūra"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Angļu (Lielbritānija) tastatūra"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Franču tastatūra"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Franču (Kanāda) tastatūra"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Franču (Šveices) tastatūra"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Ebreju tastatūra"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Itāļu tastatūra"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Norvēģu tastatūra"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Holandiešu tastatūra"</string>
diff --git a/java/res/values-nb/strings.xml b/java/res/values-nb/strings.xml
index 0471e74c3..944e8dd5a 100644
--- a/java/res/values-nb/strings.xml
+++ b/java/res/values-nb/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Når forslag er synlige, kan du trykke på ord du har skrevet inn, for å endre dem"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tastaturtema"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Tsjekkisk tastatur"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arabisk tastatur"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Dansk tastatur"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Tysk tastatur"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Engelsk tastatur (Storbritannia)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Fransk tastatur"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Fransk tastatur (Canada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Fransk tastatur (Sveits)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Hebraisk tastatur"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Italiensk tastatur"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Norsk tastatur"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Nederlandsk tastatur"</string>
diff --git a/java/res/values-nl/strings.xml b/java/res/values-nl/strings.xml
index e5439eb38..e52ad2e2a 100644
--- a/java/res/values-nl/strings.xml
+++ b/java/res/values-nl/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Ingevoerde woorden aanraken om ze te verbeteren, alleen mogelijk wanneer suggesties zichtbaar zijn"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Toetsenbordthema"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Tsjechisch toetsenbord"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arabisch toetsenbord"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Deens toetsenbord"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Duits toetsenbord"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Engels toetsenbord (VK)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Frans toetsenbord"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Frans toetsenbord (Canada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Frans toetsenbord (Zwitserland)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Hebreeuws toetsenbord"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Italiaans toetsenbord"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Noors toetsenbord"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Nederlands toetsenbord"</string>
diff --git a/java/res/values-pl/strings.xml b/java/res/values-pl/strings.xml
index 633b159c9..b0c707f35 100644
--- a/java/res/values-pl/strings.xml
+++ b/java/res/values-pl/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Dotykaj wprowadzonych słów, aby je poprawiać tylko wówczas, gdy widoczne są sugestie."</string>
<string name="keyboard_layout" msgid="437433231038683666">"Motyw klawiatury"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Klawiatura czeska"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Klawiatura arabska"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Klawiatura duńska"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Klawiatura niemiecka"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Klawiatura angielska (UK)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Klawiatura francuska"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Klawiatura francuska (Kanada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Klawiatura francuska (Szwajcaria)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Klawiatura hebrajska"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Klawiatura włoska"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Klawiatura norweska"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Klawiatura holenderska"</string>
diff --git a/java/res/values-pt-rPT/strings.xml b/java/res/values-pt-rPT/strings.xml
index f06d64c70..83686662b 100644
--- a/java/res/values-pt-rPT/strings.xml
+++ b/java/res/values-pt-rPT/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Tocar nas palavras introduzidas para as corrigir, apenas quando as sugestões estiverem visíveis"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tema do teclado"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Teclado checo"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Teclado árabe"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Teclado dinamarquês"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Teclado alemão"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Teclado inglês (Reino Unido)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Teclado francês"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Teclado francês (Canadá)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Teclado francês (Suíça)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Teclado hebraico"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Teclado italiano"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Teclado norueguês"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Teclado holandês"</string>
diff --git a/java/res/values-pt/strings.xml b/java/res/values-pt/strings.xml
index 9fc1a97f2..0d09b1119 100644
--- a/java/res/values-pt/strings.xml
+++ b/java/res/values-pt/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Toque nas palavras digitadas para corrigi-las apenas quando as sugestões estiverem visíveis"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tema do teclado"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Teclado em tcheco"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Teclado árabe"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Teclado para dinamarquês"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Teclado para alemão"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Teclado para inglês (Reino Unido)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Teclado para francês"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Teclado para francês (Canadá)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Teclado para francês (Suíça)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Teclado hebraico"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Teclado para italiano"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Teclado para norueguês"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Teclado para holandês"</string>
diff --git a/java/res/values-rm/strings.xml b/java/res/values-rm/strings.xml
index 57548b5e4..c788597d6 100644
--- a/java/res/values-rm/strings.xml
+++ b/java/res/values-rm/strings.xml
@@ -146,6 +146,8 @@
<string name="keyboard_layout" msgid="437433231038683666">"Design da la tastatura"</string>
<!-- no translation found for subtype_mode_cs_keyboard (1141718931112377586) -->
<skip />
+ <!-- no translation found for subtype_mode_ar_keyboard (2655338636329774995) -->
+ <skip />
<!-- no translation found for subtype_mode_da_keyboard (1243570804427922104) -->
<skip />
<!-- no translation found for subtype_mode_de_keyboard (1990979135959462145) -->
@@ -164,6 +166,8 @@
<skip />
<!-- no translation found for subtype_mode_fr_CH_keyboard (6742806653181621228) -->
<skip />
+ <!-- no translation found for subtype_mode_iw_keyboard (1787536828253289950) -->
+ <skip />
<!-- no translation found for subtype_mode_it_keyboard (4934199655425394484) -->
<skip />
<!-- no translation found for subtype_mode_nb_keyboard (1175783216100212360) -->
diff --git a/java/res/values-ro/strings.xml b/java/res/values-ro/strings.xml
index 52bed2785..a0b5df381 100644
--- a/java/res/values-ro/strings.xml
+++ b/java/res/values-ro/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Atingeţi cuvintele introduse pentru a le corecta, numai când pot fi văzute sugestii"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Temă pentru tastatură"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Tastatură cehă"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Tastatură arabă"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Tastatură daneză"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Tastatură germană"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Tastatură engleză (Marea Britanie)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Tastatură franceză"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Tastatură franceză (Canada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Tastatură franceză (Elveţia)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Tastatură ebraică"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Tastatură italiană"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Tastatură norvegiană"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Tastatură olandeză"</string>
diff --git a/java/res/values-ru/strings.xml b/java/res/values-ru/strings.xml
index f8fdab021..c1e379dd9 100644
--- a/java/res/values-ru/strings.xml
+++ b/java/res/values-ru/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Нажмите на слово, чтобы исправить его (при наличии подсказок)"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Вид клавиатуры"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Клавиатура: чешская"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Арабская клавиатура"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Клавиатура: датская"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Клавиатура: немецкая"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Клавиатура: английская (Великобритания)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Клавиатура: французская"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Клавиатура: французская"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Клавиатура: французская (Швейцария)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Клавиатура на иврите"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Клавиатура: итальянская"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Клавиатура: норвежская"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Клавиатура: голландская"</string>
diff --git a/java/res/values-sk/strings.xml b/java/res/values-sk/strings.xml
index 569f273a4..20e29764a 100644
--- a/java/res/values-sk/strings.xml
+++ b/java/res/values-sk/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Dotykom zadaných slov tieto slová opravíte, musia však byť viditeľné návrhy"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Motív klávesnice"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"klávesnica – čeština"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"klávesnica – arabčina"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"klávesnica – dánčina"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"klávesnica – nemčina"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"klávesnica – angličtina (br.)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"klávesnica – francúzština"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"klávesnica – francúzština (Kanada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"klávesnica – francúzština (Švajč.)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"klávesnica – hebrejčina"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"klávesnica – taliančina"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"klávesnica – nórčina"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"klávesnica – holandčina"</string>
diff --git a/java/res/values-sl/strings.xml b/java/res/values-sl/strings.xml
index 715e6c567..12df259da 100644
--- a/java/res/values-sl/strings.xml
+++ b/java/res/values-sl/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Dotaknite se vnesenih besed in jih popravite, samo ko so predlogi vidni"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tema tipkovnice"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Češka tipkovnica"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arabska tipkovnica"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Danska tipkovnica"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Nemška tipkovnica"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Tipkovnica za britansko angleščino"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Francoska tipkovnica"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Tipkovnica za kanadsko francoščino"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Tipkovnica za švicarsko francoščino"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Hebrejska tipkovnica"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Italijanska tipkovnica"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Norveška tipkovnica"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Nizozemska tipkovnica"</string>
diff --git a/java/res/values-sr/strings.xml b/java/res/values-sr/strings.xml
index 115732779..1e637fd01 100644
--- a/java/res/values-sr/strings.xml
+++ b/java/res/values-sr/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Додирните унете речи да бисте их исправили само када су предлози видљиви"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Тема тастатуре"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Језик тастатуре: чешки"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Језик тастатуре: арапски"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Језик тастатуре: дански"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Језик тастатуре: немачки"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Језик тастатуре: енглески (УК)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Језик тастатуре: француски"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Језик тастатуре: француски (Канада)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Језик тастатуре: француски (Швајц.)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Језик тастатуре: хебрејски"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Језик тастатуре: италијански"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Језик тастатуре: норвешки"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Језик тастатуре: холандски"</string>
diff --git a/java/res/values-sv/strings.xml b/java/res/values-sv/strings.xml
index b8c62f46e..fc311e7ff 100644
--- a/java/res/values-sv/strings.xml
+++ b/java/res/values-sv/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Tryck på skrivna ord om du vill korrigera dem, endast när förslag visas"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tangentbordstema"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Tjeckiskt tangentbord"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arabiskt tangentbord"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Danskt tangentbord"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Tyskt tangentbord"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Engelskt tangentbord (Storbrit.)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Franskt tangentbord"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Franskt tangentbord (Kanada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Franskt tangentbord (Schweiz)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Hebreiskt tangentbord"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Italienskt tangentbord"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Norskt tangentbord"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Holländskt tangentbord"</string>
diff --git a/java/res/values-th/strings.xml b/java/res/values-th/strings.xml
index 836b98724..c19b7d538 100644
--- a/java/res/values-th/strings.xml
+++ b/java/res/values-th/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"แตะคำที่ป้อนไว้เพื่อแก้ไข เฉพาะเมื่อเห็นข้อเสนอแนะเท่านั้น"</string>
<string name="keyboard_layout" msgid="437433231038683666">"ชุดรูปแบบแป้นพิมพ์"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"แป้นพิมพ์ภาษาเช็ก"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"แป้นพิมพ์ภาษาอาหรับ"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"แป้นพิมพ์ภาษาเดนมาร์ก"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"แป้นพิมพ์ภาษาเยอรมัน"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"แป้นพิมพ์ภาษาอังกฤษ (สหราชอาณาจักร)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"แป้นพิมพ์ภาษาฝรั่งเศส"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"แป้นพิมพ์ภาษาฝรั่งเศส (แคนาดา)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"แป้นพิมพ์ภาษาฝรั่งเศส (สวิตเซอร์แลนด์)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"แป้นพิมพ์ภาษาฮิบรู"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"แป้นพิมพ์ภาษาอิตาลี"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"แป้นพิมพ์ภาษานอร์เวย์"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"แป้นพิมพ์ภาษาดัตช์"</string>
diff --git a/java/res/values-tl/strings.xml b/java/res/values-tl/strings.xml
index 55f98de10..ce9abf8bd 100644
--- a/java/res/values-tl/strings.xml
+++ b/java/res/values-tl/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Pindutin ang mga inilagay na salita upang iwasto ang mga ito, kapag nakikita lang ang mga suhestiyon"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Tema ng Keyboard"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Czech na Keyboard"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arabic na Keyboard"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Danish na Keyboard"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"German na Keyboard"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Ingles (UK) na Keyboard"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"French na Keyboard"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"French (Canada) na Keyboard"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"French (Switzerland) na Keyboard"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Hebrew na Keyboard"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Italian na Keyboard"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Norwegian na Keyboard"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Dutch na Keyboard"</string>
diff --git a/java/res/values-tr/strings.xml b/java/res/values-tr/strings.xml
index 71a6215dd..da8b287d3 100644
--- a/java/res/values-tr/strings.xml
+++ b/java/res/values-tr/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Yalnızca öneriler görünür olduğunda, düzeltmek için girilen kelimelere dokunun"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Klavye Teması"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Çekçe Klavye"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Arapça Klavye"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Danca Klavye"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Almanca Klavye"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"İngilizce (İngiltere) Klavye"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Fransızca Klavye"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Fransızca (Kanada) Klavye"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Fransızca (İsviçre) Klavye"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"İbranice Klavye"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"İtalyanca Klavye"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Norveççe Klavye"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Felemenkçe Klavye"</string>
diff --git a/java/res/values-uk/strings.xml b/java/res/values-uk/strings.xml
index 26906329a..53063393a 100644
--- a/java/res/values-uk/strings.xml
+++ b/java/res/values-uk/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Торкніться введених слів, щоб виправити їх, лише коли ввімкнено пропозиції"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Тема клавіатури"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Чеська розкладка"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Розкладка для арабської мови"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Данська розкладка"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Німецька розкладка"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Англ. розкладка (Великобританія)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Французька розкладка"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Французька розкладка (Канада)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Французька розкладка (Швейцарія)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Розкладка для івриту"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Італійська розкладка"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Норвезька розкладка"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Голланд. розклад."</string>
diff --git a/java/res/values-vi/strings.xml b/java/res/values-vi/strings.xml
index 70defe3b7..0473464b5 100644
--- a/java/res/values-vi/strings.xml
+++ b/java/res/values-vi/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"Chạm các từ đã nhập để sửa, chỉ khi các đề xuất hiển thị"</string>
<string name="keyboard_layout" msgid="437433231038683666">"Chủ đề bàn phím"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"Bàn phím tiếng Séc"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"Bàn phím tiếng Ả Rập"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"Bàn phím tiếng Đan Mạch"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"Bàn phím tiếng Đức"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"Bàn phím tiếng Anh (Anh)"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"Bàn phím tiếng Pháp"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"Bàn phím tiếng Pháp (Canada)"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"Bàn phím tiếng Pháp (Thụy Sĩ)"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"Bàn phím tiếng Do Thái"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"Bàn phím tiếng Ý"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"Bàn phím tiếng Na Uy"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"Bàn phím tiếng Hà Lan"</string>
diff --git a/java/res/values-xlarge-land/dimens.xml b/java/res/values-xlarge-land/dimens.xml
index 625dd263c..fd6b1f386 100644
--- a/java/res/values-xlarge-land/dimens.xml
+++ b/java/res/values-xlarge-land/dimens.xml
@@ -19,7 +19,7 @@
-->
<resources>
- <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 -->
+ <!-- keyboardHeight = key_height*4 + key_bottom_gap*3, key_height=14.5mm -->
<dimen name="keyboardHeight">58.0mm</dimen>
<!-- key_height + key_bottom_gap = popup_key_height -->
<!-- <dimen name="key_height">14.5mm</dimen> -->
@@ -28,12 +28,14 @@
<dimen name="popup_key_height">13.0mm</dimen>
<dimen name="keyboard_top_padding">1.1mm</dimen>
<dimen name="keyboard_bottom_padding">0.0mm</dimen>
- <!-- key_height x 1.0 -->
- <dimen name="key_preview_height">13.0mm</dimen>
+ <dimen name="keyboard_horizontal_edges_padding">0.0mm</dimen>
<dimen name="key_letter_size">28dip</dimen>
<dimen name="key_label_text_size">20dip</dimen>
<!-- left or right padding of label alignment -->
<dimen name="key_label_horizontal_alignment_padding">18dip</dimen>
+ <dimen name="key_preview_height_holo">26.5mm</dimen>
+ <dimen name="key_preview_offset_holo">7.5mm</dimen>
+
<dimen name="candidate_strip_padding">40.0mm</dimen>
</resources>
diff --git a/java/res/values-xlarge/config.xml b/java/res/values-xlarge/config.xml
index f075b1b50..ed8dc3e52 100644
--- a/java/res/values-xlarge/config.xml
+++ b/java/res/values-xlarge/config.xml
@@ -22,7 +22,8 @@
<bool name="config_enable_show_settings_key_option">false</bool>
<bool name="config_enable_show_subtype_settings">false</bool>
<bool name="config_enable_show_voice_key_option">false</bool>
- <bool name="config_enable_show_popup_on_keypress_option">false</bool>
+ <!-- TODO: This configuration value is temporary set true to check popup preview behavior. -->
+ <bool name="config_enable_show_popup_on_keypress_option">true</bool>
<bool name="config_enable_show_recorrection_option">false</bool>
<bool name="config_enable_quick_fixes_option">false</bool>
<bool name="config_enable_bigram_suggestions_option">false</bool>
diff --git a/java/res/values-xlarge/dimens.xml b/java/res/values-xlarge/dimens.xml
index 69283202e..9bb50f62a 100644
--- a/java/res/values-xlarge/dimens.xml
+++ b/java/res/values-xlarge/dimens.xml
@@ -19,7 +19,7 @@
-->
<resources>
- <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 -->
+ <!-- keyboardHeight = key_height*4 + key_bottom_gap*3, key_height=12mm -->
<dimen name="keyboardHeight">48.0mm</dimen>
<!-- key_height + key_bottom_gap = popup_key_height -->
<!-- <dimen name="key_height">14.5mm</dimen> -->
@@ -28,8 +28,8 @@
<dimen name="popup_key_height">10.0mm</dimen>
<dimen name="keyboard_top_padding">1.1mm</dimen>
<dimen name="keyboard_bottom_padding">0.0mm</dimen>
- <!-- key_height x 1.0 -->
- <dimen name="key_preview_height">13.0mm</dimen>
+ <dimen name="keyboard_horizontal_edges_padding">0.0mm</dimen>
+ <dimen name="mini_keyboard_horizontal_padding_holo">40dip</dimen>
<dimen name="mini_keyboard_key_horizontal_padding">12dip</dimen>
<!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. -->
<!-- popup_key_height x 1.2 -->
@@ -39,11 +39,16 @@
<dimen name="key_letter_size">26dip</dimen>
<dimen name="key_label_text_size">16dip</dimen>
- <dimen name="key_preview_text_size_large">24dip</dimen>
<!-- left or right padding of label alignment -->
<dimen name="key_label_horizontal_alignment_padding">6dip</dimen>
+ <dimen name="key_preview_text_size_large">24dip</dimen>
+ <dimen name="key_preview_height_holo">23.0mm</dimen>
+ <dimen name="key_preview_offset_holo">8.0mm</dimen>
<dimen name="candidate_strip_height">46dip</dimen>
+ <!-- candidate_strip_minimum_height =
+ key_preview_height_holo - key_preview_offset_holo + alpha -->
+ <dimen name="candidate_strip_minimum_height">18mm</dimen>
<dimen name="candidate_strip_padding">15.0mm</dimen>
<dimen name="candidate_min_width">0.3in</dimen>
<dimen name="candidate_padding">12dip</dimen>
diff --git a/java/res/values-zh-rCN/strings.xml b/java/res/values-zh-rCN/strings.xml
index 3b092bfcc..5578566a2 100644
--- a/java/res/values-zh-rCN/strings.xml
+++ b/java/res/values-zh-rCN/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"仅在系统显示建议后,才触摸输入的字词进行更正"</string>
<string name="keyboard_layout" msgid="437433231038683666">"键盘主题"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"捷克语键盘"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"阿拉伯语键盘"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"丹麦语键盘"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"德语键盘"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"英语(英国)键盘"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"法语键盘"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"法语(加拿大)键盘"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"法语(瑞士)键盘"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"希伯来语键盘"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"意大利语键盘"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"挪威语键盘"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"荷兰语键盘"</string>
diff --git a/java/res/values-zh-rTW/strings.xml b/java/res/values-zh-rTW/strings.xml
index c9c7ae88a..591c137f1 100644
--- a/java/res/values-zh-rTW/strings.xml
+++ b/java/res/values-zh-rTW/strings.xml
@@ -106,6 +106,7 @@
<string name="prefs_enable_recorrection_summary" msgid="5082041365862396329">"輕觸輸入的字詞即可加以修正 (出現建議時才適用)"</string>
<string name="keyboard_layout" msgid="437433231038683666">"鍵盤主題"</string>
<string name="subtype_mode_cs_keyboard" msgid="1141718931112377586">"捷克文鍵盤"</string>
+ <string name="subtype_mode_ar_keyboard" msgid="2655338636329774995">"阿拉伯文鍵盤"</string>
<string name="subtype_mode_da_keyboard" msgid="1243570804427922104">"丹麥文鍵盤"</string>
<string name="subtype_mode_de_keyboard" msgid="1990979135959462145">"德文鍵盤"</string>
<string name="subtype_mode_en_GB_keyboard" msgid="7945856548410373708">"英文 (英國) 鍵盤"</string>
@@ -115,6 +116,7 @@
<string name="subtype_mode_fr_keyboard" msgid="8016515336759761014">"法文鍵盤"</string>
<string name="subtype_mode_fr_CA_keyboard" msgid="2628517247158376263">"法文 (加拿大) 鍵盤"</string>
<string name="subtype_mode_fr_CH_keyboard" msgid="6742806653181621228">"法文 (瑞士) 鍵盤"</string>
+ <string name="subtype_mode_iw_keyboard" msgid="1787536828253289950">"希伯來文鍵盤"</string>
<string name="subtype_mode_it_keyboard" msgid="4934199655425394484">"義大利文鍵盤"</string>
<string name="subtype_mode_nb_keyboard" msgid="1175783216100212360">"挪威文鍵盤"</string>
<string name="subtype_mode_nl_keyboard" msgid="5090278083256037936">"荷蘭文鍵盤"</string>
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index f0da2744b..9b38139f0 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -107,8 +107,8 @@
<!-- Key is anchored to the right of the keyboard. -->
<flag name="right" value="2" />
</attr>
- <!-- Whether this is a modifier key such as Alt or Shift. -->
- <attr name="isModifier" format="boolean" />
+ <!-- Whether this is a functional key which has different key top than normal key. -->
+ <attr name="isFunctional" format="boolean" />
<!-- Whether this is a toggle key. -->
<attr name="isSticky" format="boolean" />
<!-- Whether long-pressing on this key will make it repeat. -->
@@ -142,6 +142,9 @@
<attr name="shiftedIcon" format="reference" />
<!-- The key is enabled and responds on press. -->
<attr name="enabled" format="boolean" />
+ <!-- Visual insets -->
+ <attr name="visualInsetsLeft" format="dimension|fraction" />
+ <attr name="visualInsetsRight" format="dimension|fraction" />
</declare-styleable>
<declare-styleable name="Keyboard_Row">
diff --git a/java/res/values/colors.xml b/java/res/values/colors.xml
index 0161589a4..733a464cc 100644
--- a/java/res/values/colors.xml
+++ b/java/res/values/colors.xml
@@ -21,11 +21,9 @@
<color name="candidate_normal">#FFFFFFFF</color>
<color name="candidate_recommended">#FFFCAE00</color>
<color name="candidate_other">#FFFCAE00</color>
- <color name="latinkeyboard_transparent">#00000000</color>
<color name="latinkeyboard_bar_language_shadow_white">#80000000</color>
<color name="latinkeyboard_bar_language_shadow_black">#80FFFFFF</color>
<color name="latinkeyboard_bar_language_text">#FFC0C0C0</color>
- <color name="latinkeyboard_extension_background">#A0000000</color>
<color name="latinkeyboard_feedback_language_text">#FFFFFFFF</color>
<color name="latinkeyboard_key_color_white">#FFFFFFFF</color>
<color name="latinkeyboard_key_color_black">#FF000000</color>
diff --git a/java/res/values/config.xml b/java/res/values/config.xml
index bdb4409f0..32fb5bf1a 100644
--- a/java/res/values/config.xml
+++ b/java/res/values/config.xml
@@ -49,8 +49,6 @@
<integer name="config_final_fadeout_percentage_of_language_on_spacebar">15</integer>
<integer name="config_delay_before_preview">0</integer>
<integer name="config_delay_after_preview">10</integer>
- <integer name="config_preview_fadein_anim_time">0</integer>
- <integer name="config_preview_fadeout_anim_time">70</integer>
<integer name="config_mini_keyboard_fadein_anim_time">0</integer>
<integer name="config_mini_keyboard_fadeout_anim_time">100</integer>
<integer name="config_delay_before_key_repeat_start">400</integer>
diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml
index 7f00cdba3..0a0b16d47 100644
--- a/java/res/values/dimens.xml
+++ b/java/res/values/dimens.xml
@@ -19,7 +19,7 @@
-->
<resources>
- <!-- keyboardHeight = key_height*4 + key_bottom_gap*3 -->
+ <!-- keyboardHeight = key_height*4 + key_bottom_gap*3, key_height=0.290in -->
<dimen name="keyboardHeight">1.265in</dimen>
<!-- key_height + key_bottom_gap = popup_key_height -->
<!-- <dimen name="key_height">0.290in</dimen> -->
@@ -28,26 +28,33 @@
<dimen name="popup_key_height">0.325in</dimen>
<dimen name="keyboard_top_padding">0.00in</dimen>
<dimen name="keyboard_bottom_padding">0.06in</dimen>
- <!-- key_preview_text_size_large x 2 -->
- <dimen name="key_preview_height">80sp</dimen>
+ <dimen name="keyboard_horizontal_edges_padding">0.0in</dimen>
+ <dimen name="mini_keyboard_horizontal_padding">16dip</dimen>
+ <dimen name="mini_keyboard_horizontal_padding_holo">32dip</dimen>
<dimen name="mini_keyboard_key_horizontal_padding">8dip</dimen>
<!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. -->
<!-- popup_key_height x 1.2 -->
<dimen name="mini_keyboard_slide_allowance">0.390in</dimen>
<!-- popup_key_height x -1.0 -->
<dimen name="mini_keyboard_vertical_correction">-0.325in</dimen>
+ <!-- We use "inch", not "dip" because this value tries dealing with physical distance related
+ to user's finger. -->
+ <dimen name="keyboard_vertical_correction">-0.05in</dimen>
<dimen name="key_letter_size">0.13in</dimen>
<dimen name="key_label_text_size">0.083in</dimen>
- <dimen name="key_preview_text_size_large">40sp</dimen>
<!-- left or right padding of label alignment -->
<dimen name="key_label_horizontal_alignment_padding">0.13in</dimen>
+ <dimen name="key_preview_height">80sp</dimen>
<dimen name="key_preview_offset">0.000in</dimen>
- <!-- We use "inch", not "dip" because this value tries dealing with physical distance related
- to user's finger. -->
- <dimen name="keyboard_vertical_correction">-0.05in</dimen>
+ <dimen name="key_preview_text_size_large">36sp</dimen>
+ <dimen name="key_preview_height_holo">130sp</dimen>
+ <dimen name="key_preview_offset_holo">0.193in</dimen>
<dimen name="candidate_strip_height">42dip</dimen>
+ <!-- candidate_strip_minimum_height =
+ key_preview_height_holo - key_preview_offset_holo + alpha -->
+ <dimen name="candidate_strip_minimum_height">100sp</dimen>
<dimen name="candidate_strip_fading_edge_length">63dip</dimen>
<dimen name="candidate_strip_padding">0dip</dimen>
<dimen name="candidate_min_width">0.3in</dimen>
diff --git a/java/res/values/donottranslate-altchars.xml b/java/res/values/donottranslate-altchars.xml
index 518e74af1..621a2ea92 100644
--- a/java/res/values/donottranslate-altchars.xml
+++ b/java/res/values/donottranslate-altchars.xml
@@ -47,11 +47,7 @@
<string name="alternates_for_currency_dollar">¢,£,€,¥,₱</string>
<string name="alternates_for_currency_euro">¢,£,$,¥,₱</string>
<string name="alternates_for_currency_pound">¢,$,€,¥,₱</string>
- <string name="alternates_for_mic">"\@drawable/sym_keyboard_settings|\@integer/key_settings,\@drawable/sym_keyboard_mic|\@integer/key_voice"</string>
<string name="alternates_for_smiley">":-)|:-) ,:-(|:-( ,;-)|;-) ,:-P|:-P ,=-O|=-O ,:-*|:-* ,:O|:O ,B-)|B-) ,:-$|:-$ ,:-!|:-! ,:-[|:-[ ,O:-)|O:-) ,:-\\\\\\\\|:-\\\\\\\\ ,:\'(|:\'( ,:-D|:-D "</string>
- <string name="alternates_for_settings_slash">"\@drawable/sym_keyboard_settings|\@integer/key_settings,/"</string>
- <string name="alternates_for_settings_at">"\@drawable/sym_keyboard_settings|\@integer/key_settings,\@"</string>
- <string name="alternates_for_settings_comma">"\@drawable/sym_keyboard_settings|\@integer/key_settings,\\,"</string>
<string name="alternates_for_punctuation">":,/,&amp;,(,),-,+,;,\@,\',\",\?,!,\\,"</string>
<string name="keylabel_for_popular_domain">".com"</string>
<!-- popular web domains for the locale - most popular, displayed on the keyboard -->
diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml
index 3c0a9c1a2..66dc7d71c 100644
--- a/java/res/values/strings.xml
+++ b/java/res/values/strings.xml
@@ -242,6 +242,8 @@
<!-- Description for Czech keyboard subtype [CHAR LIMIT=35] -->
<string name="subtype_mode_cs_keyboard">Czech Keyboard</string>
+ <!-- Description for Arabic keyboard subtype [CHAR LIMIT=35] -->
+ <string name="subtype_mode_ar_keyboard">Arabic Keyboard</string>
<!-- Description for Danish keyboard subtype [CHAR LIMIT=35] -->
<string name="subtype_mode_da_keyboard">Danish Keyboard</string>
<!-- Description for German keyboard subtype [CHAR LIMIT=35] -->
@@ -260,6 +262,9 @@
<string name="subtype_mode_fr_CA_keyboard">French (Canada) Keyboard</string>
<!-- Description for French (Switzerland) keyboard subtype [CHAR LIMIT=35] -->
<string name="subtype_mode_fr_CH_keyboard">French (Switzerland) Keyboard</string>
+ <!-- Description for Hebrew keyboard subtype [CHAR LIMIT=35] -->
+ <!-- Java uses the deprecated "iw" code instead of the standard "he" code -->
+ <string name="subtype_mode_iw_keyboard">Hebrew Keyboard</string>
<!-- Description for Italian keyboard subtype [CHAR LIMIT=35] -->
<string name="subtype_mode_it_keyboard">Italian Keyboard</string>
<!-- Description for Norwegian keyboard subtype [CHAR LIMIT=35] -->
diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml
index 130714fd3..ef48a4bd2 100644
--- a/java/res/values/styles.xml
+++ b/java/res/values/styles.xml
@@ -35,10 +35,6 @@
<item name="backgroundDimAmount">0.5</item>
<item name="colorScheme">white</item>
</style>
- <style name="KeyPreviewAnimation">
- <item name="android:windowEnterAnimation">@anim/key_preview_fadein</item>
- <item name="android:windowExitAnimation">@anim/key_preview_fadeout</item>
- </style>
<style name="MiniKeyboardAnimation">
<item name="android:windowEnterAnimation">@anim/mini_keyboard_fadein</item>
<item name="android:windowExitAnimation">@anim/mini_keyboard_fadeout</item>
diff --git a/java/res/xml/kbd_popup_narrow_template.xml b/java/res/xml-ar/kbd_qwerty.xml
index 36caf1c15..4c6a4f50a 100644
--- a/java/res/xml/kbd_popup_narrow_template.xml
+++ b/java/res/xml-ar/kbd_qwerty.xml
@@ -2,7 +2,7 @@
<!--
/*
**
-** Copyright 2010, The Android Open Source Project
+** Copyright 2011, 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.
@@ -18,10 +18,17 @@
*/
-->
-<Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
- latin:keyWidth="9.45%p"
- latin:horizontalGap="0px"
- latin:verticalGap="0px"
- latin:rowHeight="@dimen/popup_key_height"
- >
+<Keyboard
+ xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+ latin:keyboardHeight="@dimen/keyboardHeight"
+ latin:maxKeyboardHeight="50%p"
+ latin:rowHeight="25%p"
+ latin:keyWidth="10%p"
+ latin:horizontalGap="@dimen/key_horizontal_gap"
+ latin:verticalGap="@dimen/key_bottom_gap"
+ latin:popupKeyboardTemplate="@xml/kbd_popup_template"
+ latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
+>
+ <include
+ latin:keyboardLayout="@xml/kbd_ar_rows" />
</Keyboard>
diff --git a/java/res/xml-iw/kbd_qwerty.xml b/java/res/xml-iw/kbd_qwerty.xml
index 98bfd7e0b..72826d461 100644
--- a/java/res/xml-iw/kbd_qwerty.xml
+++ b/java/res/xml-iw/kbd_qwerty.xml
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-/*
+/*
**
** Copyright 2010, 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
+** 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
+** 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
+** 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.
*/
-->
@@ -30,83 +30,5 @@
latin:maxPopupKeyboardColumn="@integer/config_max_popup_keyboard_column"
>
<include
- latin:keyboardLayout="@xml/kbd_key_styles" />
- <Row
- latin:rowEdgeFlags="top"
- >
- <Spacer
- latin:horizontalGap="5%p" />
- <Key
- latin:keyLabel="ק"
- latin:keyEdgeFlags="left" />
- <Key
- latin:keyLabel="ר" />
- <Key
- latin:keyLabel="א" />
- <Key
- latin:keyLabel="ט" />
- <Key
- latin:keyLabel="ו" />
- <Key
- latin:keyLabel="ן" />
- <Key
- latin:keyLabel="ם" />
- <Key
- latin:keyLabel="פ" />
- <Spacer
- latin:horizontalGap="1.25%p" />
- <Key
- latin:keyStyle="deleteKeyStyle"
- latin:keyWidth="13.75%p"
- latin:keyEdgeFlags="right" />
- </Row>
- <Row>
- <Key
- latin:keyLabel="ש"
- latin:keyEdgeFlags="left" />
- <Key
- latin:keyLabel="ד" />
- <Key
- latin:keyLabel="ג" />
- <Key
- latin:keyLabel="כ" />
- <Key
- latin:keyLabel="ע" />
- <Key
- latin:keyLabel="י" />
- <Key
- latin:keyLabel="ח" />
- <Key
- latin:keyLabel="ל" />
- <Key
- latin:keyLabel="ך" />
- <Key
- latin:keyLabel="ף"
- latin:keyEdgeFlags="right" />
- </Row>
- <Row>
- <Spacer
- latin:horizontalGap="5%p" />
- <Key
- latin:keyLabel="ז"
- latin:keyEdgeFlags="left" />
- <Key
- latin:keyLabel="ס" />
- <Key
- latin:keyLabel="ב" />
- <Key
- latin:keyLabel="ה" />
- <Key
- latin:keyLabel="נ" />
- <Key
- latin:keyLabel="מ" />
- <Key
- latin:keyLabel="צ" />
- <Key
- latin:keyLabel="ת" />
- <Key
- latin:keyLabel="ץ"
- latin:keyEdgeFlags="right" />
- </Row>
- <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
+ latin:keyboardLayout="@xml/kbd_iw_rows" />
</Keyboard>
diff --git a/java/res/xml-xlarge/kbd_ar_rows.xml b/java/res/xml-xlarge/kbd_ar_rows.xml
new file mode 100644
index 000000000..e84aae6b5
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_ar_rows.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2011, 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.
+*/
+-->
+
+<!-- This file for Arabic layout is an alpha version. It allows to enter -->
+<!-- some right-to-left text, but it has gone through no study whatsoever, -->
+<!-- and needs to be run through UX. -->
+<merge
+ xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+ <include
+ latin:keyboardLayout="@xml/kbd_key_styles" />
+ <Row
+ latin:keyWidth="7.49%p"
+ >
+ <Key
+ latin:keyStyle="tabKeyStyle"
+ latin:keyLabelOption="alignLeft"
+ latin:keyWidth="7.949%p"
+ latin:keyEdgeFlags="left" />
+ <Key
+ latin:keyLabel="ض" />
+ <Key
+ latin:keyLabel="ص" />
+ <Key
+ latin:keyLabel="ث" />
+ <Key
+ latin:keyLabel="ق" />
+ <Key
+ latin:keyLabel="ف"
+ latin:popupCharacters="ف,ڤ" />
+ <Key
+ latin:keyLabel="غ" />
+ <Key
+ latin:keyLabel="ع" />
+ <Key
+ latin:keyLabel="ه"
+ latin:popupCharacters="ه,هـ" />
+ <Key
+ latin:keyLabel="خ" />
+ <Key
+ latin:keyLabel="ح" />
+ <Key
+ latin:keyLabel="ج"
+ latin:popupCharacters="ج,چ" />
+ <Key
+ latin:keyStyle="deleteKeyStyle"
+ latin:keyWidth="9.331%p"
+ latin:keyEdgeFlags="right" />
+ </Row>
+ <Row
+ latin:keyWidth="7.49%p"
+ >
+ <Key
+ latin:keyStyle="toSymbolKeyStyle"
+ latin:keyLabelOption="alignLeft"
+ latin:keyWidth="7.949%p"
+ latin:keyEdgeFlags="left" />
+ <Key
+ latin:keyLabel="ش" />
+ <Key
+ latin:keyLabel="س" />
+ <Key
+ latin:keyLabel="ي" />
+ <Key
+ latin:keyLabel="ب"
+ latin:popupCharacters="ب,پ" />
+ <Key
+ latin:keyLabel="ل"
+ latin:popupCharacters="ل,لا" />
+ <Key
+ latin:keyLabel="ا"
+ latin:popupCharacters="ا,أ,إ,آ" />
+ <Key
+ latin:keyLabel="ت" />
+ <Key
+ latin:keyLabel="ن" />
+ <Key
+ latin:keyLabel="م" />
+ <Key
+ latin:keyLabel="ك"
+ latin:popupCharacters="ك,گ" />
+ <Key
+ latin:keyLabel="ط" />
+ <Key
+ latin:keyStyle="returnKeyStyle"
+ latin:keyWidth="8.593%p"
+ latin:keyEdgeFlags="right" />
+ </Row>
+ <Row
+ latin:keyWidth="8.042%p"
+ >
+ <Key
+ latin:keyLabel="ئ"
+ latin:keyEdgeFlags="left" />
+ <Key
+ latin:keyLabel="ء" />
+ <Key
+ latin:keyLabel="ؤ" />
+ <Key
+ latin:keyLabel="ر" />
+ <Key
+ latin:keyLabel="ذ" />
+ <Key
+ latin:keyLabel="ى" />
+ <Key
+ latin:keyLabel="ة" />
+ <Key
+ latin:keyLabel="و" />
+ <Key
+ latin:keyLabel="ز"
+ latin:popupCharacters="ز,ژ" />
+ <Key
+ latin:keyLabel="ظ" />
+ <Key
+ latin:keyLabel="د" />
+ <Key
+ latin:keyStyle="shiftKeyStyle"
+ latin:keyWidth="11.736%p"
+ latin:keyEdgeFlags="right" />
+ </Row>
+ <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
+</merge>
diff --git a/java/res/xml-xlarge/kbd_iw_rows.xml b/java/res/xml-xlarge/kbd_iw_rows.xml
new file mode 100644
index 000000000..a3a239dbf
--- /dev/null
+++ b/java/res/xml-xlarge/kbd_iw_rows.xml
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2011, 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.
+*/
+-->
+
+<merge
+ xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+ <include
+ latin:keyboardLayout="@xml/kbd_key_styles" />
+ <Row
+ latin:keyWidth="8.272%p"
+ >
+ <Key
+ latin:keyStyle="tabKeyStyle"
+ latin:keyLabelOption="alignLeft"
+ latin:keyWidth="7.949%p"
+ latin:keyEdgeFlags="left" />
+ <Key
+ latin:keyLabel="," />
+ <Key
+ latin:keyLabel="." />
+ <Key
+ latin:keyLabel="ק" />
+ <Key
+ latin:keyLabel="ר" />
+ <Key
+ latin:keyLabel="א" />
+ <Key
+ latin:keyLabel="ט" />
+ <Key
+ latin:keyLabel="ו" />
+ <Key
+ latin:keyLabel="ן" />
+ <Key
+ latin:keyLabel="ם" />
+ <Key
+ latin:keyLabel="פ" />
+ <Key
+ latin:keyStyle="deleteKeyStyle"
+ latin:keyWidth="9.331%p"
+ latin:keyEdgeFlags="right" />
+ </Row>
+ <Row
+ latin:keyWidth="8.157%p"
+ >
+ <Key
+ latin:keyStyle="toSymbolKeyStyle"
+ latin:keyLabelOption="alignLeft"
+ latin:keyWidth="10.167%p"
+ latin:keyEdgeFlags="left" />
+ <Key
+ latin:keyLabel="ש" />
+ <Key
+ latin:keyLabel="ד" />
+ <Key
+ latin:keyLabel="ג"
+ latin:popupCharacters="ג,ג׳" />
+ <Key
+ latin:keyLabel="כ" />
+ <Key
+ latin:keyLabel="ע" />
+ <Key
+ latin:keyLabel="י"
+ latin:popupCharacters="י,ײַ" />
+ <Key
+ latin:keyLabel="ח"
+ latin:popupCharacters="ח,ח׳" />
+ <Key
+ latin:keyLabel="ל" />
+ <Key
+ latin:keyLabel="ך" />
+ <Key
+ latin:keyLabel="ף" />
+ <Key
+ latin:keyStyle="returnKeyStyle"
+ latin:keyWidth="8.593%p"
+ latin:keyEdgeFlags="right" />
+ </Row>
+ <Row
+ latin:keyWidth="8.042%p"
+ >
+ <Key
+ latin:keyStyle="shiftKeyStyle"
+ latin:keyWidth="15.192%p"
+ latin:keyEdgeFlags="left" />
+ <Key
+ latin:keyLabel="ז"
+ latin:popupCharacters="ז,ז׳" />
+ <Key
+ latin:keyLabel="ס" />
+ <Key
+ latin:keyLabel="ב" />
+ <Key
+ latin:keyLabel="ה" />
+ <Key
+ latin:keyLabel="נ" />
+ <Key
+ latin:keyLabel="מ" />
+ <Key
+ latin:keyLabel="צ"
+ latin:popupCharacters="צ,צ׳" />
+ <Key
+ latin:keyLabel="ת"
+ latin:popupCharacters="ת,ת׳" />
+ <Key
+ latin:keyLabel="ץ"
+ latin:popupCharacters="ץ,ץ׳" />
+ <Key
+ latin:keyStyle="shiftKeyStyle"
+ latin:keyWidth="12.530%p"
+ latin:keyEdgeFlags="right" />
+ </Row>
+ <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
+</merge>
diff --git a/java/res/xml-xlarge/kbd_key_styles.xml b/java/res/xml-xlarge/kbd_key_styles.xml
index fc06d00fc..4fefe0056 100644
--- a/java/res/xml-xlarge/kbd_key_styles.xml
+++ b/java/res/xml-xlarge/kbd_key_styles.xml
@@ -28,7 +28,7 @@
>
<key-style
latin:styleName="functionalKeyStyle"
- latin:isModifier="true" />
+ latin:isFunctional="true" />
<key-style
latin:styleName="shiftKeyStyle"
latin:code="@integer/key_shift"
diff --git a/java/res/xml/kbd_ar_rows.xml b/java/res/xml/kbd_ar_rows.xml
new file mode 100644
index 000000000..d5264fd2d
--- /dev/null
+++ b/java/res/xml/kbd_ar_rows.xml
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2011, 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.
+*/
+-->
+
+<!-- This file for Arabic layout is an alpha version. It allows to enter -->
+<!-- some right-to-left text, but it has gone through no study whatsoever, -->
+<!-- and needs to be run through UX. -->
+<merge
+ xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+ <include
+ latin:keyboardLayout="@xml/kbd_key_styles" />
+ <Row
+ latin:keyWidth="10%p"
+ >
+ <Key
+ latin:keyLabel="ض"
+ latin:keyEdgeFlags="left" />
+ <Key
+ latin:keyLabel="ص" />
+ <Key
+ latin:keyLabel="ق" />
+ <Key
+ latin:keyLabel="ف"
+ latin:popupCharacters="ڤ" />
+ <Key
+ latin:keyLabel="غ" />
+ <Key
+ latin:keyLabel="ع" />
+ <Key
+ latin:keyLabel="ه"
+ latin:popupCharacters="هـ" />
+ <Key
+ latin:keyLabel="خ" />
+ <Key
+ latin:keyLabel="ح" />
+ <Key
+ latin:keyLabel="ج"
+ latin:popupCharacters="چ"
+ latin:keyEdgeFlags="right" />
+ </Row>
+ <Row
+ latin:keyWidth="10%p"
+ >
+ <Key
+ latin:keyLabel="ش"
+ latin:keyEdgeFlags="left" />
+ <Key
+ latin:keyLabel="س" />
+ <Key
+ latin:keyLabel="ي"
+ latin:popupCharacters="ى,ئ" />
+ <Key
+ latin:keyLabel="ب"
+ latin:popupCharacters="پ" />
+ <Key
+ latin:keyLabel="ل"
+ latin:popupCharacters="لا" />
+ <Key
+ latin:keyLabel="ا"
+ latin:popupCharacters="أ,إ,آ,ء" />
+ <Key
+ latin:keyLabel="ت" />
+ <Key
+ latin:keyLabel="ن" />
+ <Key
+ latin:keyLabel="م" />
+ <Key
+ latin:keyLabel="ك"
+ latin:popupCharacters="گ"
+ latin:keyEdgeFlags="right" />
+ </Row>
+ <Row
+ latin:keyWidth="10%p"
+ >
+ <Key
+ latin:keyLabel="ظ"
+ latin:keyEdgeFlags="left" />
+ <Key
+ latin:keyLabel="ط" />
+ <Key
+ latin:keyLabel="ذ" />
+ <Key
+ latin:keyLabel="د" />
+ <Key
+ latin:keyLabel="ز"
+ latin:popupCharacters="ژ" />
+ <Key
+ latin:keyLabel="ر" />
+ <Key
+ latin:keyLabel="و"
+ latin:popupCharacters="ؤ" />
+ <Key
+ latin:keyLabel="ة" />
+ <Key
+ latin:keyLabel="ث" />
+ <Key
+ latin:keyStyle="deleteKeyStyle"
+ latin:visualInsetsLeft="2%p"
+ latin:keyEdgeFlags="right" />
+ </Row>
+ <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
+</merge>
diff --git a/java/res/xml/kbd_azerty_rows.xml b/java/res/xml/kbd_azerty_rows.xml
index 9eeb22ecb..ab3e1a097 100644
--- a/java/res/xml/kbd_azerty_rows.xml
+++ b/java/res/xml/kbd_azerty_rows.xml
@@ -108,6 +108,7 @@
<Key
latin:keyStyle="shiftKeyStyle"
latin:keyWidth="15%p"
+ latin:visualInsetsRight="1%p"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="w"
@@ -131,6 +132,7 @@
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="15%p"
+ latin:visualInsetsLeft="1%p"
latin:keyEdgeFlags="right" />
</Row>
<include
diff --git a/java/res/xml/kbd_iw_rows.xml b/java/res/xml/kbd_iw_rows.xml
new file mode 100644
index 000000000..fb0c2a915
--- /dev/null
+++ b/java/res/xml/kbd_iw_rows.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2011, 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.
+*/
+-->
+
+<!-- This file for Hebrew layout is an alpha version. It allows to enter -->
+<!-- some right-to-left text, but it has gone through no study whatsoever, -->
+<!-- and needs to be run through UX. -->
+<merge
+ xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+ <include
+ latin:keyboardLayout="@xml/kbd_key_styles" />
+ <Row
+ latin:rowEdgeFlags="top"
+ >
+ <Spacer
+ latin:horizontalGap="5%p" />
+ <Key
+ latin:keyLabel="ק"
+ latin:keyEdgeFlags="left" />
+ <Key
+ latin:keyLabel="ר" />
+ <Key
+ latin:keyLabel="א" />
+ <Key
+ latin:keyLabel="ט" />
+ <Key
+ latin:keyLabel="ו" />
+ <Key
+ latin:keyLabel="ן" />
+ <Key
+ latin:keyLabel="ם" />
+ <Key
+ latin:keyLabel="פ" />
+ <Key
+ latin:keyStyle="deleteKeyStyle"
+ latin:keyWidth="15%p"
+ latin:visualInsetsLeft="1%p"
+ latin:keyEdgeFlags="right" />
+ </Row>
+ <Row>
+ <Key
+ latin:keyLabel="ש"
+ latin:keyEdgeFlags="left" />
+ <Key
+ latin:keyLabel="ד" />
+ <Key
+ latin:keyLabel="ג" />
+ <Key
+ latin:keyLabel="כ" />
+ <Key
+ latin:keyLabel="ע" />
+ <Key
+ latin:keyLabel="י" />
+ <Key
+ latin:keyLabel="ח" />
+ <Key
+ latin:keyLabel="ל" />
+ <Key
+ latin:keyLabel="ך" />
+ <Key
+ latin:keyLabel="ף"
+ latin:keyEdgeFlags="right" />
+ </Row>
+ <Row>
+ <Spacer
+ latin:horizontalGap="5%p" />
+ <Key
+ latin:keyLabel="ז"
+ latin:keyEdgeFlags="left" />
+ <Key
+ latin:keyLabel="ס" />
+ <Key
+ latin:keyLabel="ב" />
+ <Key
+ latin:keyLabel="ה" />
+ <Key
+ latin:keyLabel="נ" />
+ <Key
+ latin:keyLabel="מ" />
+ <Key
+ latin:keyLabel="צ" />
+ <Key
+ latin:keyLabel="ת" />
+ <Key
+ latin:keyLabel="ץ"
+ latin:keyEdgeFlags="right" />
+ </Row>
+ <include latin:keyboardLayout="@xml/kbd_qwerty_row4" />
+</merge>
diff --git a/java/res/xml/kbd_key_styles.xml b/java/res/xml/kbd_key_styles.xml
index 473510ec4..bfc7c4ff2 100644
--- a/java/res/xml/kbd_key_styles.xml
+++ b/java/res/xml/kbd_key_styles.xml
@@ -21,14 +21,45 @@
<merge
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
- <!-- Functional key styles -->
+ <!-- Base key style for the functional key -->
<switch>
- <case
+ <case
latin:colorScheme="white"
>
<key-style
latin:styleName="functionalKeyStyle"
- latin:isModifier="true" />
+ latin:isFunctional="true" />
+ </case>
+ <case
+ latin:colorScheme="black"
+ >
+ <key-style
+ latin:styleName="functionalKeyStyle" />
+ </case>
+ </switch>
+ <!-- Base key style for the key which may have settings key as popup key -->
+ <switch>
+ <case
+ latin:hasSettingsKey="true"
+ >
+ <key-style
+ latin:styleName="settingsPopupStyle"
+ latin:parentStyle="functionalKeyStyle" />
+ </case>
+ <!-- latin:hasSettingsKey="false" -->
+ <default>
+ <key-style
+ latin:styleName="settingsPopupStyle"
+ latin:keyHintIcon="@drawable/hint_popup"
+ latin:popupCharacters="\@drawable/sym_keyboard_settings|\@integer/key_settings"
+ latin:parentStyle="functionalKeyStyle" />
+ </default>
+ </switch>
+ <!-- Functional key styles -->
+ <switch>
+ <case
+ latin:colorScheme="white"
+ >
<key-style
latin:styleName="shiftKeyStyle"
latin:code="@integer/key_shift"
@@ -90,9 +121,7 @@
latin:code="@integer/key_voice"
latin:keyIcon="@drawable/sym_keyboard_mic"
latin:iconPreview="@drawable/sym_keyboard_feedback_mic"
- latin:keyHintIcon="@drawable/hint_popup"
- latin:popupCharacters="@string/alternates_for_mic"
- latin:parentStyle="functionalKeyStyle" />
+ latin:parentStyle="settingsPopupStyle" />
<!-- Note: This key style is not for functional tab key. This is used for the tab key
which is laid out as normal letter key. -->
<key-style
@@ -105,8 +134,6 @@
latin:colorScheme="black"
>
<key-style
- latin:styleName="functionalKeyStyle" />
- <key-style
latin:styleName="shiftKeyStyle"
latin:code="@integer/key_shift"
latin:keyIcon="@drawable/sym_bkeyboard_shift"
@@ -167,9 +194,7 @@
latin:code="@integer/key_voice"
latin:keyIcon="@drawable/sym_bkeyboard_mic"
latin:iconPreview="@drawable/sym_keyboard_feedback_mic"
- latin:keyHintIcon="@drawable/hint_popup"
- latin:popupCharacters="@string/alternates_for_mic"
- latin:parentStyle="functionalKeyStyle" />
+ latin:parentStyle="settingsPopupStyle" />
<!-- Note: This key style is not for functional tab key. This is used for the tab key
which is laid out as normal letter key. -->
<key-style
diff --git a/java/res/xml/kbd_qwerty_black_symbol.xml b/java/res/xml/kbd_qwerty_black_symbol.xml
deleted file mode 100644
index 6e45c12bf..000000000
--- a/java/res/xml/kbd_qwerty_black_symbol.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2010, 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.
-*/
--->
-
-<merge
- xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
->
- <switch>
- <case
- latin:hasSettingsKey="false"
- >
- <switch>
- <!-- When this qwerty keyboard has no voice key but voice key is enabled, then
- symbol keyboard will have mic key. That means we should use "?123mic" key here.
- -->
- <case
- latin:voiceKeyEnabled="true"
- latin:hasVoiceKey="false"
- >
- <Key
- latin:code="@integer/key_switch_alpha_symbol"
- latin:keyIcon="@drawable/sym_bkeyboard_123_mic"
- latin:iconPreview="@drawable/sym_keyboard_feedback_123_mic"
- latin:keyWidth="20%p"
- latin:isModifier="true"
- latin:keyEdgeFlags="left" />
- </case>
- <default>
- <Key
- latin:code="@integer/key_switch_alpha_symbol"
- latin:keyLabel="@string/label_to_symbol_key"
- latin:keyWidth="20%p"
- latin:isModifier="true"
- latin:keyEdgeFlags="left" />
- </default>
- </switch>
- </case>
- <case
- latin:hasSettingsKey="true"
- >
- <switch>
- <!-- When this qwerty keyboard has no voice key but voice key is enabled, then
- symbol keyboard will have mic key. That means we should use "?123mic" key here.
- -->
- <case
- latin:voiceKeyEnabled="true"
- latin:hasVoiceKey="false"
- >
- <Key
- latin:code="@integer/key_switch_alpha_symbol"
- latin:keyIcon="@drawable/sym_bkeyboard_123_mic"
- latin:iconPreview="@drawable/sym_keyboard_feedback_123_mic"
- latin:keyWidth="15%p"
- latin:isModifier="true"
- latin:keyEdgeFlags="left" />
- </case>
- <default>
- <Key
- latin:code="@integer/key_switch_alpha_symbol"
- latin:keyLabel="@string/label_to_symbol_key"
- latin:keyWidth="15%p"
- latin:isModifier="true"
- latin:keyEdgeFlags="left" />
- </default>
- </switch>
- </case>
- </switch>
-</merge>
diff --git a/java/res/xml/kbd_qwerty_f1.xml b/java/res/xml/kbd_qwerty_f1.xml
index cbdb8c09a..3ebdd1039 100644
--- a/java/res/xml/kbd_qwerty_f1.xml
+++ b/java/res/xml/kbd_qwerty_f1.xml
@@ -27,18 +27,14 @@
>
<Key
latin:keyLabel="/"
- latin:keyHintIcon="@drawable/hint_popup"
- latin:popupCharacters="@string/alternates_for_settings_slash"
- latin:isModifier="true" />
+ latin:keyStyle="settingsPopupStyle" />
</case>
<case
latin:mode="email"
>
<Key
latin:keyLabel="\@"
- latin:keyHintIcon="@drawable/hint_popup"
- latin:popupCharacters="@string/alternates_for_settings_at"
- latin:isModifier="true" />
+ latin:keyStyle="settingsPopupStyle" />
</case>
<default>
<switch>
@@ -48,15 +44,12 @@
<Key
latin:keyStyle="micKeyStyle" />
</case>
- <case
- latin:hasVoiceKey="false"
- >
+ <!-- latin:hasVoiceKey="false" -->
+ <default>
<Key
latin:keyLabel=","
- latin:keyHintIcon="@drawable/hint_popup"
- latin:popupCharacters="@string/alternates_for_settings_comma"
- latin:isModifier="true" />
- </case>
+ latin:keyStyle="settingsPopupStyle" />
+ </default>
</switch>
</default>
</switch>
diff --git a/java/res/xml/kbd_qwerty_row3.xml b/java/res/xml/kbd_qwerty_row3.xml
index 26608fd71..3d106e615 100644
--- a/java/res/xml/kbd_qwerty_row3.xml
+++ b/java/res/xml/kbd_qwerty_row3.xml
@@ -27,6 +27,7 @@
<Key
latin:keyStyle="shiftKeyStyle"
latin:keyWidth="15%p"
+ latin:visualInsetsRight="1%p"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="z"
@@ -49,6 +50,7 @@
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="15%p"
+ latin:visualInsetsLeft="1%p"
latin:keyEdgeFlags="right" />
</Row>
</merge>
diff --git a/java/res/xml/kbd_qwertz_rows.xml b/java/res/xml/kbd_qwertz_rows.xml
index 375f12335..bb41f067a 100644
--- a/java/res/xml/kbd_qwertz_rows.xml
+++ b/java/res/xml/kbd_qwertz_rows.xml
@@ -78,6 +78,7 @@
<Key
latin:keyStyle="shiftKeyStyle"
latin:keyWidth="15%p"
+ latin:visualInsetsRight="1%p"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="y"
@@ -100,6 +101,7 @@
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="15%p"
+ latin:visualInsetsLeft="1%p"
latin:keyEdgeFlags="right" />
</Row>
<include
diff --git a/java/res/xml/kbd_symbols.xml b/java/res/xml/kbd_symbols.xml
index b3b3f4ebd..0b8b89969 100644
--- a/java/res/xml/kbd_symbols.xml
+++ b/java/res/xml/kbd_symbols.xml
@@ -100,6 +100,7 @@
<Key
latin:keyStyle="altKeyStyle"
latin:keyWidth="15%p"
+ latin:visualInsetsRight="1%p"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="!"
@@ -122,6 +123,7 @@
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="15%p"
+ latin:visualInsetsLeft="1%p"
latin:keyEdgeFlags="right" />
</Row>
<include latin:keyboardLayout="@xml/kbd_symbols_row4" />
diff --git a/java/res/xml/kbd_symbols_f1.xml b/java/res/xml/kbd_symbols_f1.xml
index 8487b6158..0fb7136b9 100644
--- a/java/res/xml/kbd_symbols_f1.xml
+++ b/java/res/xml/kbd_symbols_f1.xml
@@ -28,14 +28,11 @@
<Key
latin:keyStyle="micKeyStyle" />
</case>
- <case
- latin:hasVoiceKey="false"
- >
+ <!-- latin:hasVoiceKey="false" -->
+ <default>
<Key
latin:keyLabel=","
- latin:keyHintIcon="@drawable/hint_popup"
- latin:popupCharacters="@string/alternates_for_settings_comma"
- latin:keyStyle="functionalKeyStyle" />
- </case>
+ latin:keyStyle="settingsPopupStyle" />
+ </default>
</switch>
</merge>
diff --git a/java/res/xml/kbd_symbols_shift.xml b/java/res/xml/kbd_symbols_shift.xml
index 368ee805b..36f0c64a9 100644
--- a/java/res/xml/kbd_symbols_shift.xml
+++ b/java/res/xml/kbd_symbols_shift.xml
@@ -89,6 +89,7 @@
<Key
latin:keyStyle="shiftKeyStyle"
latin:keyWidth="15%p"
+ latin:visualInsetsRight="1%p"
latin:keyEdgeFlags="left" />
<Key
latin:keyLabel="™" />
@@ -110,6 +111,7 @@
<Key
latin:keyStyle="deleteKeyStyle"
latin:keyWidth="15%p"
+ latin:visualInsetsLeft="1%p"
latin:keyEdgeFlags="right" />
</Row>
<include latin:keyboardLayout="@xml/kbd_symbols_shift_row4" />
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml
index 8dec7abec..1b122be5f 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -24,6 +24,7 @@
<!-- Voice: af, cs, da, de, en, es, fr, it, ja, ko, nl, pl, pt, ru, tr, yue, zh, zu -->
<!-- TODO: use <lang>_keyboard icon instead of a common keyboard icon. -->
<!-- TODO: use <lang>_mic icon instead of a common mic icon. -->
+<!-- TODO: remove all comment outed voice subtypes -->
<!-- If IME doesn't have an applicable subtype, the first subtype will be used as a default
subtype.-->
<input-method xmlns:android="http://schemas.android.com/apk/res/android"
@@ -34,28 +35,34 @@
android:imeSubtypeLocale="en_US"
android:imeSubtypeMode="keyboard"
/>
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_en_voice"
- android:imeSubtypeLocale="en"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_en_voice" -->
+<!-- android:imeSubtypeLocale="en" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
<subtype android:icon="@drawable/ic_subtype_keyboard"
android:label="@string/subtype_mode_en_GB_keyboard"
android:imeSubtypeLocale="en_GB"
android:imeSubtypeMode="keyboard"
/>
+ <!-- The file for Arabic layout is an alpha version. It needs to be run through UX. -->
<subtype android:icon="@drawable/ic_subtype_keyboard"
- android:label="@string/subtype_mode_cs_keyboard"
- android:imeSubtypeLocale="cs"
+ android:label="@string/subtype_mode_ar_keyboard"
+ android:imeSubtypeLocale="ar"
android:imeSubtypeMode="keyboard"
/>
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_cs_voice"
+ <subtype android:icon="@drawable/ic_subtype_keyboard"
+ android:label="@string/subtype_mode_cs_keyboard"
android:imeSubtypeLocale="cs"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
+ android:imeSubtypeMode="keyboard"
/>
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_cs_voice" -->
+<!-- android:imeSubtypeLocale="cs" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
<subtype android:icon="@drawable/ic_subtype_keyboard"
android:label="@string/subtype_mode_da_keyboard"
android:imeSubtypeLocale="da"
@@ -67,34 +74,34 @@
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="requiresGermanUmlautProcessing"
/>
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_de_voice"
- android:imeSubtypeLocale="de"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_de_voice" -->
+<!-- android:imeSubtypeLocale="de" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
<subtype android:icon="@drawable/ic_subtype_keyboard"
android:label="@string/subtype_mode_es_keyboard"
android:imeSubtypeLocale="es"
android:imeSubtypeMode="keyboard"
/>
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_es_voice"
- android:imeSubtypeLocale="es"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_es_voice" -->
+<!-- android:imeSubtypeLocale="es" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
<subtype android:icon="@drawable/ic_subtype_keyboard"
android:label="@string/subtype_mode_fr_keyboard"
android:imeSubtypeLocale="fr"
android:imeSubtypeMode="keyboard"
/>
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_fr_voice"
- android:imeSubtypeLocale="fr"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_fr_voice" -->
+<!-- android:imeSubtypeLocale="fr" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
<subtype android:icon="@drawable/ic_subtype_keyboard"
android:label="@string/subtype_mode_fr_CA_keyboard"
android:imeSubtypeLocale="fr_CA"
@@ -110,12 +117,19 @@
android:imeSubtypeLocale="it"
android:imeSubtypeMode="keyboard"
/>
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_it_voice"
- android:imeSubtypeLocale="it"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
+ <!-- Java uses the deprecated "iw" code instead of the standard "he" code for Hebrew. -->
+ <!-- The file for Hebrew layout is an alpha version. It needs to be run through UX. -->
+ <subtype android:icon="@drawable/ic_subtype_keyboard"
+ android:label="@string/subtype_mode_iw_keyboard"
+ android:imeSubtypeLocale="iw"
+ android:imeSubtypeMode="keyboard"
/>
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_it_voice" -->
+<!-- android:imeSubtypeLocale="it" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
<subtype android:icon="@drawable/ic_subtype_keyboard"
android:label="@string/subtype_mode_nb_keyboard"
android:imeSubtypeLocale="nb"
@@ -126,12 +140,12 @@
android:imeSubtypeLocale="nl"
android:imeSubtypeMode="keyboard"
/>
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_nl_voice"
- android:imeSubtypeLocale="nl"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_nl_voice" -->
+<!-- android:imeSubtypeLocale="nl" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
<subtype android:icon="@drawable/ic_subtype_keyboard"
android:label="@string/subtype_mode_ru_keyboard"
android:imeSubtypeLocale="ru"
@@ -147,64 +161,64 @@
android:imeSubtypeLocale="sv"
android:imeSubtypeMode="keyboard"
/>
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_af_voice"
- android:imeSubtypeLocale="af"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_ja_voice"
- android:imeSubtypeLocale="ja"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_ko_voice"
- android:imeSubtypeLocale="ko"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_pl_voice"
- android:imeSubtypeLocale="pl"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_pt_voice"
- android:imeSubtypeLocale="pt"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_ru_voice"
- android:imeSubtypeLocale="ru"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_tr_voice"
- android:imeSubtypeLocale="tr"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_yue_voice"
- android:imeSubtypeLocale="yue"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_zh_voice"
- android:imeSubtypeLocale="zh"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
- <subtype android:icon="@drawable/ic_subtype_mic"
- android:label="@string/subtype_mode_zu_voice"
- android:imeSubtypeLocale="zu"
- android:imeSubtypeMode="voice"
- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity"
- />
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_af_voice" -->
+<!-- android:imeSubtypeLocale="af" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_ja_voice" -->
+<!-- android:imeSubtypeLocale="ja" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_ko_voice" -->
+<!-- android:imeSubtypeLocale="ko" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_pl_voice" -->
+<!-- android:imeSubtypeLocale="pl" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_pt_voice" -->
+<!-- android:imeSubtypeLocale="pt" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_ru_voice" -->
+<!-- android:imeSubtypeLocale="ru" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_tr_voice" -->
+<!-- android:imeSubtypeLocale="tr" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_yue_voice" -->
+<!-- android:imeSubtypeLocale="yue" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_zh_voice" -->
+<!-- android:imeSubtypeLocale="zh" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
+<!-- <subtype android:icon="@drawable/ic_subtype_mic" -->
+<!-- android:label="@string/subtype_mode_zu_voice" -->
+<!-- android:imeSubtypeLocale="zu" -->
+<!-- android:imeSubtypeMode="voice" -->
+<!-- android:imeSubtypeExtraValue="excludeFromLastInputMethod,requireNetworkConnectivity" -->
+<!-- /> -->
</input-method>
diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml
index d031415d7..afe7be914 100644
--- a/java/res/xml/prefs.xml
+++ b/java/res/xml/prefs.xml
@@ -14,86 +14,66 @@
limitations under the License.
-->
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
- android:title="@string/english_ime_settings"
- android:key="english_ime_settings">
-
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:title="@string/english_ime_settings"
+ android:key="english_ime_settings">
<PreferenceCategory
- android:title="@string/general_category"
- android:key="general_settings">
-
+ android:title="@string/general_category"
+ android:key="general_settings">
<CheckBoxPreference
- android:key="auto_cap"
- android:title="@string/auto_cap"
- android:persistent="true"
- android:defaultValue="true"
- />
-
+ android:key="auto_cap"
+ android:title="@string/auto_cap"
+ android:persistent="true"
+ android:defaultValue="true" />
<CheckBoxPreference
- android:key="vibrate_on"
- android:title="@string/vibrate_on_keypress"
- android:persistent="true"
- />
-
+ android:key="vibrate_on"
+ android:title="@string/vibrate_on_keypress"
+ android:persistent="true" />
<CheckBoxPreference
- android:key="sound_on"
- android:title="@string/sound_on_keypress"
- android:defaultValue="@bool/config_default_sound_enabled"
- android:persistent="true"
- />
-
+ android:key="sound_on"
+ android:title="@string/sound_on_keypress"
+ android:defaultValue="@bool/config_default_sound_enabled"
+ android:persistent="true" />
<CheckBoxPreference
- android:key="popup_on"
- android:title="@string/popup_on_keypress"
- android:persistent="true"
- android:defaultValue="@bool/config_default_popup_preview"
- />
-
+ android:key="popup_on"
+ android:title="@string/popup_on_keypress"
+ android:persistent="true"
+ android:defaultValue="@bool/config_default_popup_preview" />
<CheckBoxPreference
- android:key="recorrection_enabled"
- android:title="@string/prefs_enable_recorrection"
- android:summary="@string/prefs_enable_recorrection_summary"
- android:persistent="true"
- android:defaultValue="@bool/config_default_recorrection_enabled"
- />
-
+ android:key="recorrection_enabled"
+ android:title="@string/prefs_enable_recorrection"
+ android:summary="@string/prefs_enable_recorrection_summary"
+ android:persistent="true"
+ android:defaultValue="@bool/config_default_recorrection_enabled" />
<ListPreference
- android:key="settings_key"
- android:title="@string/prefs_settings_key"
- android:persistent="true"
- android:entryValues="@array/settings_key_modes_values"
- android:entries="@array/settings_key_modes"
- android:defaultValue="@string/settings_key_mode_auto"
- />
-
+ android:key="settings_key"
+ android:title="@string/prefs_settings_key"
+ android:persistent="true"
+ android:entryValues="@array/settings_key_modes_values"
+ android:entries="@array/settings_key_modes"
+ android:defaultValue="@string/settings_key_mode_auto" />
<ListPreference
- android:key="voice_mode"
- android:title="@string/voice_input"
- android:persistent="true"
- android:entryValues="@array/voice_input_modes_values"
- android:entries="@array/voice_input_modes"
- android:defaultValue="@string/voice_mode_main"
- />
-
+ android:key="voice_mode"
+ android:title="@string/voice_input"
+ android:persistent="true"
+ android:entryValues="@array/voice_input_modes_values"
+ android:entries="@array/voice_input_modes"
+ android:defaultValue="@string/voice_mode_main" />
<PreferenceScreen
- android:key="subtype_settings"
- android:title="@string/language_selection_title"
- android:summary="@string/language_selection_summary" />
-
+ android:key="subtype_settings"
+ android:title="@string/language_selection_title"
+ android:summary="@string/language_selection_summary" />
</PreferenceCategory>
-
<PreferenceCategory
- android:title="@string/prediction_category"
- android:key="prediction_settings">
-
+ android:title="@string/prediction_category"
+ android:key="prediction_settings">
<CheckBoxPreference
android:key="quick_fixes"
android:title="@string/quick_fixes"
android:summary="@string/quick_fixes_summary"
android:persistent="true"
- android:defaultValue="true"
- />
-
+ android:defaultValue="true" />
<ListPreference
android:key="auto_correction_threshold"
android:title="@string/auto_correction"
@@ -101,9 +81,7 @@
android:persistent="true"
android:entryValues="@array/auto_correction_threshold_mode_indexes"
android:entries="@array/auto_correction_threshold_modes"
- android:defaultValue="@string/auto_correction_threshold_mode_index_modest"
- />
-
+ android:defaultValue="@string/auto_correction_threshold_mode_index_modest" />
<ListPreference
android:key="show_suggestions_setting"
android:summary="@string/prefs_show_suggestions_summary"
@@ -111,23 +89,38 @@
android:persistent="true"
android:entryValues="@array/prefs_suggestion_visibility_values"
android:entries="@array/prefs_suggestion_visibilities"
- android:defaultValue="@string/prefs_suggestion_visibility_default_value"
- />
-
+ android:defaultValue="@string/prefs_suggestion_visibility_default_value" />
<CheckBoxPreference
android:key="bigram_suggestion"
android:title="@string/bigram_suggestion"
android:summary="@string/bigram_suggestion_summary"
android:persistent="true"
- android:defaultValue="true"
- />
+ android:defaultValue="true" />
</PreferenceCategory>
-
<CheckBoxPreference
- android:key="usability_study_mode"
- android:title="@string/prefs_usability_study_mode"
- android:persistent="true"
- android:defaultValue="false"
- />
-
-</PreferenceScreen>
+ android:key="usability_study_mode"
+ android:title="@string/prefs_usability_study_mode"
+ android:persistent="true"
+ android:defaultValue="false" />
+ <CheckBoxPreference
+ android:key="enable_logging"
+ android:title="@string/prefs_enable_log"
+ android:summary="@string/prefs_description_log"
+ android:persistent="true"
+ android:defaultValue="false" />
+ <ListPreference
+ android:key="pref_keyboard_layout_20100902"
+ android:title="@string/keyboard_layout"
+ android:persistent="true"
+ android:entryValues="@array/keyboard_layout_modes_values"
+ android:entries="@array/keyboard_layout_modes"
+ android:defaultValue="@string/config_default_keyboard_theme_id" />
+ <Preference
+ android:title="Debug Settings"
+ android:key="debug_settings">
+ <intent
+ android:action="android.intent.action.MAIN"
+ android:targetPackage="com.android.inputmethod.latin"
+ android:targetClass="com.android.inputmethod.latin.DebugSettings" />
+ </Preference>
+</PreferenceScreen> \ No newline at end of file
diff --git a/java/src/com/android/inputmethod/compat/AbstractCompatWrapper.java b/java/src/com/android/inputmethod/compat/AbstractCompatWrapper.java
new file mode 100644
index 000000000..65949357f
--- /dev/null
+++ b/java/src/com/android/inputmethod/compat/AbstractCompatWrapper.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2011 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.compat;
+
+import android.util.Log;
+
+public abstract class AbstractCompatWrapper {
+ private static final String TAG = AbstractCompatWrapper.class.getSimpleName();
+ protected final Object mObj;
+
+ public AbstractCompatWrapper(Object obj) {
+ if (obj == null) {
+ Log.e(TAG, "Invalid input to AbstructCompatWrapper");
+ }
+ mObj = obj;
+ }
+
+ public Object getOriginalObject() {
+ return mObj;
+ }
+
+ public boolean hasOriginalObject() {
+ return mObj != null;
+ }
+}
diff --git a/java/src/com/android/inputmethod/compat/CompatUtils.java b/java/src/com/android/inputmethod/compat/CompatUtils.java
new file mode 100644
index 000000000..f06760e8a
--- /dev/null
+++ b/java/src/com/android/inputmethod/compat/CompatUtils.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2011 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.compat;
+
+import android.content.Intent;
+import android.text.TextUtils;
+import android.util.Log;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+public class CompatUtils {
+ private static final String TAG = CompatUtils.class.getSimpleName();
+ private static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
+ // TODO: Can these be constants instead of literal String constants?
+ private static final String INPUT_METHOD_SUBTYPE_SETTINGS =
+ "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
+ private static final String INPUT_LANGUAGE_SELECTION =
+ "com.android.inputmethod.latin.INPUT_LANGUAGE_SELECTION";
+
+ public static Intent getInputLanguageSelectionIntent(String inputMethodId,
+ int flagsForSubtypeSettings) {
+ final String action;
+ Intent intent;
+ if (android.os.Build.VERSION.SDK_INT
+ >= /* android.os.Build.VERSION_CODES.HONEYCOMB */ 11) {
+ // Refer to android.provider.Settings.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS
+ action = INPUT_METHOD_SUBTYPE_SETTINGS;
+ intent = new Intent(action);
+ if (!TextUtils.isEmpty(inputMethodId)) {
+ intent.putExtra(EXTRA_INPUT_METHOD_ID, inputMethodId);
+ }
+ if (flagsForSubtypeSettings > 0) {
+ intent.setFlags(flagsForSubtypeSettings);
+ }
+ } else {
+ action = INPUT_LANGUAGE_SELECTION;
+ intent = new Intent(action);
+ }
+ return intent;
+ }
+
+ public static Class<?> getClass(String className) {
+ try {
+ return Class.forName(className);
+ } catch (ClassNotFoundException e) {
+ return null;
+ }
+ }
+
+ public static Method getMethod(Class<?> targetClass, String name,
+ Class<?>... parameterTypes) {
+ if (targetClass == null || TextUtils.isEmpty(name)) return null;
+ try {
+ return targetClass.getMethod(name, parameterTypes);
+ } catch (SecurityException e) {
+ // ignore
+ return null;
+ } catch (NoSuchMethodException e) {
+ // ignore
+ return null;
+ }
+ }
+
+ public static Field getField(Class<?> targetClass, String name) {
+ try {
+ return targetClass.getField(name);
+ } catch (SecurityException e) {
+ // ignore
+ return null;
+ } catch (NoSuchFieldException e) {
+ // ignore
+ return null;
+ }
+ }
+
+ public static Constructor<?> getConstructor(Class<?> targetClass, Class<?>[] types) {
+ if (targetClass == null || types == null) return null;
+ try {
+ return targetClass.getConstructor(types);
+ } catch (SecurityException e) {
+ // ignore
+ return null;
+ } catch (NoSuchMethodException e) {
+ // ignore
+ return null;
+ }
+ }
+
+ public static Object invoke(
+ Object receiver, Object defaultValue, Method method, Object... args) {
+ if (receiver == null || method == null) return defaultValue;
+ try {
+ return method.invoke(receiver, args);
+ } catch (IllegalArgumentException e) {
+ Log.e(TAG, "Exception in invoke: IllegalArgumentException");
+ return defaultValue;
+ } catch (IllegalAccessException e) {
+ Log.e(TAG, "Exception in invoke: IllegalAccessException");
+ return defaultValue;
+ } catch (InvocationTargetException e) {
+ Log.e(TAG, "Exception in invoke: IllegalTargetException");
+ return defaultValue;
+ }
+ }
+
+ public static Object getFieldValue(Object receiver, Object defaultValue, Field field) {
+ if (receiver == null || field == null) return defaultValue;
+ try {
+ return field.get(receiver);
+ } catch (IllegalArgumentException e) {
+ Log.e(TAG, "Exception in getFieldValue: IllegalArgumentException");
+ return defaultValue;
+ } catch (IllegalAccessException e) {
+ Log.e(TAG, "Exception in getFieldValue: IllegalAccessException");
+ return defaultValue;
+ }
+ }
+
+ public static void setFieldValue(Object receiver, Field field, Object value) {
+ if (receiver == null || field == null) return;
+ try {
+ field.set(receiver, value);
+ } catch (IllegalArgumentException e) {
+ Log.e(TAG, "Exception in setFieldValue: IllegalArgumentException");
+ } catch (IllegalAccessException e) {
+ Log.e(TAG, "Exception in setFieldValue: IllegalAccessException");
+ }
+ }
+
+ public static List<InputMethodSubtypeCompatWrapper> copyInputMethodSubtypeListToWrapper(
+ Object listObject) {
+ if (!(listObject instanceof List<?>)) return null;
+ final List<InputMethodSubtypeCompatWrapper> subtypes =
+ new ArrayList<InputMethodSubtypeCompatWrapper>();
+ for (Object o: (List<?>)listObject) {
+ subtypes.add(new InputMethodSubtypeCompatWrapper(o));
+ }
+ return subtypes;
+ }
+}
diff --git a/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java b/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java
new file mode 100644
index 000000000..f6f4f7a59
--- /dev/null
+++ b/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2011 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.compat;
+
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputConnection;
+
+import java.lang.reflect.Field;
+
+public class EditorInfoCompatUtils {
+ private static final Field FIELD_IME_FLAG_NAVIGATE_NEXT = CompatUtils.getField(
+ EditorInfo.class, "IME_FLAG_NAVIGATE_NEXT");
+ private static final Field FIELD_IME_FLAG_NAVIGATE_PREVIOUS = CompatUtils.getField(
+ EditorInfo.class, "IME_FLAG_NAVIGATE_PREVIOUS");
+ private static final Field FIELD_IME_ACTION_PREVIOUS = CompatUtils.getField(
+ EditorInfo.class, "IME_FLAG_ACTION_PREVIOUS");
+ private static final Integer OBJ_IME_FLAG_NAVIGATE_NEXT = (Integer) CompatUtils
+ .getFieldValue(null, null, FIELD_IME_FLAG_NAVIGATE_NEXT);
+ private static final Integer OBJ_IME_FLAG_NAVIGATE_PREVIOUS = (Integer) CompatUtils
+ .getFieldValue(null, null, FIELD_IME_FLAG_NAVIGATE_PREVIOUS);
+ private static final Integer OBJ_IME_ACTION_PREVIOUS = (Integer) CompatUtils
+ .getFieldValue(null, null, FIELD_IME_ACTION_PREVIOUS);
+
+ public static boolean hasFlagNavigateNext(int imeOptions) {
+ if (OBJ_IME_FLAG_NAVIGATE_NEXT == null)
+ return false;
+ return (imeOptions & OBJ_IME_FLAG_NAVIGATE_NEXT) != 0;
+ }
+
+ public static boolean hasFlagNavigatePrevious(int imeOptions) {
+ if (OBJ_IME_FLAG_NAVIGATE_PREVIOUS == null)
+ return false;
+ return (imeOptions & OBJ_IME_FLAG_NAVIGATE_PREVIOUS) != 0;
+ }
+
+ public static void performEditorActionNext(InputConnection ic) {
+ ic.performEditorAction(EditorInfo.IME_ACTION_NEXT);
+ }
+
+ public static void performEditorActionPrevious(InputConnection ic) {
+ if (OBJ_IME_ACTION_PREVIOUS == null)
+ return;
+ ic.performEditorAction(OBJ_IME_ACTION_PREVIOUS);
+ }
+
+ public static String imeOptionsName(int imeOptions) {
+ if (imeOptions == -1)
+ return null;
+ final int actionId = imeOptions & EditorInfo.IME_MASK_ACTION;
+ final String action;
+ switch (actionId) {
+ case EditorInfo.IME_ACTION_UNSPECIFIED:
+ action = "actionUnspecified";
+ break;
+ case EditorInfo.IME_ACTION_NONE:
+ action = "actionNone";
+ break;
+ case EditorInfo.IME_ACTION_GO:
+ action = "actionGo";
+ break;
+ case EditorInfo.IME_ACTION_SEARCH:
+ action = "actionSearch";
+ break;
+ case EditorInfo.IME_ACTION_SEND:
+ action = "actionSend";
+ break;
+ case EditorInfo.IME_ACTION_DONE:
+ action = "actionDone";
+ break;
+ default: {
+ if (OBJ_IME_ACTION_PREVIOUS != null && actionId == OBJ_IME_ACTION_PREVIOUS) {
+ action = "actionPrevious";
+ } else {
+ action = "actionUnknown(" + actionId + ")";
+ }
+ break;
+ }
+ }
+ if ((imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0) {
+ return "flagNoEnterAction|" + action;
+ } else {
+ return action;
+ }
+ }
+}
diff --git a/java/src/com/android/inputmethod/compat/InputConnectionCompatUtils.java b/java/src/com/android/inputmethod/compat/InputConnectionCompatUtils.java
new file mode 100644
index 000000000..c926be06f
--- /dev/null
+++ b/java/src/com/android/inputmethod/compat/InputConnectionCompatUtils.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2011 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.compat;
+
+import com.android.inputmethod.latin.EditingUtils.SelectedWord;
+
+import android.util.Log;
+import android.view.inputmethod.InputConnection;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+public class InputConnectionCompatUtils {
+ private static final String TAG = InputConnectionCompatUtils.class.getSimpleName();
+ private static final Class<?> CLASS_CorrectionInfo = CompatUtils
+ .getClass("android.view.inputmethod.CorrectionInfo");
+ private static final Class<?>[] INPUT_TYPE_CorrectionInfo = new Class<?>[] { int.class,
+ CharSequence.class, CharSequence.class };
+ private static final Constructor<?> CONSTRUCTOR_CorrectionInfo = CompatUtils
+ .getConstructor(CLASS_CorrectionInfo, INPUT_TYPE_CorrectionInfo);
+ private static final Method METHOD_InputConnection_commitCorrection = CompatUtils
+ .getMethod(InputConnection.class, "commitCorrection", CLASS_CorrectionInfo);
+ private static final Method METHOD_getSelectedText = CompatUtils
+ .getMethod(InputConnection.class, "getSelectedText", int.class);
+ private static final Method METHOD_setComposingRegion = CompatUtils
+ .getMethod(InputConnection.class, "setComposingRegion", int.class, int.class);
+ public static final boolean RECORRECTION_SUPPORTED;
+
+ static {
+ RECORRECTION_SUPPORTED = METHOD_getSelectedText != null
+ && METHOD_setComposingRegion != null;
+ }
+
+ public static void commitCorrection(InputConnection ic, int offset, CharSequence oldText,
+ CharSequence newText) {
+ if (ic == null || CONSTRUCTOR_CorrectionInfo == null
+ || METHOD_InputConnection_commitCorrection == null) {
+ return;
+ }
+ Object[] args = { offset, oldText, newText };
+ try {
+ Object correctionInfo = CONSTRUCTOR_CorrectionInfo.newInstance(args);
+ CompatUtils.invoke(ic, null, METHOD_InputConnection_commitCorrection,
+ correctionInfo);
+ } catch (IllegalArgumentException e) {
+ Log.e(TAG, "Error in commitCorrection: IllegalArgumentException");
+ } catch (InstantiationException e) {
+ Log.e(TAG, "Error in commitCorrection: InstantiationException");
+ } catch (IllegalAccessException e) {
+ Log.e(TAG, "Error in commitCorrection: IllegalAccessException");
+ } catch (InvocationTargetException e) {
+ Log.e(TAG, "Error in commitCorrection: InvocationTargetException");
+ }
+ }
+
+
+ /**
+ * Returns the selected text between the selStart and selEnd positions.
+ */
+ public static CharSequence getSelectedText(InputConnection ic, int selStart, int selEnd) {
+ // Use reflection, for backward compatibility
+ return (CharSequence) CompatUtils.invoke(
+ ic, null, METHOD_getSelectedText, 0);
+ }
+
+ /**
+ * Tries to set the text into composition mode if there is support for it in the framework.
+ */
+ public static void underlineWord(InputConnection ic, SelectedWord word) {
+ // Use reflection, for backward compatibility
+ // If method not found, there's nothing we can do. It still works but just wont underline
+ // the word.
+ CompatUtils.invoke(
+ ic, null, METHOD_setComposingRegion, word.mStart, word.mEnd);
+ }
+}
diff --git a/java/src/com/android/inputmethod/compat/InputMethodInfoCompatWrapper.java b/java/src/com/android/inputmethod/compat/InputMethodInfoCompatWrapper.java
new file mode 100644
index 000000000..8e22bbc79
--- /dev/null
+++ b/java/src/com/android/inputmethod/compat/InputMethodInfoCompatWrapper.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2011 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.compat;
+
+import android.content.pm.ServiceInfo;
+import android.view.inputmethod.InputMethodInfo;
+
+import java.lang.reflect.Method;
+
+public class InputMethodInfoCompatWrapper {
+ private final InputMethodInfo mImi;
+ private static final Method METHOD_getSubtypeAt = CompatUtils.getMethod(
+ InputMethodInfo.class, "getSubtypeAt", int.class);
+ private static final Method METHOD_getSubtypeCount = CompatUtils.getMethod(
+ InputMethodInfo.class, "getSubtypeCount");
+
+ public InputMethodInfoCompatWrapper(InputMethodInfo imi) {
+ mImi = imi;
+ }
+
+ public InputMethodInfo getInputMethodInfo() {
+ return mImi;
+ }
+
+ public String getId() {
+ return mImi.getId();
+ }
+
+ public String getPackageName() {
+ return mImi.getPackageName();
+ }
+
+ public ServiceInfo getServiceInfo() {
+ return mImi.getServiceInfo();
+ }
+
+ public int getSubtypeCount() {
+ return (Integer) CompatUtils.invoke(mImi, 0, METHOD_getSubtypeCount);
+ }
+
+ public InputMethodSubtypeCompatWrapper getSubtypeAt(int index) {
+ return new InputMethodSubtypeCompatWrapper(CompatUtils.invoke(mImi, null,
+ METHOD_getSubtypeAt, index));
+ }
+}
diff --git a/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java b/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java
new file mode 100644
index 000000000..2b7e25591
--- /dev/null
+++ b/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java
@@ -0,0 +1,223 @@
+/*
+ * Copyright (C) 2011 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.compat;
+
+import com.android.inputmethod.deprecated.LanguageSwitcherProxy;
+import com.android.inputmethod.latin.LatinIME;
+import com.android.inputmethod.latin.SubtypeSwitcher;
+import com.android.inputmethod.latin.Utils;
+
+import android.content.Context;
+import android.os.IBinder;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.inputmethod.InputMethodInfo;
+import android.view.inputmethod.InputMethodManager;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+// TODO: Override this class with the concrete implementation if we need to take care of the
+// performance.
+public class InputMethodManagerCompatWrapper {
+ private static final String TAG = InputMethodManagerCompatWrapper.class.getSimpleName();
+ private static final Method METHOD_getCurrentInputMethodSubtype =
+ CompatUtils.getMethod(InputMethodManager.class, "getCurrentInputMethodSubtype");
+ private static final Method METHOD_getEnabledInputMethodSubtypeList =
+ CompatUtils.getMethod(InputMethodManager.class, "getEnabledInputMethodSubtypeList",
+ InputMethodInfo.class, boolean.class);
+ private static final Method METHOD_getShortcutInputMethodsAndSubtypes =
+ CompatUtils.getMethod(InputMethodManager.class, "getShortcutInputMethodsAndSubtypes");
+ private static final Method METHOD_setInputMethodAndSubtype =
+ CompatUtils.getMethod(
+ InputMethodManager.class, "setInputMethodAndSubtype", IBinder.class,
+ String.class, InputMethodSubtypeCompatWrapper.CLASS_InputMethodSubtype);
+ private static final Method METHOD_switchToLastInputMethod = CompatUtils.getMethod(
+ InputMethodManager.class, "switchToLastInputMethod", IBinder.class);
+
+ private static final InputMethodManagerCompatWrapper sInstance =
+ new InputMethodManagerCompatWrapper();
+
+ public static final boolean SUBTYPE_SUPPORTED;
+
+ static {
+ // This static initializer guarantees that METHOD_getShortcutInputMethodsAndSubtypes is
+ // already instantiated.
+ SUBTYPE_SUPPORTED = METHOD_getShortcutInputMethodsAndSubtypes != null;
+ }
+
+ // For the compatibility, IMM will create dummy subtypes if subtypes are not found.
+ // This is required to be false if the current behavior is broken. For now, it's ok to be true.
+ private static final boolean ALLOW_DUMMY_SUBTYPE = true;
+ private static final boolean HAS_VOICE_FUNCTION = true;
+ private static final String VOICE_MODE = "voice";
+ private static final String KEYBOARD_MODE = "keyboard";
+
+ private InputMethodManager mImm;
+ private LanguageSwitcherProxy mLanguageSwitcherProxy;
+ private String mLatinImePackageName;
+
+ private InputMethodManagerCompatWrapper() {
+ }
+
+ public static InputMethodManagerCompatWrapper getInstance(Context context) {
+ if (sInstance.mImm == null) {
+ sInstance.init(context);
+ }
+ return sInstance;
+ }
+
+ private synchronized void init(Context context) {
+ mImm = (InputMethodManager) context.getSystemService(
+ Context.INPUT_METHOD_SERVICE);
+ if (context instanceof LatinIME) {
+ mLatinImePackageName = context.getPackageName();
+ }
+ mLanguageSwitcherProxy = LanguageSwitcherProxy.getInstance();
+ }
+
+ public InputMethodSubtypeCompatWrapper getCurrentInputMethodSubtype() {
+ if (!SUBTYPE_SUPPORTED) {
+ return new InputMethodSubtypeCompatWrapper(
+ 0, 0, mLanguageSwitcherProxy.getInputLocale().toString(), KEYBOARD_MODE, "");
+ }
+ Object o = CompatUtils.invoke(mImm, null, METHOD_getCurrentInputMethodSubtype);
+ return new InputMethodSubtypeCompatWrapper(o);
+ }
+
+ public List<InputMethodSubtypeCompatWrapper> getEnabledInputMethodSubtypeList(
+ InputMethodInfoCompatWrapper imi, boolean allowsImplicitlySelectedSubtypes) {
+ if (!SUBTYPE_SUPPORTED) {
+ String[] languages = mLanguageSwitcherProxy.getEnabledLanguages(
+ allowsImplicitlySelectedSubtypes);
+ List<InputMethodSubtypeCompatWrapper> subtypeList =
+ new ArrayList<InputMethodSubtypeCompatWrapper>();
+ for (String lang: languages) {
+ subtypeList.add(new InputMethodSubtypeCompatWrapper(0, 0, lang, KEYBOARD_MODE, ""));
+ }
+ return subtypeList;
+ }
+ Object retval = CompatUtils.invoke(mImm, null, METHOD_getEnabledInputMethodSubtypeList,
+ (imi != null ? imi.getInputMethodInfo() : null), allowsImplicitlySelectedSubtypes);
+ if (retval == null || !(retval instanceof List) || ((List<?>)retval).isEmpty()) {
+ if (!ALLOW_DUMMY_SUBTYPE) {
+ // Returns an empty list
+ return Collections.emptyList();
+ }
+ // Creates dummy subtypes
+ List<InputMethodSubtypeCompatWrapper> subtypeList =
+ new ArrayList<InputMethodSubtypeCompatWrapper>();
+ InputMethodSubtypeCompatWrapper keyboardSubtype = getLastResortSubtype(KEYBOARD_MODE);
+ InputMethodSubtypeCompatWrapper voiceSubtype = getLastResortSubtype(VOICE_MODE);
+ if (keyboardSubtype != null) {
+ subtypeList.add(keyboardSubtype);
+ }
+ if (voiceSubtype != null) {
+ subtypeList.add(voiceSubtype);
+ }
+ return subtypeList;
+ }
+ return CompatUtils.copyInputMethodSubtypeListToWrapper((List<?>)retval);
+ }
+
+ private InputMethodInfoCompatWrapper getLatinImeInputMethodInfo() {
+ if (TextUtils.isEmpty(mLatinImePackageName))
+ return null;
+ return Utils.getInputMethodInfo(this, mLatinImePackageName);
+ }
+
+ @SuppressWarnings("unused")
+ private InputMethodSubtypeCompatWrapper getLastResortSubtype(String mode) {
+ if (VOICE_MODE.equals(mode) && !HAS_VOICE_FUNCTION)
+ return null;
+ Locale inputLocale = SubtypeSwitcher.getInstance().getInputLocale();
+ if (inputLocale == null)
+ return null;
+ return new InputMethodSubtypeCompatWrapper(0, 0, inputLocale.toString(), mode, "");
+ }
+
+ public Map<InputMethodInfoCompatWrapper, List<InputMethodSubtypeCompatWrapper>>
+ getShortcutInputMethodsAndSubtypes() {
+ Object retval = CompatUtils.invoke(mImm, null, METHOD_getShortcutInputMethodsAndSubtypes);
+ if (retval == null || !(retval instanceof Map) || ((Map<?, ?>)retval).isEmpty()) {
+ if (!ALLOW_DUMMY_SUBTYPE) {
+ // Returns an empty map
+ return Collections.emptyMap();
+ }
+ // Creates dummy subtypes
+ InputMethodInfoCompatWrapper imi = getLatinImeInputMethodInfo();
+ InputMethodSubtypeCompatWrapper voiceSubtype = getLastResortSubtype(VOICE_MODE);
+ if (imi != null && voiceSubtype != null) {
+ Map<InputMethodInfoCompatWrapper, List<InputMethodSubtypeCompatWrapper>>
+ shortcutMap =
+ new HashMap<InputMethodInfoCompatWrapper,
+ List<InputMethodSubtypeCompatWrapper>>();
+ List<InputMethodSubtypeCompatWrapper> subtypeList =
+ new ArrayList<InputMethodSubtypeCompatWrapper>();
+ subtypeList.add(voiceSubtype);
+ shortcutMap.put(imi, subtypeList);
+ return shortcutMap;
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+ Map<InputMethodInfoCompatWrapper, List<InputMethodSubtypeCompatWrapper>> shortcutMap =
+ new HashMap<InputMethodInfoCompatWrapper, List<InputMethodSubtypeCompatWrapper>>();
+ final Map<?, ?> retvalMap = (Map<?, ?>)retval;
+ for (Object key : retvalMap.keySet()) {
+ if (!(key instanceof InputMethodInfo)) {
+ Log.e(TAG, "Class type error.");
+ return null;
+ }
+ shortcutMap.put(new InputMethodInfoCompatWrapper((InputMethodInfo)key),
+ CompatUtils.copyInputMethodSubtypeListToWrapper(retvalMap.get(key)));
+ }
+ return shortcutMap;
+ }
+
+ public void setInputMethodAndSubtype(
+ IBinder token, String id, InputMethodSubtypeCompatWrapper subtype) {
+ CompatUtils.invoke(mImm, null, METHOD_setInputMethodAndSubtype,
+ token, id, subtype.getOriginalObject());
+ }
+
+ public boolean switchToLastInputMethod(IBinder token) {
+ if (SubtypeSwitcher.getInstance().isDummyVoiceMode()) {
+ return true;
+ }
+ return (Boolean)CompatUtils.invoke(mImm, false, METHOD_switchToLastInputMethod, token);
+ }
+
+ public List<InputMethodInfoCompatWrapper> getEnabledInputMethodList() {
+ if (mImm == null) return null;
+ List<InputMethodInfoCompatWrapper> imis = new ArrayList<InputMethodInfoCompatWrapper>();
+ for (InputMethodInfo imi : mImm.getEnabledInputMethodList()) {
+ imis.add(new InputMethodInfoCompatWrapper(imi));
+ }
+ return imis;
+ }
+
+ public void showInputMethodPicker() {
+ if (mImm == null) return;
+ mImm.showInputMethodPicker();
+ }
+}
diff --git a/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java b/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java
new file mode 100644
index 000000000..399dcf2dd
--- /dev/null
+++ b/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2011 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.compat;
+
+import com.android.inputmethod.deprecated.LanguageSwitcherProxy;
+import com.android.inputmethod.latin.SubtypeSwitcher;
+
+import android.inputmethodservice.InputMethodService;
+import android.view.inputmethod.InputMethodSubtype;
+
+public class InputMethodServiceCompatWrapper extends InputMethodService {
+ // CAN_HANDLE_ON_CURRENT_INPUT_METHOD_SUBTYPE_CHANGED needs to be false if the API level is 10
+ // or previous. Note that InputMethodSubtype was added in the API level 11.
+ // For the API level 11 or later, LatinIME should override onCurrentInputMethodSubtypeChanged().
+ // For the API level 10 or previous, we handle the "subtype changed" events by ourselves
+ // without having support from framework -- onCurrentInputMethodSubtypeChanged().
+ private static final boolean CAN_HANDLE_ON_CURRENT_INPUT_METHOD_SUBTYPE_CHANGED = true;
+
+ private InputMethodManagerCompatWrapper mImm;
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ mImm = InputMethodManagerCompatWrapper.getInstance(this);
+ }
+
+ // When the API level is 10 or previous, notifyOnCurrentInputMethodSubtypeChanged should
+ // handle the event the current subtype was changed. LatinIME calls
+ // notifyOnCurrentInputMethodSubtypeChanged every time LatinIME
+ // changes the current subtype.
+ // This call is required to let LatinIME itself know a subtype changed
+ // event when the API level is 10 or previous.
+ @SuppressWarnings("unused")
+ public void notifyOnCurrentInputMethodSubtypeChanged(InputMethodSubtypeCompatWrapper subtype) {
+ // Do nothing when the API level is 11 or later
+ if (CAN_HANDLE_ON_CURRENT_INPUT_METHOD_SUBTYPE_CHANGED) return;
+ if (subtype == null) {
+ subtype = mImm.getCurrentInputMethodSubtype();
+ }
+ if (subtype != null) {
+ if (!InputMethodManagerCompatWrapper.SUBTYPE_SUPPORTED) {
+ LanguageSwitcherProxy.getInstance().setLocale(subtype.getLocale());
+ }
+ SubtypeSwitcher.getInstance().updateSubtype(subtype);
+ }
+ }
+
+ //////////////////////////////////////
+ // Functions using API v11 or later //
+ //////////////////////////////////////
+ @Override
+ public void onCurrentInputMethodSubtypeChanged(InputMethodSubtype subtype) {
+ // Do nothing when the API level is 10 or previous
+ if (!CAN_HANDLE_ON_CURRENT_INPUT_METHOD_SUBTYPE_CHANGED) return;
+ SubtypeSwitcher.getInstance().updateSubtype(
+ new InputMethodSubtypeCompatWrapper(subtype));
+ }
+
+ protected static void setTouchableRegionCompat(InputMethodService.Insets outInsets,
+ int x, int y, int width, int height) {
+ outInsets.touchableInsets = InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
+ outInsets.touchableRegion.set(x, y, width, height);
+ }
+}
diff --git a/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatWrapper.java b/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatWrapper.java
new file mode 100644
index 000000000..86c8af37f
--- /dev/null
+++ b/java/src/com/android/inputmethod/compat/InputMethodSubtypeCompatWrapper.java
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2011 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.compat;
+
+import com.android.inputmethod.latin.LatinImeLogger;
+
+import android.text.TextUtils;
+import android.util.Log;
+
+import java.lang.reflect.Method;
+import java.util.Arrays;
+
+// TODO: Override this class with the concrete implementation if we need to take care of the
+// performance.
+public final class InputMethodSubtypeCompatWrapper extends AbstractCompatWrapper {
+ private static final boolean DBG = LatinImeLogger.sDBG;
+ private static final String TAG = InputMethodSubtypeCompatWrapper.class.getSimpleName();
+ private static final String DEFAULT_LOCALE = "en_US";
+ private static final String DEFAULT_MODE = "keyboard";
+
+ public static final Class<?> CLASS_InputMethodSubtype =
+ CompatUtils.getClass("android.view.inputmethod.InputMethodSubtype");
+ private static final Method METHOD_getNameResId =
+ CompatUtils.getMethod(CLASS_InputMethodSubtype, "getNameResId");
+ private static final Method METHOD_getIconResId =
+ CompatUtils.getMethod(CLASS_InputMethodSubtype, "getIconResId");
+ private static final Method METHOD_getLocale =
+ CompatUtils.getMethod(CLASS_InputMethodSubtype, "getLocale");
+ private static final Method METHOD_getMode =
+ CompatUtils.getMethod(CLASS_InputMethodSubtype, "getMode");
+ private static final Method METHOD_getExtraValue =
+ CompatUtils.getMethod(CLASS_InputMethodSubtype, "getExtraValue");
+ private static final Method METHOD_containsExtraValueKey =
+ CompatUtils.getMethod(CLASS_InputMethodSubtype, "containsExtraValueKey", String.class);
+ private static final Method METHOD_getExtraValueOf =
+ CompatUtils.getMethod(CLASS_InputMethodSubtype, "getExtraValueOf", String.class);
+
+ private final int mDummyNameResId;
+ private final int mDummyIconResId;
+ private final String mDummyLocale;
+ private final String mDummyMode;
+ private final String mDummyExtraValues;
+
+ public InputMethodSubtypeCompatWrapper(Object subtype) {
+ super((CLASS_InputMethodSubtype != null && CLASS_InputMethodSubtype.isInstance(subtype))
+ ? subtype : null);
+ mDummyNameResId = 0;
+ mDummyIconResId = 0;
+ mDummyLocale = DEFAULT_LOCALE;
+ mDummyMode = DEFAULT_MODE;
+ mDummyExtraValues = "";
+ }
+
+ // Constructor for creating a dummy subtype.
+ public InputMethodSubtypeCompatWrapper(int nameResId, int iconResId, String locale,
+ String mode, String extraValues) {
+ super(null);
+ if (DBG) {
+ Log.d(TAG, "CreateInputMethodSubtypeCompatWrapper");
+ }
+ mDummyNameResId = nameResId;
+ mDummyIconResId = iconResId;
+ mDummyLocale = locale != null ? locale : "";
+ mDummyMode = mode != null ? mode : "";
+ mDummyExtraValues = extraValues != null ? extraValues : "";
+ }
+
+ public int getNameResId() {
+ if (mObj == null) return mDummyNameResId;
+ return (Integer)CompatUtils.invoke(mObj, 0, METHOD_getNameResId);
+ }
+
+ public int getIconResId() {
+ if (mObj == null) return mDummyIconResId;
+ return (Integer)CompatUtils.invoke(mObj, 0, METHOD_getIconResId);
+ }
+
+ public String getLocale() {
+ if (mObj == null) return mDummyLocale;
+ final String s = (String)CompatUtils.invoke(mObj, null, METHOD_getLocale);
+ if (TextUtils.isEmpty(s)) return DEFAULT_LOCALE;
+ return s;
+ }
+
+ public String getMode() {
+ if (mObj == null) return mDummyMode;
+ String s = (String)CompatUtils.invoke(mObj, null, METHOD_getMode);
+ if (TextUtils.isEmpty(s)) return DEFAULT_MODE;
+ return s;
+ }
+
+ public String getExtraValue() {
+ if (mObj == null) return mDummyExtraValues;
+ return (String)CompatUtils.invoke(mObj, null, METHOD_getExtraValue);
+ }
+
+ public boolean containsExtraValueKey(String key) {
+ return (Boolean)CompatUtils.invoke(mObj, false, METHOD_containsExtraValueKey, key);
+ }
+
+ public String getExtraValueOf(String key) {
+ return (String)CompatUtils.invoke(mObj, null, METHOD_getExtraValueOf, key);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof InputMethodSubtypeCompatWrapper) {
+ InputMethodSubtypeCompatWrapper subtype = (InputMethodSubtypeCompatWrapper)o;
+ if (mObj == null) {
+ // easy check of dummy subtypes
+ return (mDummyNameResId == subtype.mDummyNameResId
+ && mDummyIconResId == subtype.mDummyIconResId
+ && mDummyLocale.equals(subtype.mDummyLocale)
+ && mDummyMode.equals(subtype.mDummyMode)
+ && mDummyExtraValues.equals(subtype.mDummyExtraValues));
+ }
+ return mObj.equals(subtype.getOriginalObject());
+ } else {
+ return mObj.equals(o);
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ if (mObj == null) {
+ return hashCodeInternal(mDummyNameResId, mDummyIconResId, mDummyLocale,
+ mDummyMode, mDummyExtraValues);
+ }
+ return mObj.hashCode();
+ }
+
+ private static int hashCodeInternal(int nameResId, int iconResId, String locale,
+ String mode, String extraValue) {
+ return Arrays
+ .hashCode(new Object[] { nameResId, iconResId, locale, mode, extraValue });
+ }
+}
diff --git a/java/src/com/android/inputmethod/compat/InputTypeCompatUtils.java b/java/src/com/android/inputmethod/compat/InputTypeCompatUtils.java
new file mode 100644
index 000000000..d85174188
--- /dev/null
+++ b/java/src/com/android/inputmethod/compat/InputTypeCompatUtils.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2011 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.compat;
+
+import android.text.InputType;
+
+import java.lang.reflect.Field;
+
+public class InputTypeCompatUtils {
+ private static final Field FIELD_InputType_TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS =
+ CompatUtils.getField(InputType.class, "TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS");
+ private static final Field FIELD_InputType_TYPE_TEXT_VARIATION_WEB_PASSWORD = CompatUtils
+ .getField(InputType.class, "TYPE_TEXT_VARIATION_WEB_PASSWORD");
+ private static final Field FIELD_InputType_TYPE_NUMBER_VARIATION_PASSWORD = CompatUtils
+ .getField(InputType.class, "TYPE_NUMBER_VARIATION_PASSWORD");
+ private static final Integer OBJ_InputType_TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS =
+ (Integer) CompatUtils.getFieldValue(null, null,
+ FIELD_InputType_TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS);
+ private static final Integer OBJ_InputType_TYPE_TEXT_VARIATION_WEB_PASSWORD =
+ (Integer) CompatUtils.getFieldValue(null, null,
+ FIELD_InputType_TYPE_TEXT_VARIATION_WEB_PASSWORD);
+ private static final Integer OBJ_InputType_TYPE_NUMBER_VARIATION_PASSWORD =
+ (Integer) CompatUtils.getFieldValue(null, null,
+ FIELD_InputType_TYPE_NUMBER_VARIATION_PASSWORD);
+ private static final int WEB_TEXT_PASSWORD_INPUT_TYPE;
+ private static final int NUMBER_PASSWORD_INPUT_TYPE;
+ private static final int TEXT_PASSWORD_INPUT_TYPE =
+ InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD;
+ private static final int TEXT_VISIBLE_PASSWORD_INPUT_TYPE =
+ InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
+
+ static {
+ WEB_TEXT_PASSWORD_INPUT_TYPE =
+ OBJ_InputType_TYPE_TEXT_VARIATION_WEB_PASSWORD != null
+ ? InputType.TYPE_CLASS_TEXT | OBJ_InputType_TYPE_TEXT_VARIATION_WEB_PASSWORD
+ : 0;
+ NUMBER_PASSWORD_INPUT_TYPE =
+ OBJ_InputType_TYPE_NUMBER_VARIATION_PASSWORD != null
+ ? InputType.TYPE_CLASS_NUMBER | OBJ_InputType_TYPE_NUMBER_VARIATION_PASSWORD
+ : 0;
+ }
+
+ private static boolean isWebPasswordInputType(int inputType) {
+ return WEB_TEXT_PASSWORD_INPUT_TYPE != 0
+ && inputType == WEB_TEXT_PASSWORD_INPUT_TYPE;
+ }
+
+ private static boolean isNumberPasswordInputType(int inputType) {
+ return NUMBER_PASSWORD_INPUT_TYPE != 0
+ && inputType == NUMBER_PASSWORD_INPUT_TYPE;
+ }
+
+ private static boolean isTextPasswordInputType(int inputType) {
+ return inputType == TEXT_PASSWORD_INPUT_TYPE;
+ }
+
+ private static boolean isWebEmailAddressVariation(int variation) {
+ return OBJ_InputType_TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS != null
+ && variation == OBJ_InputType_TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
+ }
+
+ public static boolean isEmailVariation(int variation) {
+ return variation == InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS
+ || isWebEmailAddressVariation(variation);
+ }
+
+ // Please refer to TextView.isPasswordInputType
+ public static boolean isPasswordInputType(int inputType) {
+ final int maskedInputType =
+ inputType & (InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION);
+ return isTextPasswordInputType(maskedInputType) || isWebPasswordInputType(maskedInputType)
+ || isNumberPasswordInputType(maskedInputType);
+ }
+
+ // Please refer to TextView.isVisiblePasswordInputType
+ public static boolean isVisiblePasswordInputType(int inputType) {
+ final int maskedInputType =
+ inputType & (InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION);
+ return maskedInputType == TEXT_VISIBLE_PASSWORD_INPUT_TYPE;
+ }
+}
diff --git a/java/src/com/android/inputmethod/compat/VibratorCompatWrapper.java b/java/src/com/android/inputmethod/compat/VibratorCompatWrapper.java
new file mode 100644
index 000000000..8e2a2e0b8
--- /dev/null
+++ b/java/src/com/android/inputmethod/compat/VibratorCompatWrapper.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2011 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.compat;
+
+import android.content.Context;
+import android.os.Vibrator;
+
+import java.lang.reflect.Method;
+
+public class VibratorCompatWrapper {
+ private static final Method METHOD_hasVibrator = CompatUtils.getMethod(Vibrator.class,
+ "hasVibrator", int.class);
+
+ private static final VibratorCompatWrapper sInstance = new VibratorCompatWrapper();
+ private Vibrator mVibrator;
+
+ private VibratorCompatWrapper() {
+ }
+
+ public static VibratorCompatWrapper getInstance(Context context) {
+ if (sInstance.mVibrator == null) {
+ sInstance.mVibrator =
+ (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
+ }
+ return sInstance;
+ }
+
+ public boolean hasVibrator() {
+ if (mVibrator == null)
+ return false;
+ return (Boolean) CompatUtils.invoke(mVibrator, true, METHOD_hasVibrator);
+ }
+}
diff --git a/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java b/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java
new file mode 100644
index 000000000..73f0b7a2d
--- /dev/null
+++ b/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2011 Google Inc.
+ *
+ * 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.deprecated;
+
+import com.android.inputmethod.compat.InputMethodManagerCompatWrapper;
+import com.android.inputmethod.deprecated.languageswitcher.LanguageSwitcher;
+import com.android.inputmethod.latin.LatinIME;
+import com.android.inputmethod.latin.Settings;
+
+import android.content.SharedPreferences;
+import android.content.res.Configuration;
+
+import java.util.Locale;
+
+// This class is used only when the IME doesn't use method.xml for language switching.
+public class LanguageSwitcherProxy implements SharedPreferences.OnSharedPreferenceChangeListener {
+ private static final LanguageSwitcherProxy sInstance = new LanguageSwitcherProxy();
+ private LanguageSwitcher mLanguageSwitcher;
+ private SharedPreferences mPrefs;
+
+ public static LanguageSwitcherProxy getInstance() {
+ if (InputMethodManagerCompatWrapper.SUBTYPE_SUPPORTED) return null;
+ return sInstance;
+ }
+
+ public static void init(LatinIME service, SharedPreferences prefs) {
+ if (InputMethodManagerCompatWrapper.SUBTYPE_SUPPORTED) return;
+ final Configuration conf = service.getResources().getConfiguration();
+ sInstance.mLanguageSwitcher = new LanguageSwitcher(service);
+ sInstance.mLanguageSwitcher.loadLocales(prefs, conf.locale);
+ sInstance.mPrefs = prefs;
+ prefs.registerOnSharedPreferenceChangeListener(sInstance);
+ }
+
+ public static void onConfigurationChanged(Configuration conf) {
+ if (InputMethodManagerCompatWrapper.SUBTYPE_SUPPORTED) return;
+ sInstance.mLanguageSwitcher.onConfigurationChanged(conf, sInstance.mPrefs);
+ }
+
+ public static void loadSettings() {
+ if (InputMethodManagerCompatWrapper.SUBTYPE_SUPPORTED) return;
+ sInstance.mLanguageSwitcher.loadLocales(sInstance.mPrefs, null);
+ }
+
+ public int getLocaleCount() {
+ return mLanguageSwitcher.getLocaleCount();
+ }
+
+ public String[] getEnabledLanguages(boolean allowImplicitlySelectedLanguages) {
+ return mLanguageSwitcher.getEnabledLanguages(allowImplicitlySelectedLanguages);
+ }
+
+ public Locale getInputLocale() {
+ return mLanguageSwitcher.getInputLocale();
+ }
+
+ public void setLocale(String localeStr) {
+ mLanguageSwitcher.setLocale(localeStr);
+ mLanguageSwitcher.persist(mPrefs);
+ }
+
+ @Override
+ public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
+ // PREF_SELECTED_LANGUAGES: enabled input subtypes
+ // PREF_INPUT_LANGUAGE: current input subtype
+ if (key.equals(Settings.PREF_SELECTED_LANGUAGES)
+ || key.equals(Settings.PREF_INPUT_LANGUAGE)) {
+ mLanguageSwitcher.loadLocales(prefs, null);
+ }
+ }
+}
diff --git a/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java b/java/src/com/android/inputmethod/deprecated/VoiceProxy.java
index 105656fe0..0d0591bd0 100644
--- a/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java
+++ b/java/src/com/android/inputmethod/deprecated/VoiceProxy.java
@@ -14,8 +14,14 @@
* the License.
*/
-package com.android.inputmethod.voice;
-
+package com.android.inputmethod.deprecated;
+
+import com.android.inputmethod.compat.InputMethodManagerCompatWrapper;
+import com.android.inputmethod.deprecated.voice.FieldContext;
+import com.android.inputmethod.deprecated.voice.Hints;
+import com.android.inputmethod.deprecated.voice.SettingsUtil;
+import com.android.inputmethod.deprecated.voice.VoiceInput;
+import com.android.inputmethod.deprecated.voice.VoiceInputLogger;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.latin.EditingUtils;
import com.android.inputmethod.latin.LatinIME;
@@ -28,6 +34,7 @@ import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.Utils;
import android.app.AlertDialog;
+import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -54,7 +61,6 @@ import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.ExtractedTextRequest;
import android.view.inputmethod.InputConnection;
-import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
import java.util.ArrayList;
@@ -62,8 +68,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-public class VoiceIMEConnector implements VoiceInput.UiListener {
- private static final VoiceIMEConnector sInstance = new VoiceIMEConnector();
+public class VoiceProxy implements VoiceInput.UiListener {
+ private static final VoiceProxy sInstance = new VoiceProxy();
public static final boolean VOICE_INSTALLED = true;
private static final boolean ENABLE_VOICE_BUTTON = true;
@@ -76,8 +82,10 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
private static final String PREF_HAS_USED_VOICE_INPUT_UNSUPPORTED_LOCALE =
"has_used_voice_input_unsupported_locale";
private static final int RECOGNITIONVIEW_HEIGHT_THRESHOLD_RATIO = 6;
+ // TODO: Adjusted on phones for now
+ private static final int RECOGNITIONVIEW_MINIMUM_HEIGHT_DIP = 244;
- private static final String TAG = VoiceIMEConnector.class.getSimpleName();
+ private static final String TAG = VoiceProxy.class.getSimpleName();
private static final boolean DEBUG = LatinImeLogger.sDBG;
private boolean mAfterVoiceInput;
@@ -93,7 +101,8 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
private boolean mVoiceButtonOnPrimary;
private boolean mVoiceInputHighlighted;
- private InputMethodManager mImm;
+ private int mMinimumVoiceRecognitionViewHeightPixel;
+ private InputMethodManagerCompatWrapper mImm;
private LatinIME mService;
private AlertDialog mVoiceWarningDialog;
private VoiceInput mVoiceInput;
@@ -101,23 +110,26 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
private Hints mHints;
private UIHandler mHandler;
private SubtypeSwitcher mSubtypeSwitcher;
+
// For each word, a list of potential replacements, usually from voice.
private final Map<String, List<CharSequence>> mWordToSuggestions =
new HashMap<String, List<CharSequence>>();
- public static VoiceIMEConnector init(LatinIME context, SharedPreferences prefs, UIHandler h) {
+ public static VoiceProxy init(LatinIME context, SharedPreferences prefs, UIHandler h) {
sInstance.initInternal(context, prefs, h);
return sInstance;
}
- public static VoiceIMEConnector getInstance() {
+ public static VoiceProxy getInstance() {
return sInstance;
}
private void initInternal(LatinIME service, SharedPreferences prefs, UIHandler h) {
mService = service;
mHandler = h;
- mImm = (InputMethodManager) service.getSystemService(Context.INPUT_METHOD_SERVICE);
+ mMinimumVoiceRecognitionViewHeightPixel = Utils.dipToPixel(
+ Utils.getDipScale(service), RECOGNITIONVIEW_MINIMUM_HEIGHT_DIP);
+ mImm = InputMethodManagerCompatWrapper.getInstance(service);
mSubtypeSwitcher = SubtypeSwitcher.getInstance();
if (VOICE_INSTALLED) {
mVoiceInput = new VoiceInput(service, this);
@@ -133,7 +145,7 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
}
}
- private VoiceIMEConnector() {
+ private VoiceProxy() {
// Intentional empty constructor for singleton.
}
@@ -536,7 +548,11 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
mService.getResources().getDisplayMetrics().heightPixels;
final int currentHeight = popupLayout.getLayoutParams().height;
final int keyboardHeight = keyboardView.getHeight();
- if (keyboardHeight > currentHeight || keyboardHeight
+ if (mMinimumVoiceRecognitionViewHeightPixel > keyboardHeight
+ || mMinimumVoiceRecognitionViewHeightPixel > currentHeight) {
+ popupLayout.getLayoutParams().height =
+ mMinimumVoiceRecognitionViewHeightPixel;
+ } else if (keyboardHeight > currentHeight || keyboardHeight
> (displayHeight / RECOGNITIONVIEW_HEIGHT_THRESHOLD_RATIO)) {
popupLayout.getLayoutParams().height = keyboardHeight;
}
@@ -560,14 +576,24 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
@Override
protected void onPostExecute(Boolean result) {
+ // Calls in this method need to be done in the same thread as the thread which
+ // called switchToLastInputMethod()
if (!result) {
if (DEBUG) {
Log.d(TAG, "Couldn't switch back to last IME.");
}
- // Needs to reset here because LatinIME failed to back to any IME and
- // the same voice subtype will be triggered in the next time.
+ // Because the current IME and subtype failed to switch to any other IME and
+ // subtype by switchToLastInputMethod, the current IME and subtype should keep
+ // being LatinIME and voice subtype in the next time. And for re-showing voice
+ // mode, the state of voice input should be reset and the voice view should be
+ // hidden.
mVoiceInput.reset();
mService.requestHideSelf(0);
+ } else {
+ // Notify an event that the current subtype was changed. This event will be
+ // handled if "onCurrentInputMethodSubtypeChanged" can't be implemented
+ // when the API level is 10 or previous.
+ mService.notifyOnCurrentInputMethodSubtypeChanged(null);
}
}
}.execute();
@@ -624,6 +650,7 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
}
private boolean shouldShowVoiceButton(FieldContext fieldContext, EditorInfo attribute) {
+ @SuppressWarnings("deprecation")
final boolean noMic = Utils.inPrivateImeOptions(null,
LatinIME.IME_OPTION_NO_MICROPHONE_COMPAT, attribute)
|| Utils.inPrivateImeOptions(mService.getPackageName(),
@@ -674,7 +701,7 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
public void onAttachedToWindow() {
// After onAttachedToWindow, we can show the voice warning dialog. See startListening()
// above.
- mSubtypeSwitcher.setVoiceInput(mVoiceInput);
+ VoiceInputWrapper.getInstance().setVoiceInput(mVoiceInput, mSubtypeSwitcher);
}
public void onConfigurationChanged(Configuration configuration) {
@@ -725,4 +752,91 @@ public class VoiceIMEConnector implements VoiceInput.UiListener {
List<String> candidates;
Map<String, List<CharSequence>> alternatives;
}
+
+ public static class VoiceLoggerWrapper {
+ private static final VoiceLoggerWrapper sInstance = new VoiceLoggerWrapper();
+ private VoiceInputLogger mLogger;
+
+ public static VoiceLoggerWrapper getInstance(Context context) {
+ if (sInstance.mLogger == null) {
+ // Not thread safe, but it's ok.
+ sInstance.mLogger = VoiceInputLogger.getLogger(context);
+ }
+ return sInstance;
+ }
+
+ // private for the singleton
+ private VoiceLoggerWrapper() {
+ }
+
+ public void settingsWarningDialogCancel() {
+ mLogger.settingsWarningDialogCancel();
+ }
+
+ public void settingsWarningDialogOk() {
+ mLogger.settingsWarningDialogOk();
+ }
+
+ public void settingsWarningDialogShown() {
+ mLogger.settingsWarningDialogShown();
+ }
+
+ public void settingsWarningDialogDismissed() {
+ mLogger.settingsWarningDialogDismissed();
+ }
+
+ public void voiceInputSettingEnabled(boolean enabled) {
+ if (enabled) {
+ mLogger.voiceInputSettingEnabled();
+ } else {
+ mLogger.voiceInputSettingDisabled();
+ }
+ }
+ }
+
+ public static class VoiceInputWrapper {
+ private static final VoiceInputWrapper sInstance = new VoiceInputWrapper();
+ private VoiceInput mVoiceInput;
+ public static VoiceInputWrapper getInstance() {
+ return sInstance;
+ }
+ public void setVoiceInput(VoiceInput voiceInput, SubtypeSwitcher switcher) {
+ if (mVoiceInput == null && voiceInput != null) {
+ mVoiceInput = voiceInput;
+ }
+ switcher.setVoiceInputWrapper(this);
+ }
+
+ private VoiceInputWrapper() {
+ }
+
+ public void cancel() {
+ if (mVoiceInput != null) mVoiceInput.cancel();
+ }
+
+ public void reset() {
+ if (mVoiceInput != null) mVoiceInput.reset();
+ }
+ }
+
+ // A list of locales which are supported by default for voice input, unless we get a
+ // different list from Gservices.
+ private static final String DEFAULT_VOICE_INPUT_SUPPORTED_LOCALES =
+ "en " +
+ "en_US " +
+ "en_GB " +
+ "en_AU " +
+ "en_CA " +
+ "en_IE " +
+ "en_IN " +
+ "en_NZ " +
+ "en_SG " +
+ "en_ZA ";
+
+ public static String getSupportedLocalesString (ContentResolver resolver) {
+ return SettingsUtil.getSettingsString(
+ resolver,
+ SettingsUtil.LATIN_IME_VOICE_INPUT_SUPPORTED_LOCALES,
+ DEFAULT_VOICE_INPUT_SUPPORTED_LOCALES);
+ }
}
diff --git a/java/src/com/android/inputmethod/deprecated/compat/VoiceInputLoggerCompatUtils.java b/java/src/com/android/inputmethod/deprecated/compat/VoiceInputLoggerCompatUtils.java
new file mode 100644
index 000000000..488390fbc
--- /dev/null
+++ b/java/src/com/android/inputmethod/deprecated/compat/VoiceInputLoggerCompatUtils.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2011 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.deprecated.compat;
+
+import com.android.common.userhappiness.UserHappinessSignals;
+import com.android.inputmethod.compat.CompatUtils;
+
+import java.lang.reflect.Method;
+
+public class VoiceInputLoggerCompatUtils {
+ public static final String EXTRA_TEXT_REPLACED_LENGTH = "length";
+ public static final String EXTRA_BEFORE_N_BEST_CHOOSE = "before";
+ public static final String EXTRA_AFTER_N_BEST_CHOOSE = "after";
+ private static final Method METHOD_UserHappinessSignals_setHasVoiceLoggingInfo =
+ CompatUtils.getMethod(UserHappinessSignals.class, "setHasVoiceLoggingInfo",
+ boolean.class);
+
+ public static void setHasVoiceLoggingInfoCompat(boolean hasLoggingInfo) {
+ CompatUtils.invoke(null, null, METHOD_UserHappinessSignals_setHasVoiceLoggingInfo,
+ hasLoggingInfo);
+ }
+}
diff --git a/java/src/com/android/inputmethod/latin/LanguageSwitcher.java b/java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java
index 6faf7f95e..e4b2e035c 100644
--- a/java/src/com/android/inputmethod/latin/LanguageSwitcher.java
+++ b/java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java
@@ -14,11 +14,19 @@
* the License.
*/
-package com.android.inputmethod.latin;
+package com.android.inputmethod.deprecated.languageswitcher;
+
+import com.android.inputmethod.compat.InputMethodSubtypeCompatWrapper;
+import com.android.inputmethod.latin.LatinIME;
+import com.android.inputmethod.latin.LatinImeLogger;
+import com.android.inputmethod.latin.Settings;
+import com.android.inputmethod.latin.SharedPreferencesCompat;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
+import android.content.res.Configuration;
import android.text.TextUtils;
+import android.util.Log;
import java.util.ArrayList;
import java.util.Locale;
@@ -28,10 +36,14 @@ import java.util.Locale;
* input language that the user has selected.
*/
public class LanguageSwitcher {
+ private static final String TAG = LanguageSwitcher.class.getSimpleName();
+
+ private static final String KEYBOARD_MODE = "keyboard";
+ private static final String[] EMPTY_STIRNG_ARRAY = new String[0];
private final ArrayList<Locale> mLocales = new ArrayList<Locale>();
private final LatinIME mIme;
- private String[] mSelectedLanguageArray;
+ private String[] mSelectedLanguageArray = EMPTY_STIRNG_ARRAY;
private String mSelectedLanguages;
private int mCurrentIndex = 0;
private String mDefaultInputLanguage;
@@ -46,15 +58,31 @@ public class LanguageSwitcher {
return mLocales.size();
}
+ public void onConfigurationChanged(Configuration conf, SharedPreferences prefs) {
+ final Locale newLocale = conf.locale;
+ if (!getSystemLocale().toString().equals(newLocale.toString())) {
+ loadLocales(prefs, newLocale);
+ }
+ }
+
/**
* Loads the currently selected input languages from shared preferences.
- * @param sp
+ * @param sp shared preference for getting the current input language and enabled languages
+ * @param systemLocale the current system locale, stored for changing the current input language
+ * based on the system current system locale.
* @return whether there was any change
*/
- public boolean loadLocales(SharedPreferences sp) {
+ public boolean loadLocales(SharedPreferences sp, Locale systemLocale) {
+ if (LatinImeLogger.sDBG) {
+ Log.d(TAG, "load locales");
+ }
+ if (systemLocale != null) {
+ setSystemLocale(systemLocale);
+ }
String selectedLanguages = sp.getString(Settings.PREF_SELECTED_LANGUAGES, null);
String currentLanguage = sp.getString(Settings.PREF_INPUT_LANGUAGE, null);
- if (selectedLanguages == null || selectedLanguages.length() < 1) {
+ if (TextUtils.isEmpty(selectedLanguages)) {
+ mSelectedLanguageArray = EMPTY_STIRNG_ARRAY;
loadDefaults();
if (mLocales.size() == 0) {
return false;
@@ -84,6 +112,9 @@ public class LanguageSwitcher {
}
private void loadDefaults() {
+ if (LatinImeLogger.sDBG) {
+ Log.d(TAG, "load default locales:");
+ }
mDefaultInputLocale = mIme.getResources().getConfiguration().locale;
String country = mDefaultInputLocale.getCountry();
mDefaultInputLanguage = mDefaultInputLocale.getLanguage() +
@@ -112,7 +143,10 @@ public class LanguageSwitcher {
/**
* Returns the list of enabled language codes.
*/
- public String[] getEnabledLanguages() {
+ public String[] getEnabledLanguages(boolean allowImplicitlySelectedLanguages) {
+ if (mSelectedLanguageArray.length == 0 && allowImplicitlySelectedLanguages) {
+ return new String[] { mDefaultInputLanguage };
+ }
return mSelectedLanguageArray;
}
@@ -151,7 +185,7 @@ public class LanguageSwitcher {
* Sets the system locale (display UI) used for comparing with the input language.
* @param locale the locale of the system
*/
- public void setSystemLocale(Locale locale) {
+ private void setSystemLocale(Locale locale) {
mSystemLocale = locale;
}
@@ -159,7 +193,7 @@ public class LanguageSwitcher {
* Returns the system locale.
* @return the system locale
*/
- public Locale getSystemLocale() {
+ private Locale getSystemLocale() {
return mSystemLocale;
}
@@ -185,6 +219,15 @@ public class LanguageSwitcher {
mCurrentIndex = prevLocaleIndex();
}
+ public void setLocale(String localeStr) {
+ final int N = mLocales.size();
+ for (int i = 0; i < N; ++i) {
+ if (mLocales.get(i).toString().equals(localeStr)) {
+ mCurrentIndex = i;
+ }
+ }
+ }
+
public void persist(SharedPreferences prefs) {
Editor editor = prefs.edit();
editor.putString(Settings.PREF_INPUT_LANGUAGE, getInputLanguage());
diff --git a/java/src/com/android/inputmethod/voice/FieldContext.java b/java/src/com/android/inputmethod/deprecated/voice/FieldContext.java
index dfdfbaa9f..0ef73d2d7 100644
--- a/java/src/com/android/inputmethod/voice/FieldContext.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/FieldContext.java
@@ -14,7 +14,7 @@
* the License.
*/
-package com.android.inputmethod.voice;
+package com.android.inputmethod.deprecated.voice;
import android.os.Bundle;
import android.util.Log;
diff --git a/java/src/com/android/inputmethod/voice/Hints.java b/java/src/com/android/inputmethod/deprecated/voice/Hints.java
index d11d3b042..52a4f4e58 100644
--- a/java/src/com/android/inputmethod/voice/Hints.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/Hints.java
@@ -14,7 +14,7 @@
* the License.
*/
-package com.android.inputmethod.voice;
+package com.android.inputmethod.deprecated.voice;
import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.SharedPreferencesCompat;
diff --git a/java/src/com/android/inputmethod/voice/RecognitionView.java b/java/src/com/android/inputmethod/deprecated/voice/RecognitionView.java
index 95a79f463..b57c16f40 100644
--- a/java/src/com/android/inputmethod/voice/RecognitionView.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/RecognitionView.java
@@ -14,7 +14,7 @@
* the License.
*/
-package com.android.inputmethod.voice;
+package com.android.inputmethod.deprecated.voice;
import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.SubtypeSwitcher;
@@ -50,7 +50,6 @@ import java.util.Locale;
* plays beeps, shows errors, etc.
*/
public class RecognitionView {
- @SuppressWarnings("unused")
private static final String TAG = "RecognitionView";
private Handler mUiHandler; // Reference to UI thread
diff --git a/java/src/com/android/inputmethod/voice/SettingsUtil.java b/java/src/com/android/inputmethod/deprecated/voice/SettingsUtil.java
index 4d746e120..7721fe268 100644
--- a/java/src/com/android/inputmethod/voice/SettingsUtil.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/SettingsUtil.java
@@ -14,7 +14,7 @@
* the License.
*/
-package com.android.inputmethod.voice;
+package com.android.inputmethod.deprecated.voice;
import android.content.ContentResolver;
import android.provider.Settings;
diff --git a/java/src/com/android/inputmethod/voice/SoundIndicator.java b/java/src/com/android/inputmethod/deprecated/voice/SoundIndicator.java
index 543290b32..8cc79de1e 100644
--- a/java/src/com/android/inputmethod/voice/SoundIndicator.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/SoundIndicator.java
@@ -14,7 +14,7 @@
* the License.
*/
-package com.android.inputmethod.voice;
+package com.android.inputmethod.deprecated.voice;
import android.content.Context;
import android.graphics.Bitmap;
diff --git a/java/src/com/android/inputmethod/voice/VoiceInput.java b/java/src/com/android/inputmethod/deprecated/voice/VoiceInput.java
index 2df9e8588..7ee0de9c9 100644
--- a/java/src/com/android/inputmethod/voice/VoiceInput.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/VoiceInput.java
@@ -14,7 +14,7 @@
* the License.
*/
-package com.android.inputmethod.voice;
+package com.android.inputmethod.deprecated.voice;
import com.android.inputmethod.latin.EditingUtils;
import com.android.inputmethod.latin.LatinImeLogger;
diff --git a/java/src/com/android/inputmethod/voice/VoiceInputLogger.java b/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java
index 3e65434a2..dcd124f70 100644
--- a/java/src/com/android/inputmethod/voice/VoiceInputLogger.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java
@@ -14,10 +14,11 @@
* the License.
*/
-package com.android.inputmethod.voice;
+package com.android.inputmethod.deprecated.voice;
import com.android.common.speech.LoggingEvents;
import com.android.common.userhappiness.UserHappinessSignals;
+import com.android.inputmethod.deprecated.compat.VoiceInputLoggerCompatUtils;
import android.content.Context;
import android.content.Intent;
@@ -212,13 +213,12 @@ public class VoiceInputLogger {
setHasLoggingInfo(true);
Intent i = newLoggingBroadcast(LoggingEvents.VoiceIme.TEXT_MODIFIED);
i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_LENGTH, suggestionLength);
- i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_REPLACED_LENGTH, replacedPhraseLength);
+ i.putExtra(VoiceInputLoggerCompatUtils.EXTRA_TEXT_REPLACED_LENGTH, replacedPhraseLength);
i.putExtra(LoggingEvents.VoiceIme.EXTRA_TEXT_MODIFIED_TYPE,
LoggingEvents.VoiceIme.TEXT_MODIFIED_TYPE_CHOOSE_SUGGESTION);
-
i.putExtra(LoggingEvents.VoiceIme.EXTRA_N_BEST_CHOOSE_INDEX, index);
- i.putExtra(LoggingEvents.VoiceIme.EXTRA_BEFORE_N_BEST_CHOOSE, before);
- i.putExtra(LoggingEvents.VoiceIme.EXTRA_AFTER_N_BEST_CHOOSE, after);
+ i.putExtra(VoiceInputLoggerCompatUtils.EXTRA_BEFORE_N_BEST_CHOOSE, before);
+ i.putExtra(VoiceInputLoggerCompatUtils.EXTRA_AFTER_N_BEST_CHOOSE, after);
mContext.sendBroadcast(i);
}
@@ -257,7 +257,7 @@ public class VoiceInputLogger {
// 2. type subject in subject field
// 3. speak message in message field
// 4. press send
- UserHappinessSignals.setHasVoiceLoggingInfo(hasLoggingInfo);
+ VoiceInputLoggerCompatUtils.setHasVoiceLoggingInfoCompat(hasLoggingInfo);
}
private boolean hasLoggingInfo(){
diff --git a/java/src/com/android/inputmethod/voice/WaveformImage.java b/java/src/com/android/inputmethod/deprecated/voice/WaveformImage.java
index 8bac669fc..a3025f252 100644
--- a/java/src/com/android/inputmethod/voice/WaveformImage.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/WaveformImage.java
@@ -14,7 +14,7 @@
* the License.
*/
-package com.android.inputmethod.voice;
+package com.android.inputmethod.deprecated.voice;
import android.graphics.Bitmap;
import android.graphics.Canvas;
diff --git a/java/src/com/android/inputmethod/voice/Whitelist.java b/java/src/com/android/inputmethod/deprecated/voice/Whitelist.java
index f4c24de0c..310689cb2 100644
--- a/java/src/com/android/inputmethod/voice/Whitelist.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/Whitelist.java
@@ -14,7 +14,7 @@
* the License.
*/
-package com.android.inputmethod.voice;
+package com.android.inputmethod.deprecated.voice;
import android.os.Bundle;
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 7396f0518..1b7e8ef21 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -61,8 +61,11 @@ public class Key {
public final int mWidth;
/** Height of the key, not including the gap */
public final int mHeight;
- /** The horizontal gap before this key */
+ /** The horizontal gap around this key */
public final int mGap;
+ /** The visual insets */
+ public final int mVisualInsetsLeft;
+ public final int mVisualInsetsRight;
/** Whether this key is sticky, i.e., a toggle key */
public final boolean mSticky;
/** X coordinate of the key in the keyboard layout */
@@ -83,8 +86,8 @@ public class Key {
* {@link Keyboard#EDGE_TOP} and {@link Keyboard#EDGE_BOTTOM}.
*/
public final int mEdgeFlags;
- /** Whether this is a modifier key, such as Shift or Alt */
- public final boolean mModifier;
+ /** Whether this is a functional key which has different key top than normal key */
+ public final boolean mFunctional;
/** Whether this key repeats itself when held down */
public final boolean mRepeatable;
@@ -93,8 +96,8 @@ public class Key {
/** The current pressed state of this key */
public boolean mPressed;
- /** If this is a sticky key, is it on? */
- public boolean mOn;
+ /** If this is a sticky key, is its highlight on? */
+ public boolean mHighlightOn;
/** Key is enabled and responds on press */
public boolean mEnabled = true;
@@ -144,13 +147,14 @@ public class Key {
mKeyboard = keyboard;
mHeight = keyboard.getRowHeight() - keyboard.getVerticalGap();
mGap = keyboard.getHorizontalGap();
+ mVisualInsetsLeft = mVisualInsetsRight = 0;
mWidth = width - mGap;
mEdgeFlags = edgeFlags;
mHintIcon = null;
mManualTemporaryUpperCaseHintIcon = null;
mManualTemporaryUpperCaseCode = Keyboard.CODE_DUMMY;
mLabelOption = 0;
- mModifier = false;
+ mFunctional = false;
mSticky = false;
mRepeatable = false;
mPopupCharacters = null;
@@ -224,12 +228,16 @@ public class Key {
mKeyboard.getMaxPopupKeyboardColumn());
mRepeatable = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isRepeatable, false);
- mModifier = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isModifier, false);
+ mFunctional = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isFunctional, false);
mSticky = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_isSticky, false);
mEnabled = style.getBoolean(keyAttr, R.styleable.Keyboard_Key_enabled, true);
mEdgeFlags = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyEdgeFlags, 0)
| row.mRowEdgeFlags;
+ mVisualInsetsLeft = KeyboardParser.getDimensionOrFraction(keyAttr,
+ R.styleable.Keyboard_Key_visualInsetsLeft, mKeyboard.getDisplayHeight(), 0);
+ mVisualInsetsRight = KeyboardParser.getDimensionOrFraction(keyAttr,
+ R.styleable.Keyboard_Key_visualInsetsRight, mKeyboard.getDisplayHeight(), 0);
mPreviewIcon = style.getDrawable(keyAttr, R.styleable.Keyboard_Key_iconPreview);
Keyboard.setDefaultBounds(mPreviewIcon);
mIcon = style.getDrawable(keyAttr, R.styleable.Keyboard_Key_keyIcon);
@@ -315,22 +323,19 @@ public class Key {
/**
* Informs the key that it has been pressed, in case it needs to change its appearance or
* state.
- * @see #onReleased(boolean)
+ * @see #onReleased()
*/
public void onPressed() {
- mPressed = !mPressed;
+ mPressed = true;
}
/**
- * Changes the pressed state of the key. If it is a sticky key, it will also change the
- * toggled state of the key if the finger was release inside.
- * @param inside whether the finger was released inside the key
+ * Informs the key that it has been released, in case it needs to change its appearance or
+ * state.
* @see #onPressed()
*/
- public void onReleased(boolean inside) {
- mPressed = !mPressed;
- if (mSticky && !mKeyboard.isShiftLockEnabled(this))
- mOn = !mOn;
+ public void onReleased() {
+ mPressed = false;
}
public boolean isInside(int x, int y) {
@@ -376,20 +381,14 @@ public class Key {
return dx * dx + dy * dy;
}
- // sticky is used for shift key. If a key is not sticky and is modifier,
- // the key will be treated as functional.
- private boolean isFunctionalKey() {
- return !mSticky && mModifier;
- }
-
/**
* Returns the drawable state for the key, based on the current state and type of the key.
* @return the drawable state of the key.
* @see android.graphics.drawable.StateListDrawable#setState(int[])
*/
public int[] getCurrentDrawableState() {
- final boolean pressed = mEnabled && mPressed;
- if (isFunctionalKey()) {
+ final boolean pressed = mPressed;
+ if (!mSticky && mFunctional) {
if (pressed) {
return KEY_STATE_FUNCTIONAL_PRESSED;
} else {
@@ -399,7 +398,7 @@ public class Key {
int[] states = KEY_STATE_NORMAL;
- if (mOn) {
+ if (mHighlightOn) {
if (pressed) {
states = KEY_STATE_PRESSED_ON;
} else {
diff --git a/java/src/com/android/inputmethod/keyboard/KeyStyles.java b/java/src/com/android/inputmethod/keyboard/KeyStyles.java
index 169f2e6c3..d464c2029 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyStyles.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyStyles.java
@@ -185,7 +185,7 @@ public class KeyStyles {
readDrawable(keyAttr, R.styleable.Keyboard_Key_iconPreview);
readDrawable(keyAttr, R.styleable.Keyboard_Key_keyHintIcon);
readDrawable(keyAttr, R.styleable.Keyboard_Key_shiftedIcon);
- readBoolean(keyAttr, R.styleable.Keyboard_Key_isModifier);
+ readBoolean(keyAttr, R.styleable.Keyboard_Key_isFunctional);
readBoolean(keyAttr, R.styleable.Keyboard_Key_isSticky);
readBoolean(keyAttr, R.styleable.Keyboard_Key_isRepeatable);
readBoolean(keyAttr, R.styleable.Keyboard_Key_enabled);
diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java
index 06d44680d..f720334f1 100644
--- a/java/src/com/android/inputmethod/keyboard/Keyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java
@@ -165,7 +165,9 @@ public class Keyboard {
GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_grid_height);
GRID_SIZE = GRID_WIDTH * GRID_HEIGHT;
- mDisplayWidth = width;
+ final int horizontalEdgesPadding = (int)res.getDimension(
+ R.dimen.keyboard_horizontal_edges_padding);
+ mDisplayWidth = width - horizontalEdgesPadding * 2;
mDisplayHeight = height;
mDefaultHorizontalGap = 0;
@@ -293,7 +295,7 @@ public class Keyboard {
public boolean setShiftLocked(boolean newShiftLockState) {
final Map<Key, Drawable> shiftedIcons = getShiftedIcons();
for (final Key key : getShiftKeys()) {
- key.mOn = newShiftLockState;
+ key.mHighlightOn = newShiftLockState;
key.setIcon(newShiftLockState ? shiftedIcons.get(key) : mNormalShiftIcons.get(key));
}
mShiftState.setShiftLocked(newShiftLockState);
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
index d09f6786e..f68b68f1d 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
@@ -16,8 +16,9 @@
package com.android.inputmethod.keyboard;
+import com.android.inputmethod.compat.EditorInfoCompatUtils;
+import com.android.inputmethod.compat.InputTypeCompatUtils;
import com.android.inputmethod.latin.R;
-import com.android.inputmethod.latin.Utils;
import android.view.inputmethod.EditorInfo;
@@ -62,8 +63,8 @@ public class KeyboardId {
this.mMode = mode;
this.mXmlId = xmlId;
this.mColorScheme = colorScheme;
- this.mPasswordInput = Utils.isPasswordInputType(inputType)
- || Utils.isVisiblePasswordInputType(inputType);
+ this.mPasswordInput = InputTypeCompatUtils.isPasswordInputType(inputType)
+ || InputTypeCompatUtils.isVisiblePasswordInputType(inputType);
this.mHasSettingsKey = hasSettingsKey;
this.mVoiceKeyEnabled = voiceKeyEnabled;
this.mHasVoiceKey = hasVoiceKey;
@@ -140,7 +141,7 @@ public class KeyboardId {
mLocale,
(mOrientation == 1 ? "port" : "land"),
modeName(mMode),
- imeOptionsName(mImeAction),
+ EditorInfoCompatUtils.imeOptionsName(mImeAction),
(mPasswordInput ? " passwordInput" : ""),
(mHasSettingsKey ? " hasSettingsKey" : ""),
(mVoiceKeyEnabled ? " voiceKeyEnabled" : ""),
@@ -170,26 +171,4 @@ public class KeyboardId {
}
return null;
}
-
- public static String imeOptionsName(int imeOptions) {
- if (imeOptions == -1) return null;
- final int actionNo = imeOptions & EditorInfo.IME_MASK_ACTION;
- final String action;
- switch (actionNo) {
- case EditorInfo.IME_ACTION_UNSPECIFIED: action = "actionUnspecified"; break;
- case EditorInfo.IME_ACTION_NONE: action = "actionNone"; break;
- case EditorInfo.IME_ACTION_GO: action = "actionGo"; break;
- case EditorInfo.IME_ACTION_SEARCH: action = "actionSearch"; break;
- case EditorInfo.IME_ACTION_SEND: action = "actionSend"; break;
- case EditorInfo.IME_ACTION_DONE: action = "actionDone"; break;
- case EditorInfo.IME_ACTION_PREVIOUS: action = "actionPrevious"; break;
- default: action = "actionUnknown(" + actionNo + ")"; break;
- }
- if ((imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0) {
- return "flagNoEnterAction|" + action;
- } else {
- return action;
- }
- }
}
-
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
index feb56ab3a..9c556c309 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
@@ -16,6 +16,7 @@
package com.android.inputmethod.keyboard;
+import com.android.inputmethod.compat.EditorInfoCompatUtils;
import com.android.inputmethod.latin.R;
import org.xmlpull.v1.XmlPullParser;
@@ -121,6 +122,7 @@ public class KeyboardParser {
private final Keyboard mKeyboard;
private final Resources mResources;
+ private int mHorizontalEdgesPadding;
private int mCurrentX = 0;
private int mCurrentY = 0;
private int mMaxRowWidth = 0;
@@ -131,6 +133,7 @@ public class KeyboardParser {
public KeyboardParser(Keyboard keyboard, Resources res) {
mKeyboard = keyboard;
mResources = res;
+ mHorizontalEdgesPadding = (int)res.getDimension(R.dimen.keyboard_horizontal_edges_padding);
}
public int getMaxRowWidth() {
@@ -150,6 +153,7 @@ public class KeyboardParser {
final String tag = parser.getName();
if (TAG_KEYBOARD.equals(tag)) {
parseKeyboardAttributes(parser);
+ startKeyboard();
parseKeyboardContent(parser, mKeyboard.getKeys());
break;
} else {
@@ -453,7 +457,7 @@ public class KeyboardParser {
booleanAttr(a, R.styleable.Keyboard_Case_hasSettingsKey, "hasSettingsKey"),
booleanAttr(a, R.styleable.Keyboard_Case_voiceKeyEnabled, "voiceKeyEnabled"),
booleanAttr(a, R.styleable.Keyboard_Case_hasVoiceKey, "hasVoiceKey"),
- textAttr(KeyboardId.imeOptionsName(
+ textAttr(EditorInfoCompatUtils.imeOptionsName(
a.getInt(R.styleable.Keyboard_Case_imeAction, -1)), "imeAction"),
textAttr(a.getString(R.styleable.Keyboard_Case_languageCode), "languageCode"),
textAttr(a.getString(R.styleable.Keyboard_Case_countryCode), "countryCode"),
@@ -519,25 +523,32 @@ public class KeyboardParser {
throw new NonEmptyTag(tag, parser);
}
+ private void startKeyboard() {
+ mCurrentY += (int)mResources.getDimension(R.dimen.keyboard_top_padding);
+ }
+
private void startRow(Row row) {
mCurrentX = 0;
+ setSpacer(mHorizontalEdgesPadding);
mCurrentRow = row;
}
private void endRow() {
if (mCurrentRow == null)
throw new InflateException("orphant end row tag");
+ setSpacer(mHorizontalEdgesPadding);
+ if (mCurrentX > mMaxRowWidth)
+ mMaxRowWidth = mCurrentX;
mCurrentY += mCurrentRow.mDefaultHeight;
mCurrentRow = null;
}
private void endKey(Key key) {
mCurrentX += key.mGap + key.mWidth;
- if (mCurrentX > mMaxRowWidth)
- mMaxRowWidth = mCurrentX;
}
private void endKeyboard(int defaultVerticalGap) {
+ mCurrentY += (int)mResources.getDimension(R.dimen.keyboard_bottom_padding);
mTotalHeight = mCurrentY - defaultVerticalGap;
}
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 64a23ab92..dd25b3427 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -16,6 +16,7 @@
package com.android.inputmethod.keyboard;
+import com.android.inputmethod.compat.InputMethodManagerCompatWrapper;
import com.android.inputmethod.latin.LatinIME;
import com.android.inputmethod.latin.LatinImeLogger;
import com.android.inputmethod.latin.R;
@@ -29,7 +30,6 @@ import android.content.res.Resources;
import android.util.Log;
import android.view.InflateException;
import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputMethodManager;
import java.lang.ref.SoftReference;
import java.util.HashMap;
@@ -263,10 +263,10 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
int xmlId = mode == KeyboardId.MODE_PHONE ? R.xml.kbd_phone : R.xml.kbd_symbols;
final String xmlName = res.getResourceEntryName(xmlId);
mSymbolsId = new KeyboardId(xmlName, xmlId, colorScheme, locale, orientation, mode,
- attribute, hasSettingsKey, mVoiceKeyEnabled, hasVoiceKey, true);
+ attribute, hasSettingsKey, mVoiceKeyEnabled, hasVoiceKey, false);
xmlId = mode == KeyboardId.MODE_PHONE ? R.xml.kbd_phone_symbols : R.xml.kbd_symbols_shift;
mSymbolsShiftedId = new KeyboardId(xmlName, xmlId, colorScheme, locale, orientation, mode,
- attribute, hasSettingsKey, mVoiceKeyEnabled, hasVoiceKey, true);
+ attribute, hasSettingsKey, mVoiceKeyEnabled, hasVoiceKey, false);
}
public int getKeyboardMode() {
@@ -565,16 +565,14 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
mCurrentId = mSymbolsShiftedId;
keyboard = getKeyboard(mCurrentId);
// Symbol shifted keyboard has an ALT key that has a caps lock style indicator. To
- // enable the indicator, we need to call enableShiftLock() and setShiftLocked(true).
- // Thus we can keep the ALT key's Key.on value true while LatinKey.onRelease() is
- // called.
+ // enable the indicator, we need to call setShiftLocked(true).
keyboard.setShiftLocked(true);
} else {
mCurrentId = mSymbolsId;
keyboard = getKeyboard(mCurrentId);
// Symbol keyboard has an ALT key that has a caps lock style indicator. To disable the
- // indicator, we need to call enableShiftLock() and setShiftLocked(false).
- keyboard.setShifted(false);
+ // indicator, we need to call setShiftLocked(false).
+ keyboard.setShiftLocked(false);
}
setKeyboard(keyboard);
}
@@ -752,8 +750,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
if (settingsKeyMode.equals(resources.getString(SETTINGS_KEY_MODE_ALWAYS_SHOW))
|| (settingsKeyMode.equals(resources.getString(SETTINGS_KEY_MODE_AUTO))
&& Utils.hasMultipleEnabledIMEsOrSubtypes(
- ((InputMethodManager) context.getSystemService(
- Context.INPUT_METHOD_SERVICE))))) {
+ (InputMethodManagerCompatWrapper.getInstance(context))))) {
return true;
}
return false;
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 61af15b1d..dee191352 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -37,7 +37,6 @@ import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
-import android.provider.Settings;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
@@ -46,8 +45,9 @@ import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewGroup.LayoutParams;
-import android.view.WindowManager;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;
@@ -111,14 +111,12 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
// Key preview popup
private boolean mInForeground;
private TextView mPreviewText;
- private PopupWindow mPreviewPopup;
private int mPreviewTextSizeLarge;
- private int[] mOffsetInWindow;
+ private final int[] mOffsetInWindow = new int[2];
private int mOldPreviewKeyIndex = KeyDetector.NOT_A_KEY;
private boolean mShowPreview = true;
private int mPopupPreviewOffsetX;
private int mPopupPreviewOffsetY;
- private int mWindowY;
private int mPopupPreviewDisplayedY;
private final int mDelayBeforePreview;
private final int mDelayAfterPreview;
@@ -126,7 +124,6 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
// Popup mini keyboard
private PopupWindow mMiniKeyboardPopup;
private KeyboardView mMiniKeyboardView;
- private View mMiniKeyboardParent;
private final WeakHashMap<Key, View> mMiniKeyboardCache = new WeakHashMap<Key, View>();
private int mMiniKeyboardOriginX;
private int mMiniKeyboardOriginY;
@@ -205,7 +202,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
showKey(msg.arg1, (PointerTracker)msg.obj);
break;
case MSG_DISMISS_PREVIEW:
- mPreviewPopup.dismiss();
+ mPreviewText.setVisibility(View.INVISIBLE);
break;
case MSG_REPEAT_KEY: {
final PointerTracker tracker = (PointerTracker)msg.obj;
@@ -228,12 +225,11 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
public void popupPreview(long delay, int keyIndex, PointerTracker tracker) {
removeMessages(MSG_POPUP_PREVIEW);
- if (mPreviewPopup.isShowing() && mPreviewText.getVisibility() == VISIBLE) {
+ if (mPreviewText.getVisibility() == VISIBLE) {
// Show right away, if it's already visible and finger is moving around
showKey(keyIndex, tracker);
} else {
- sendMessageDelayed(obtainMessage(MSG_POPUP_PREVIEW, keyIndex, 0, tracker),
- delay);
+ sendMessageDelayed(obtainMessage(MSG_POPUP_PREVIEW, keyIndex, 0, tracker), delay);
}
}
@@ -242,9 +238,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
}
public void dismissPreview(long delay) {
- if (mPreviewPopup.isShowing()) {
- sendMessageDelayed(obtainMessage(MSG_DISMISS_PREVIEW), delay);
- }
+ sendMessageDelayed(obtainMessage(MSG_DISMISS_PREVIEW), delay);
}
public void cancelDismissPreview() {
@@ -367,23 +361,17 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
final Resources res = getResources();
- mPreviewPopup = new PopupWindow(context);
if (previewLayout != 0) {
mPreviewText = (TextView) LayoutInflater.from(context).inflate(previewLayout, null);
mPreviewTextSizeLarge = (int) res.getDimension(R.dimen.key_preview_text_size_large);
- mPreviewPopup.setContentView(mPreviewText);
- mPreviewPopup.setBackgroundDrawable(null);
} else {
mShowPreview = false;
}
- mPreviewPopup.setTouchable(false);
- mPreviewPopup.setAnimationStyle(R.style.KeyPreviewAnimation);
mDelayBeforePreview = res.getInteger(R.integer.config_delay_before_preview);
mDelayAfterPreview = res.getInteger(R.integer.config_delay_after_preview);
mKeyLabelHorizontalPadding = (int)res.getDimension(
R.dimen.key_label_horizontal_alignment_padding);
- mMiniKeyboardParent = this;
mMiniKeyboardPopup = new PopupWindow(context);
mMiniKeyboardPopup.setBackgroundDrawable(null);
mMiniKeyboardPopup.setAnimationStyle(R.style.MiniKeyboardAnimation);
@@ -583,7 +571,6 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
public void setPopupOffset(int x, int y) {
mPopupPreviewOffsetX = x;
mPopupPreviewOffsetY = y;
- mPreviewPopup.dismiss();
}
/**
@@ -677,11 +664,13 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
// Switch the character to uppercase if shift is pressed
String label = key.mLabel == null? null : adjustCase(key.mLabel).toString();
+ final int keyDrawX = key.mX + key.mVisualInsetsLeft;
+ final int keyDrawWidth = key.mWidth - key.mVisualInsetsLeft - key.mVisualInsetsRight;
final Rect bounds = keyBackground.getBounds();
- if (key.mWidth != bounds.right || key.mHeight != bounds.bottom) {
- keyBackground.setBounds(0, 0, key.mWidth, key.mHeight);
+ if (keyDrawWidth != bounds.right || key.mHeight != bounds.bottom) {
+ keyBackground.setBounds(0, 0, keyDrawWidth, key.mHeight);
}
- canvas.translate(key.mX + kbdPaddingLeft, key.mY + kbdPaddingTop);
+ canvas.translate(keyDrawX + kbdPaddingLeft, key.mY + kbdPaddingTop);
keyBackground.draw(canvas);
final int rowHeight = padding.top + key.mHeight;
@@ -697,14 +686,14 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
baseline = key.mHeight -
+ labelCharHeight * KEY_LABEL_VERTICAL_PADDING_FACTOR;
if (DEBUG_SHOW_ALIGN)
- drawHorizontalLine(canvas, (int)baseline, key.mWidth, 0xc0008000,
+ drawHorizontalLine(canvas, (int)baseline, keyDrawWidth, 0xc0008000,
new Paint());
} else { // Align center
final float centerY = (key.mHeight + padding.top - padding.bottom) / 2;
baseline = centerY
+ labelCharHeight * KEY_LABEL_VERTICAL_ADJUSTMENT_FACTOR_CENTER;
if (DEBUG_SHOW_ALIGN)
- drawHorizontalLine(canvas, (int)baseline, key.mWidth, 0xc0008000,
+ drawHorizontalLine(canvas, (int)baseline, keyDrawWidth, 0xc0008000,
new Paint());
}
// Horizontal label text alignment
@@ -715,12 +704,12 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
if (DEBUG_SHOW_ALIGN)
drawVerticalLine(canvas, positionX, rowHeight, 0xc0800080, new Paint());
} else if ((key.mLabelOption & KEY_LABEL_OPTION_ALIGN_RIGHT) != 0) {
- positionX = key.mWidth - mKeyLabelHorizontalPadding - padding.right;
+ positionX = keyDrawWidth - mKeyLabelHorizontalPadding - padding.right;
paint.setTextAlign(Align.RIGHT);
if (DEBUG_SHOW_ALIGN)
drawVerticalLine(canvas, positionX, rowHeight, 0xc0808000, new Paint());
} else {
- positionX = (key.mWidth + padding.left - padding.right) / 2;
+ positionX = (keyDrawWidth + padding.left - padding.right) / 2;
paint.setTextAlign(Align.CENTER);
if (DEBUG_SHOW_ALIGN) {
if (label.length() > 1)
@@ -756,13 +745,13 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
if (DEBUG_SHOW_ALIGN)
drawVerticalLine(canvas, drawableX, rowHeight, 0xc0800080, new Paint());
} else if ((key.mLabelOption & KEY_LABEL_OPTION_ALIGN_RIGHT) != 0) {
- drawableX = key.mWidth - padding.right - mKeyLabelHorizontalPadding
+ drawableX = keyDrawWidth - padding.right - mKeyLabelHorizontalPadding
- drawableWidth;
if (DEBUG_SHOW_ALIGN)
drawVerticalLine(canvas, drawableX + drawableWidth, rowHeight,
0xc0808000, new Paint());
} else { // Align center
- drawableX = (key.mWidth + padding.left - padding.right - drawableWidth) / 2;
+ drawableX = (keyDrawWidth + padding.left - padding.right - drawableWidth) / 2;
if (DEBUG_SHOW_ALIGN)
drawVerticalLine(canvas, drawableX + drawableWidth / 2, rowHeight,
0xc0008080, new Paint());
@@ -773,7 +762,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
0x80c00000, new Paint());
}
if (key.mHintIcon != null) {
- final int drawableWidth = key.mWidth;
+ final int drawableWidth = keyDrawWidth;
final int drawableHeight = key.mHeight;
final int drawableX = 0;
final int drawableY = HINT_ICON_VERTICAL_ADJUSTMENT_PIXEL;
@@ -785,7 +774,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
drawRectangle(canvas, drawableX, drawableY, drawableWidth, drawableHeight,
0x80c0c000, new Paint());
}
- canvas.translate(-key.mX - kbdPaddingLeft, -key.mY - kbdPaddingTop);
+ canvas.translate(-keyDrawX - kbdPaddingLeft, -key.mY - kbdPaddingTop);
}
// TODO: Move this function to ProximityInfo for getting rid of public declarations for
@@ -913,14 +902,32 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
}
}
- // TODO Must fix popup preview on xlarge layout
+ // TODO: Introduce minimum duration for displaying key previews
+ // TODO: Display up to two key previews when the user presses two keys at the same time
private void showKey(final int keyIndex, PointerTracker tracker) {
- Key key = tracker.getKey(keyIndex);
+ // If the preview popup has no parent view yet, add it to the screen FrameLayout.
+ if (mPreviewText.getParent() == null) {
+ final FrameLayout screenContent = (FrameLayout) getRootView()
+ .findViewById(android.R.id.content);
+ if (android.os.Build.VERSION.SDK_INT >= /* HONEYCOMB */ 11) {
+ screenContent.addView(mPreviewText, new FrameLayout.LayoutParams(0, 0));
+ } else {
+ // Insert LinearLayout to be able to setMargin because pre-Honeycomb FrameLayout
+ // could not handle setMargin properly.
+ final LinearLayout placer = new LinearLayout(getContext());
+ screenContent.addView(placer);
+ placer.addView(mPreviewText, new LinearLayout.LayoutParams(0, 0));
+ }
+ }
+
+ final Key key = tracker.getKey(keyIndex);
// If keyIndex is invalid or IME is already closed, we must not show key preview.
// Trying to show preview PopupWindow while root window is closed causes
// WindowManager.BadTokenException.
if (key == null || !mInForeground)
return;
+ final int keyDrawX = key.mX + key.mVisualInsetsLeft;
+ final int keyDrawWidth = key.mWidth - key.mVisualInsetsLeft - key.mVisualInsetsRight;
// What we show as preview should match what we show on key top in onBufferDraw().
if (key.mLabel != null) {
// TODO Should take care of temporaryShiftLabel here.
@@ -941,60 +948,34 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
}
mPreviewText.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
- int popupWidth = Math.max(mPreviewText.getMeasuredWidth(), key.mWidth
+ int popupWidth = Math.max(mPreviewText.getMeasuredWidth(), keyDrawWidth
+ mPreviewText.getPaddingLeft() + mPreviewText.getPaddingRight());
final int popupHeight = mPreviewHeight;
- LayoutParams lp = mPreviewText.getLayoutParams();
- if (lp != null) {
- lp.width = popupWidth;
- lp.height = popupHeight;
- }
+ final ViewGroup.LayoutParams lp = mPreviewText.getLayoutParams();
+ lp.width = popupWidth;
+ lp.height = popupHeight;
- int popupPreviewX = key.mX - (popupWidth - key.mWidth) / 2;
+ int popupPreviewX = keyDrawX - (popupWidth - keyDrawWidth) / 2;
int popupPreviewY = key.mY - popupHeight + mPreviewOffset;
mHandler.cancelDismissPreview();
- if (mOffsetInWindow == null) {
- mOffsetInWindow = new int[2];
- getLocationInWindow(mOffsetInWindow);
- mOffsetInWindow[0] += mPopupPreviewOffsetX; // Offset may be zero
- mOffsetInWindow[1] += mPopupPreviewOffsetY; // Offset may be zero
- int[] windowLocation = new int[2];
- getLocationOnScreen(windowLocation);
- mWindowY = windowLocation[1];
- }
+ getLocationInWindow(mOffsetInWindow);
+ mOffsetInWindow[0] += mPopupPreviewOffsetX; // Offset may be zero
+ mOffsetInWindow[1] += mPopupPreviewOffsetY; // Offset may be zero
+
// Set the preview background state
mPreviewText.getBackground().setState(
key.mPopupCharacters != null ? LONG_PRESSABLE_STATE_SET : EMPTY_STATE_SET);
popupPreviewX += mOffsetInWindow[0];
popupPreviewY += mOffsetInWindow[1];
- // If the popup cannot be shown above the key, put it on the side
- if (popupPreviewY + mWindowY < 0) {
- // If the key you're pressing is on the left side of the keyboard, show the popup on
- // the right, offset by enough to see at least one key to the left/right.
- if (key.mX + key.mWidth <= getWidth() / 2) {
- popupPreviewX += (int) (key.mWidth * 2.5);
- } else {
- popupPreviewX -= (int) (key.mWidth * 2.5);
- }
- popupPreviewY += popupHeight;
- }
-
- try {
- if (mPreviewPopup.isShowing()) {
- mPreviewPopup.update(popupPreviewX, popupPreviewY, popupWidth, popupHeight);
- } else {
- mPreviewPopup.setWidth(popupWidth);
- mPreviewPopup.setHeight(popupHeight);
- mPreviewPopup.showAtLocation(mMiniKeyboardParent, Gravity.NO_GRAVITY,
- popupPreviewX, popupPreviewY);
- }
- } catch (WindowManager.BadTokenException e) {
- // Swallow the exception which will be happened when IME is already closed.
- Log.w(TAG, "LatinIME is already closed when tried showing key preview.");
+ // Place the key preview.
+ // TODO: Adjust position of key previews which touch screen edges
+ if (lp instanceof ViewGroup.MarginLayoutParams) {
+ ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams)lp;
+ mlp.setMargins(popupPreviewX, popupPreviewY, 0, 0);
}
- // Record popup preview position to display mini-keyboard later at the same positon
+ // Record popup preview position to display mini-keyboard later at the same position
mPopupPreviewDisplayedY = popupPreviewY;
mPreviewText.setVisibility(VISIBLE);
}
@@ -1056,7 +1037,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
mKeyboardActionListener.onCodeInput(Keyboard.CODE_CAPSLOCK, null, 0, 0);
}
- private void onDoubleTapShiftKey(PointerTracker tracker) {
+ private void onDoubleTapShiftKey(@SuppressWarnings("unused") PointerTracker tracker) {
// When shift key is double tapped, the first tap is correctly processed as usual tap. And
// the second tap is treated as this double tap event, so that we need not mark tracker
// calling setAlreadyProcessed() nor remove the tracker from mPointerQueueueue.
@@ -1110,7 +1091,6 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
final Keyboard keyboard = new MiniKeyboardBuilder(this, mKeyboard.getPopupKeyboardResId(),
popupKey).build();
miniKeyboardView.setKeyboard(keyboard);
- miniKeyboardView.mMiniKeyboardParent = this;
container.measure(MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.AT_MOST),
MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.AT_MOST));
@@ -1345,7 +1325,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
}
public void closing() {
- mPreviewPopup.dismiss();
+ mPreviewText.setVisibility(View.GONE);
mHandler.cancelAllMessages();
dismissPopupKeyboard();
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
index 5820049bb..9d9793e1e 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
@@ -229,7 +229,7 @@ public class LatinKeyboard extends Keyboard {
final Bitmap buffer = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
final Canvas canvas = new Canvas(buffer);
final Resources res = mContext.getResources();
- canvas.drawColor(res.getColor(R.color.latinkeyboard_transparent), PorterDuff.Mode.CLEAR);
+ canvas.drawColor(res.getColor(android.R.color.transparent), PorterDuff.Mode.CLEAR);
SubtypeSwitcher subtypeSwitcher = SubtypeSwitcher.getInstance();
// If application locales are explicitly selected.
@@ -271,7 +271,7 @@ public class LatinKeyboard extends Keyboard {
canvas.drawText(language, width / 2, baseline - descent, paint);
// Put arrows that are already layed out on either side of the text
- if (SubtypeSwitcher.getInstance().useSpacebarLanguageSwitcher()
+ if (subtypeSwitcher.useSpacebarLanguageSwitcher()
&& subtypeSwitcher.getEnabledKeyboardLocaleCount() > 1) {
mButtonArrowLeftIcon.draw(canvas);
mButtonArrowRightIcon.draw(canvas);
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
index 77e9caecc..d6c3723fd 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
@@ -16,9 +16,9 @@
package com.android.inputmethod.keyboard;
+import com.android.inputmethod.deprecated.VoiceProxy;
import com.android.inputmethod.latin.LatinImeLogger;
import com.android.inputmethod.latin.Utils;
-import com.android.inputmethod.voice.VoiceIMEConnector;
import android.content.Context;
import android.graphics.Canvas;
@@ -264,6 +264,6 @@ public class LatinKeyboardView extends KeyboardView {
@Override
protected void onAttachedToWindow() {
// Token is available from here.
- VoiceIMEConnector.getInstance().onAttachedToWindow();
+ VoiceProxy.getInstance().onAttachedToWindow();
}
}
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
index 746857819..add38cf45 100644
--- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java
+++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
@@ -87,6 +87,9 @@ public class PointerTracker {
// true if sliding key is allowed.
private boolean mIsAllowedSlidingKeyInput;
+ // ignore modifier key if true
+ private boolean mIgnoreModifierKey;
+
// pressed key
private int mPreviousKey = NOT_A_KEY;
@@ -139,8 +142,12 @@ public class PointerTracker {
// Returns true if keyboard has been changed by this callback.
private boolean callListenerOnPressAndCheckKeyboardLayoutChange(Key key, boolean withSliding) {
+ final boolean ignoreModifierKey = mIgnoreModifierKey && isModifierCode(key.mCode);
if (DEBUG_LISTENER)
- Log.d(TAG, "onPress : " + keyCodePrintable(key.mCode) + " sliding=" + withSliding);
+ Log.d(TAG, "onPress : " + keyCodePrintable(key.mCode) + " sliding=" + withSliding
+ + " ignoreModifier=" + ignoreModifierKey);
+ if (ignoreModifierKey)
+ return false;
if (key.mEnabled) {
mListener.onPress(key.mCode, withSliding);
final boolean keyboardLayoutHasBeenChanged = mKeyboardLayoutHasBeenChanged;
@@ -153,9 +160,13 @@ public class PointerTracker {
// Note that we need primaryCode argument because the keyboard may in shifted state and the
// primaryCode is different from {@link Key#mCode}.
private void callListenerOnCodeInput(Key key, int primaryCode, int[] keyCodes, int x, int y) {
+ final boolean ignoreModifierKey = mIgnoreModifierKey && isModifierCode(key.mCode);
if (DEBUG_LISTENER)
Log.d(TAG, "onCodeInput: " + keyCodePrintable(primaryCode)
- + " codes="+ Arrays.toString(keyCodes) + " x=" + x + " y=" + y);
+ + " codes="+ Arrays.toString(keyCodes) + " x=" + x + " y=" + y
+ + " ignoreModifier=" + ignoreModifierKey);
+ if (ignoreModifierKey)
+ return;
if (key.mEnabled)
mListener.onCodeInput(primaryCode, keyCodes, x, y);
}
@@ -170,8 +181,12 @@ public class PointerTracker {
// Note that we need primaryCode argument because the keyboard may in shifted state and the
// primaryCode is different from {@link Key#mCode}.
private void callListenerOnRelease(Key key, int primaryCode, boolean withSliding) {
+ final boolean ignoreModifierKey = mIgnoreModifierKey && isModifierCode(key.mCode);
if (DEBUG_LISTENER)
- Log.d(TAG, "onRelease : " + keyCodePrintable(primaryCode) + " sliding=" + withSliding);
+ Log.d(TAG, "onRelease : " + keyCodePrintable(primaryCode) + " sliding="
+ + withSliding + " ignoreModifier=" + ignoreModifierKey);
+ if (ignoreModifierKey)
+ return;
if (key.mEnabled)
mListener.onRelease(primaryCode, withSliding);
}
@@ -243,9 +258,7 @@ public class PointerTracker {
mPreviousKey = keyIndex;
if (keyIndex != oldKeyIndex) {
if (isValidKeyIndex(oldKeyIndex)) {
- // if new key index is not a key, old key was just released inside of the key.
- final boolean inside = (keyIndex == NOT_A_KEY);
- mKeys[oldKeyIndex].onReleased(inside);
+ mKeys[oldKeyIndex].onReleased();
mProxy.invalidateKey(mKeys[oldKeyIndex]);
}
if (isValidKeyIndex(keyIndex)) {
@@ -329,17 +342,18 @@ public class PointerTracker {
mKeyAlreadyProcessed = false;
mIsRepeatableKey = false;
mIsInSlidingKeyInput = false;
- if (isValidKeyIndex(keyIndex)) {
+ mIgnoreModifierKey = false;
+ final Key key = getKey(keyIndex);
+ if (key != null) {
// This onPress call may have changed keyboard layout. Those cases are detected at
// {@link #setKeyboard}. In those cases, we should update keyIndex according to the new
// keyboard layout.
- if (callListenerOnPressAndCheckKeyboardLayoutChange(mKeys[keyIndex], false))
+ if (callListenerOnPressAndCheckKeyboardLayoutChange(key, false))
keyIndex = mKeyState.onDownKey(x, y, eventTime);
- }
- if (isValidKeyIndex(keyIndex)) {
+
// Accessibility disables key repeat because users may need to pause on a key to hear
// its spoken description.
- if (mKeys[keyIndex].mRepeatable && !mIsAccessibilityEnabled) {
+ if (key.mRepeatable && !mIsAccessibilityEnabled) {
repeatKey(keyIndex);
mHandler.startKeyRepeatTimer(mDelayBeforeKeyRepeatStart, keyIndex, this);
mIsRepeatableKey = true;
@@ -349,6 +363,12 @@ public class PointerTracker {
showKeyPreviewAndUpdateKeyGraphics(keyIndex);
}
+ private void startSlidingKeyInput(Key key) {
+ if (!mIsInSlidingKeyInput)
+ mIgnoreModifierKey = isModifierCode(key.mCode);
+ mIsInSlidingKeyInput = true;
+ }
+
public void onMoveEvent(int x, int y, long eventTime, PointerTrackerQueue queue) {
if (ENABLE_ASSERTION) checkAssertion(queue);
if (DEBUG_MOVE_EVENT)
@@ -376,8 +396,8 @@ public class PointerTracker {
// The pointer has been slid in to the new key from the previous key, we must call
// onRelease() first to notify that the previous key has been released, then call
// onPress() to notify that the new key is being pressed.
- mIsInSlidingKeyInput = true;
callListenerOnRelease(oldKey, oldKey.mCode, true);
+ startSlidingKeyInput(oldKey);
mHandler.cancelLongPressTimers();
if (mIsAllowedSlidingKeyInput) {
// This onPress call may have changed keyboard layout. Those cases are detected
@@ -411,8 +431,8 @@ public class PointerTracker {
if (oldKey != null && !isMinorMoveBounce(x, y, keyIndex)) {
// The pointer has been slid out from the previous key, we must call onRelease() to
// notify that the previous key has been released.
- mIsInSlidingKeyInput = true;
callListenerOnRelease(oldKey, oldKey.mCode, true);
+ startSlidingKeyInput(oldKey);
mHandler.cancelLongPressTimers();
if (mIsAllowedSlidingKeyInput) {
keyState.onMoveToNewKey(keyIndex, x ,y);
@@ -423,7 +443,7 @@ public class PointerTracker {
}
}
}
- showKeyPreviewAndUpdateKeyGraphics(mKeyState.getKeyIndex());
+ showKeyPreviewAndUpdateKeyGraphics(keyState.getKeyIndex());
}
public void onUpEvent(int x, int y, long eventTime, PointerTrackerQueue queue) {
@@ -526,7 +546,9 @@ public class PointerTracker {
}
private void showKeyPreviewAndUpdateKeyGraphics(int keyIndex) {
- updateKeyGraphics(keyIndex);
+ final Key key = getKey(keyIndex);
+ if (key != null && !key.mEnabled)
+ return;
// The modifier key, such as shift key, should not be shown as preview when multi-touch is
// supported. On the other hand, if multi-touch is not supported, the modifier key should
// be shown as preview. If accessibility is turned on, the modifier key should be shown as
@@ -536,6 +558,7 @@ public class PointerTracker {
} else {
mProxy.showPreview(keyIndex, this);
}
+ updateKeyGraphics(keyIndex);
}
private void startLongPressTimer(int keyIndex) {
@@ -545,6 +568,8 @@ public class PointerTracker {
return;
}
Key key = getKey(keyIndex);
+ if (!key.mEnabled)
+ return;
if (key.mCode == Keyboard.CODE_SHIFT) {
mHandler.startLongPressShiftTimer(mLongPressShiftKeyTimeout, keyIndex, this);
} else if (key.mManualTemporaryUpperCaseCode != Keyboard.CODE_DUMMY
diff --git a/java/src/com/android/inputmethod/keyboard/SlidingLocaleDrawable.java b/java/src/com/android/inputmethod/keyboard/SlidingLocaleDrawable.java
index 41f8c2a7c..eee0ac61b 100644
--- a/java/src/com/android/inputmethod/keyboard/SlidingLocaleDrawable.java
+++ b/java/src/com/android/inputmethod/keyboard/SlidingLocaleDrawable.java
@@ -63,7 +63,7 @@ public class SlidingLocaleDrawable extends Drawable {
mHeight = height;
final TextPaint textPaint = new TextPaint();
textPaint.setTextSize(getTextSizeFromTheme(android.R.style.TextAppearance_Medium, 18));
- textPaint.setColor(R.color.latinkeyboard_transparent);
+ textPaint.setColor(android.R.color.transparent);
textPaint.setTextAlign(Align.CENTER);
textPaint.setAlpha(LatinKeyboard.OPACITY_FULLY_OPAQUE);
textPaint.setAntiAlias(true);
diff --git a/java/src/com/android/inputmethod/latin/AssetFileAddress.java b/java/src/com/android/inputmethod/latin/AssetFileAddress.java
new file mode 100644
index 000000000..074ecacc5
--- /dev/null
+++ b/java/src/com/android/inputmethod/latin/AssetFileAddress.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2011 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;
+
+import java.io.File;
+
+/**
+ * Immutable class to hold the address of an asset.
+ * As opposed to a normal file, an asset is usually represented as a contiguous byte array in
+ * the package file. Open it correctly thus requires the name of the package it is in, but
+ * also the offset in the file and the length of this data. This class encapsulates these three.
+ */
+class AssetFileAddress {
+ public final String mFilename;
+ public final long mOffset;
+ public final long mLength;
+
+ public AssetFileAddress(final String filename, final long offset, final long length) {
+ mFilename = filename;
+ mOffset = offset;
+ mLength = length;
+ }
+
+ public static AssetFileAddress makeFromFileName(final String filename) {
+ if (null == filename) return null;
+ File f = new File(filename);
+ if (null == f || !f.isFile()) return null;
+ return new AssetFileAddress(filename, 0l, f.length());
+ }
+
+ public static AssetFileAddress makeFromFileNameAndOffset(final String filename,
+ final long offset, final long length) {
+ if (null == filename) return null;
+ File f = new File(filename);
+ if (null == f || !f.isFile()) return null;
+ return new AssetFileAddress(filename, offset, length);
+ }
+}
diff --git a/java/src/com/android/inputmethod/latin/AutoCorrection.java b/java/src/com/android/inputmethod/latin/AutoCorrection.java
index 092f7ad63..d3119792c 100644
--- a/java/src/com/android/inputmethod/latin/AutoCorrection.java
+++ b/java/src/com/android/inputmethod/latin/AutoCorrection.java
@@ -48,7 +48,7 @@ public class AutoCorrection {
}
public void updateAutoCorrectionStatus(Map<String, Dictionary> dictionaries,
- WordComposer wordComposer, ArrayList<CharSequence> suggestions, int[] priorities,
+ WordComposer wordComposer, ArrayList<CharSequence> suggestions, int[] sortedScores,
CharSequence typedWord, double autoCorrectionThreshold, int correctionMode,
CharSequence quickFixedWord, CharSequence whitelistedWord) {
if (hasAutoCorrectionForWhitelistedWord(whitelistedWord)) {
@@ -62,7 +62,7 @@ public class AutoCorrection {
mHasAutoCorrection = true;
mAutoCorrectionWord = quickFixedWord;
} else if (hasAutoCorrectionForBinaryDictionary(wordComposer, suggestions, correctionMode,
- priorities, typedWord, autoCorrectionThreshold)) {
+ sortedScores, typedWord, autoCorrectionThreshold)) {
mHasAutoCorrection = true;
mAutoCorrectionWord = suggestions.get(0);
}
@@ -114,13 +114,13 @@ public class AutoCorrection {
}
private boolean hasAutoCorrectionForBinaryDictionary(WordComposer wordComposer,
- ArrayList<CharSequence> suggestions, int correctionMode, int[] priorities,
+ ArrayList<CharSequence> suggestions, int correctionMode, int[] sortedScores,
CharSequence typedWord, double autoCorrectionThreshold) {
if (wordComposer.size() > 1 && (correctionMode == Suggest.CORRECTION_FULL
|| correctionMode == Suggest.CORRECTION_FULL_BIGRAM)
- && typedWord != null && suggestions.size() > 0 && priorities.length > 0) {
+ && typedWord != null && suggestions.size() > 0 && sortedScores.length > 0) {
final CharSequence autoCorrectionCandidate = suggestions.get(0);
- final int autoCorrectionCandidateScore = priorities[0];
+ final int autoCorrectionCandidateScore = sortedScores[0];
// TODO: when the normalized score of the first suggestion is nearly equals to
// the normalized score of the second suggestion, behave less aggressive.
mNormalizedScore = Utils.calcNormalizedScore(
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
index 08ddd25fa..fa90fce67 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -26,14 +26,18 @@ import android.util.Log;
import java.io.File;
import java.util.Arrays;
+import java.util.Locale;
/**
* Implements a static, compacted, binary dictionary of standard words.
*/
public class BinaryDictionary extends Dictionary {
+ public static final String DICTIONARY_PACK_AUTHORITY =
+ "com.android.inputmethod.latin.dictionarypack";
+
/**
- * There is difference between what java and native code can handle.
+ * There is a difference between what java and native code can handle.
* This value should only be used in BinaryDictionary.java
* It is necessary to keep it at this value because some languages e.g. German have
* really long words.
@@ -54,38 +58,42 @@ public class BinaryDictionary extends Dictionary {
private final int[] mInputCodes = new int[MAX_WORD_LENGTH * MAX_PROXIMITY_CHARS_SIZE];
private final char[] mOutputChars = new char[MAX_WORD_LENGTH * MAX_WORDS];
private final char[] mOutputChars_bigrams = new char[MAX_WORD_LENGTH * MAX_BIGRAMS];
- private final int[] mFrequencies = new int[MAX_WORDS];
- private final int[] mFrequencies_bigrams = new int[MAX_BIGRAMS];
+ private final int[] mScores = new int[MAX_WORDS];
+ private final int[] mBigramScores = new int[MAX_BIGRAMS];
private final KeyboardSwitcher mKeyboardSwitcher = KeyboardSwitcher.getInstance();
- private final SubtypeSwitcher mSubtypeSwitcher = SubtypeSwitcher.getInstance();
-
- private static class Flags {
- private static class FlagEntry {
- public final String mName;
- public final int mValue;
- public FlagEntry(String name, int value) {
- mName = name;
- mValue = value;
- }
+
+ public static class Flag {
+ public final String mName;
+ public final int mValue;
+
+ public Flag(String name, int value) {
+ mName = name;
+ mValue = value;
}
- public static final FlagEntry[] ALL_FLAGS = {
- // Here should reside all flags that trigger some special processing
- // These *must* match the definition in UnigramDictionary enum in
- // unigram_dictionary.h so please update both at the same time.
- new FlagEntry("requiresGermanUmlautProcessing", 0x1)
- };
}
+
+ public static final Flag FLAG_REQUIRES_GERMAN_UMLAUT_PROCESSING =
+ new Flag("requiresGermanUmlautProcessing", 0x1);
+
+ private static final Flag[] ALL_FLAGS = {
+ // Here should reside all flags that trigger some special processing
+ // These *must* match the definition in UnigramDictionary enum in
+ // unigram_dictionary.h so please update both at the same time.
+ FLAG_REQUIRES_GERMAN_UMLAUT_PROCESSING,
+ };
+
private int mFlags = 0;
private BinaryDictionary() {
}
/**
- * Initialize a dictionary from a raw resource file
+ * Initializes a dictionary from a raw resource file
* @param context application context for reading resources
* @param resId the resource containing the raw binary dictionary
- * @return initialized instance of BinaryDictionary
+ * @param dicTypeId the type of the dictionary being created, out of the list in Suggest.DIC_*
+ * @return an initialized instance of BinaryDictionary
*/
public static BinaryDictionary initDictionary(Context context, int resId, int dicTypeId) {
synchronized (sInstance) {
@@ -110,12 +118,12 @@ public class BinaryDictionary extends Dictionary {
return null;
}
}
- sInstance.initFlags();
+ sInstance.mFlags = initFlags(ALL_FLAGS, SubtypeSwitcher.getInstance());
return sInstance;
}
/* package for test */ static BinaryDictionary initDictionary(File dictionary, long startOffset,
- long length, int dicTypeId) {
+ long length, int dicTypeId, Flag[] flagArray) {
synchronized (sInstance) {
sInstance.closeInternal();
if (dictionary.isFile()) {
@@ -126,22 +134,54 @@ public class BinaryDictionary extends Dictionary {
return null;
}
}
+ sInstance.mFlags = initFlags(flagArray, null);
return sInstance;
}
- private void initFlags() {
+ private static int initFlags(Flag[] flagArray, SubtypeSwitcher switcher) {
int flags = 0;
- for (Flags.FlagEntry entry : Flags.ALL_FLAGS) {
- if (mSubtypeSwitcher.currentSubtypeContainsExtraValueKey(entry.mName))
+ for (Flag entry : flagArray) {
+ if (switcher == null || switcher.currentSubtypeContainsExtraValueKey(entry.mName))
flags |= entry.mValue;
}
- mFlags = flags;
+ return flags;
}
static {
Utils.loadNativeLibrary();
}
+ /**
+ * Initializes a dictionary from a dictionary pack.
+ *
+ * This searches for a content provider providing a dictionary pack for the specified
+ * locale. If none is found, it falls back to using the resource passed as fallBackResId
+ * as a dictionary.
+ * @param context application context for reading resources
+ * @param dicTypeId the type of the dictionary being created, out of the list in Suggest.DIC_*
+ * @param locale the locale for which to create the dictionary
+ * @param fallBackResId the id of the resource to use as a fallback if no pack is found
+ * @return an initialized instance of BinaryDictionary
+ */
+ public static BinaryDictionary initDictionaryFromManager(Context context, int dicTypeId,
+ Locale locale, int fallbackResId) {
+ if (null == locale) {
+ Log.e(TAG, "No locale defined for dictionary");
+ return initDictionary(context, fallbackResId, dicTypeId);
+ }
+ synchronized (sInstance) {
+ sInstance.closeInternal();
+
+ final AssetFileAddress dictFile = BinaryDictionaryGetter.getDictionaryFile(locale,
+ context, fallbackResId);
+ if (null != dictFile) {
+ sInstance.loadDictionary(dictFile.mFilename, dictFile.mOffset, dictFile.mLength);
+ sInstance.mDicTypeId = dicTypeId;
+ }
+ }
+ return sInstance;
+ }
+
private native int openNative(String sourceDir, long dictOffset, long dictSize,
int typedLetterMultiplier, int fullWordMultiplier, int maxWordLength,
int maxWords, int maxAlternatives);
@@ -149,14 +189,14 @@ public class BinaryDictionary extends Dictionary {
private native boolean isValidWordNative(int nativeData, char[] word, int wordLength);
private native int getSuggestionsNative(int dict, int proximityInfo, int[] xCoordinates,
int[] yCoordinates, int[] inputCodes, int codesSize, int flags, char[] outputChars,
- int[] frequencies);
+ int[] scores);
private native int getBigramsNative(int dict, char[] prevWord, int prevWordLength,
- int[] inputCodes, int inputCodesLength, char[] outputChars, int[] frequencies,
+ int[] inputCodes, int inputCodesLength, char[] outputChars, int[] scores,
int maxWordLength, int maxBigrams, int maxAlternatives);
private final void loadDictionary(String path, long startOffset, long length) {
mNativeDict = openNative(path, startOffset, length,
- TYPED_LETTER_MULTIPLIER, FULL_WORD_FREQ_MULTIPLIER,
+ TYPED_LETTER_MULTIPLIER, FULL_WORD_SCORE_MULTIPLIER,
MAX_WORD_LENGTH, MAX_WORDS, MAX_PROXIMITY_CHARS_SIZE);
mDictLength = length;
}
@@ -168,7 +208,7 @@ public class BinaryDictionary extends Dictionary {
char[] chars = previousWord.toString().toCharArray();
Arrays.fill(mOutputChars_bigrams, (char) 0);
- Arrays.fill(mFrequencies_bigrams, 0);
+ Arrays.fill(mBigramScores, 0);
int codesSize = codes.size();
Arrays.fill(mInputCodes, -1);
@@ -177,18 +217,18 @@ public class BinaryDictionary extends Dictionary {
Math.min(alternatives.length, MAX_PROXIMITY_CHARS_SIZE));
int count = getBigramsNative(mNativeDict, chars, chars.length, mInputCodes, codesSize,
- mOutputChars_bigrams, mFrequencies_bigrams, MAX_WORD_LENGTH, MAX_BIGRAMS,
+ mOutputChars_bigrams, mBigramScores, MAX_WORD_LENGTH, MAX_BIGRAMS,
MAX_PROXIMITY_CHARS_SIZE);
for (int j = 0; j < count; ++j) {
- if (mFrequencies_bigrams[j] < 1) break;
+ if (mBigramScores[j] < 1) break;
final int start = j * MAX_WORD_LENGTH;
int len = 0;
while (len < MAX_WORD_LENGTH && mOutputChars_bigrams[start + len] != 0) {
++len;
}
if (len > 0) {
- callback.addWord(mOutputChars_bigrams, start, len, mFrequencies_bigrams[j],
+ callback.addWord(mOutputChars_bigrams, start, len, mBigramScores[j],
mDicTypeId, DataType.BIGRAM);
}
}
@@ -197,17 +237,17 @@ public class BinaryDictionary extends Dictionary {
@Override
public void getWords(final WordComposer codes, final WordCallback callback) {
final int count = getSuggestions(codes, mKeyboardSwitcher.getLatinKeyboard(),
- mOutputChars, mFrequencies);
+ mOutputChars, mScores);
for (int j = 0; j < count; ++j) {
- if (mFrequencies[j] < 1) break;
+ if (mScores[j] < 1) break;
final int start = j * MAX_WORD_LENGTH;
int len = 0;
while (len < MAX_WORD_LENGTH && mOutputChars[start + len] != 0) {
++len;
}
if (len > 0) {
- callback.addWord(mOutputChars, start, len, mFrequencies[j], mDicTypeId,
+ callback.addWord(mOutputChars, start, len, mScores[j], mDicTypeId,
DataType.UNIGRAM);
}
}
@@ -218,7 +258,7 @@ public class BinaryDictionary extends Dictionary {
}
/* package for test */ int getSuggestions(final WordComposer codes, final Keyboard keyboard,
- char[] outputChars, int[] frequencies) {
+ char[] outputChars, int[] scores) {
if (!isValidDictionary()) return -1;
final int codesSize = codes.size();
@@ -232,12 +272,12 @@ public class BinaryDictionary extends Dictionary {
Math.min(alternatives.length, MAX_PROXIMITY_CHARS_SIZE));
}
Arrays.fill(outputChars, (char) 0);
- Arrays.fill(frequencies, 0);
+ Arrays.fill(scores, 0);
return getSuggestionsNative(
mNativeDict, keyboard.getProximityInfo(),
codes.getXCoordinates(), codes.getYCoordinates(), mInputCodes, codesSize,
- mFlags, outputChars, frequencies);
+ mFlags, outputChars, scores);
}
@Override
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
new file mode 100644
index 000000000..d0464dd94
--- /dev/null
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2011 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;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.net.Uri;
+import android.text.TextUtils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Locale;
+
+/**
+ * Group class for static methods to help with creation and getting of the binary dictionary
+ * file from the dictionary provider
+ */
+public class BinaryDictionaryFileDumper {
+ /**
+ * The size of the temporary buffer to copy files.
+ */
+ static final int FILE_READ_BUFFER_SIZE = 1024;
+
+ // Prevents this class to be accidentally instantiated.
+ private BinaryDictionaryFileDumper() {
+ }
+
+ /**
+ * Generates a file name that matches the locale passed as an argument.
+ * The file name is basically the result of the .toString() method, except we replace
+ * any @File.separator with an underscore to avoid generating a file name that may not
+ * be created.
+ * @param locale the locale for which to get the file name
+ * @param context the context to use for getting the directory
+ * @return the name of the file to be created
+ */
+ private static String getCacheFileNameForLocale(Locale locale, Context context) {
+ // The following assumes two things :
+ // 1. That File.separator is not the same character as "_"
+ // I don't think any android system will ever use "_" as a path separator
+ // 2. That no two locales differ by only a File.separator versus a "_"
+ // Since "_" can't be part of locale components this should be safe.
+ // Examples:
+ // en -> en
+ // en_US_POSIX -> en_US_POSIX
+ // en__foo/bar -> en__foo_bar
+ final String[] separator = { File.separator };
+ final String[] empty = { "_" };
+ final CharSequence basename = TextUtils.replace(locale.toString(), separator, empty);
+ return context.getFilesDir() + File.separator + basename;
+ }
+
+ /**
+ * Return for a given locale the provider URI to query to get the dictionary.
+ */
+ public static Uri getProviderUri(Locale locale) {
+ return new Uri.Builder().scheme(ContentResolver.SCHEME_CONTENT)
+ .authority(BinaryDictionary.DICTIONARY_PACK_AUTHORITY).appendPath(
+ locale.toString()).build();
+ }
+
+ /**
+ * Queries a content provider for dictionary data for some locale and returns it as a file name.
+ *
+ * This will query a content provider for dictionary data for a given locale, and return
+ * the name of a file suitable to be mmap'ed. It will copy it to local storage if needed.
+ * It should also check the dictionary version to avoid unnecessary copies but this is
+ * still in TODO state.
+ * This will make the data from the content provider the cached dictionary for this locale,
+ * overwriting any previous cached data.
+ * @returns the name of the file, or null if no data could be obtained.
+ * @throw FileNotFoundException if the provider returns non-existent data.
+ * @throw IOException if the provider-returned data could not be read.
+ */
+ public static String getDictionaryFileFromContentProvider(Locale locale, Context context)
+ throws FileNotFoundException, IOException {
+ // TODO: check whether the dictionary is the same or not and if it is, return the cached
+ // file.
+ final ContentResolver resolver = context.getContentResolver();
+ final Uri dictionaryPackUri = getProviderUri(locale);
+ final InputStream stream = resolver.openInputStream(dictionaryPackUri);
+ if (null == stream) return null;
+ return copyFileTo(stream, getCacheFileNameForLocale(locale, context));
+ }
+
+ /**
+ * Accepts a file as dictionary data for some locale and returns the name of a file.
+ *
+ * This will make the data in the input file the cached dictionary for this locale, overwriting
+ * any previous cached data.
+ */
+ public static String getDictionaryFileFromFile(String fileName, Locale locale,
+ Context context) throws FileNotFoundException, IOException {
+ return copyFileTo(new FileInputStream(fileName), getCacheFileNameForLocale(locale,
+ context));
+ }
+
+ /**
+ * Accepts a resource number as dictionary data for some locale and returns the name of a file.
+ *
+ * This will make the resource the cached dictionary for this locale, overwriting any previous
+ * cached data.
+ */
+ public static String getDictionaryFileFromResource(int resource, Locale locale,
+ Context context) throws FileNotFoundException, IOException {
+ return copyFileTo(context.getResources().openRawResource(resource),
+ getCacheFileNameForLocale(locale, context));
+ }
+
+ /**
+ * Copies the data in an input stream to a target file, creating the file if necessary and
+ * overwriting it if it already exists.
+ */
+ private static String copyFileTo(final InputStream input, final String outputFileName)
+ throws FileNotFoundException, IOException {
+ final byte[] buffer = new byte[FILE_READ_BUFFER_SIZE];
+ final FileOutputStream output = new FileOutputStream(outputFileName);
+ for (int readBytes = input.read(buffer); readBytes >= 0; readBytes = input.read(buffer))
+ output.write(buffer, 0, readBytes);
+ input.close();
+ return outputFileName;
+ }
+}
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
new file mode 100644
index 000000000..72512c7e1
--- /dev/null
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2011 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;
+
+import android.content.Context;
+import android.content.res.AssetFileDescriptor;
+import android.util.Log;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Locale;
+
+/**
+ * Helper class to get the address of a mmap'able dictionary file.
+ */
+class BinaryDictionaryGetter {
+
+ /**
+ * Used for Log actions from this class
+ */
+ private static final String TAG = BinaryDictionaryGetter.class.getSimpleName();
+
+ // Prevents this from being instantiated
+ private BinaryDictionaryGetter() {}
+
+ /**
+ * Returns a file address from a resource, or null if it cannot be opened.
+ */
+ private static AssetFileAddress loadFallbackResource(Context context, int fallbackResId) {
+ final AssetFileDescriptor afd = context.getResources().openRawResourceFd(fallbackResId);
+ if (afd == null) {
+ Log.e(TAG, "Found the resource but cannot read it. Is it compressed? resId="
+ + fallbackResId);
+ return null;
+ }
+ return AssetFileAddress.makeFromFileNameAndOffset(
+ context.getApplicationInfo().sourceDir, afd.getStartOffset(), afd.getLength());
+ }
+
+ /**
+ * Returns a file address for a given locale, trying relevant methods in order.
+ *
+ * Tries to get a binary dictionary from various sources, in order:
+ * - Uses a private method of getting a private dictionary, as implemented by the
+ * PrivateBinaryDictionaryGetter class.
+ * If that fails:
+ * - Uses a content provider to get a public dictionary, as per the protocol described
+ * in BinaryDictionaryFileDumper.
+ * If that fails:
+ * - Gets a file name from the fallback resource passed as an argument.
+ * If that fails:
+ * - Returns null.
+ * @return The address of a valid file, or null.
+ * @throws FileNotFoundException if a dictionary provider returned a file name, but the
+ * file cannot be found.
+ * @throws IOException if there was an I/O problem reading or copying a file.
+ */
+ public static AssetFileAddress getDictionaryFile(Locale locale, Context context,
+ int fallbackResId) {
+ // Try first to query a private file signed the same way.
+ final AssetFileAddress privateFile =
+ PrivateBinaryDictionaryGetter.getDictionaryFile(locale, context);
+ if (null != privateFile) {
+ return privateFile;
+ } else {
+ try {
+ // If that was no-go, try to find a publicly exported dictionary.
+ final String fileName = BinaryDictionaryFileDumper.
+ getDictionaryFileFromContentProvider(locale, context);
+ return AssetFileAddress.makeFromFileName(fileName);
+ } catch (FileNotFoundException e) {
+ Log.e(TAG, "Unable to create dictionary file from provider for locale "
+ + locale.toString() + ": falling back to internal dictionary");
+ return loadFallbackResource(context, fallbackResId);
+ } catch (IOException e) {
+ Log.e(TAG, "Unable to read source data for locale "
+ + locale.toString() + ": falling back to internal dictionary");
+ return loadFallbackResource(context, fallbackResId);
+ }
+ }
+ }
+}
diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java
index 5719b9012..6fb80adf0 100644
--- a/java/src/com/android/inputmethod/latin/CandidateView.java
+++ b/java/src/com/android/inputmethod/latin/CandidateView.java
@@ -133,7 +133,6 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
ViewGroup.LayoutParams.WRAP_CONTENT);
mPreviewPopup.setContentView(mPreviewText);
mPreviewPopup.setBackgroundDrawable(null);
- mPreviewPopup.setAnimationStyle(R.style.KeyPreviewAnimation);
mConfigCandidateHighlightFontColorEnabled =
res.getBoolean(R.bool.config_candidate_highlight_font_color_enabled);
mColorNormal = res.getColor(R.color.candidate_normal);
diff --git a/java/src/com/android/inputmethod/latin/Dictionary.java b/java/src/com/android/inputmethod/latin/Dictionary.java
index 56f0cc503..ac43d6477 100644
--- a/java/src/com/android/inputmethod/latin/Dictionary.java
+++ b/java/src/com/android/inputmethod/latin/Dictionary.java
@@ -29,7 +29,7 @@ public abstract class Dictionary {
/**
* The weight to give to a word if it's length is the same as the number of typed characters.
*/
- protected static final int FULL_WORD_FREQ_MULTIPLIER = 2;
+ protected static final int FULL_WORD_SCORE_MULTIPLIER = 2;
public static enum DataType {
UNIGRAM, BIGRAM
@@ -42,17 +42,17 @@ public abstract class Dictionary {
public interface WordCallback {
/**
* Adds a word to a list of suggestions. The word is expected to be ordered based on
- * the provided frequency.
+ * the provided score.
* @param word the character array containing the word
* @param wordOffset starting offset of the word in the character array
* @param wordLength length of valid characters in the character array
- * @param frequency the frequency of occurrence. This is normalized between 1 and 255, but
+ * @param score the score of occurrence. This is normalized between 1 and 255, but
* can exceed those limits
* @param dicTypeId of the dictionary where word was from
* @param dataType tells type of this data
* @return true if the word was added, false if no more words are required
*/
- boolean addWord(char[] word, int wordOffset, int wordLength, int frequency, int dicTypeId,
+ boolean addWord(char[] word, int wordOffset, int wordLength, int score, int dicTypeId,
DataType dataType);
}
diff --git a/java/src/com/android/inputmethod/latin/DictionaryPackInstallBroadcastReceiver.java b/java/src/com/android/inputmethod/latin/DictionaryPackInstallBroadcastReceiver.java
new file mode 100644
index 000000000..9d30af84b
--- /dev/null
+++ b/java/src/com/android/inputmethod/latin/DictionaryPackInstallBroadcastReceiver.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2011 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;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ProviderInfo;
+import android.net.Uri;
+
+/**
+ * Takes action to reload the necessary data when a dictionary pack was added/removed.
+ */
+public class DictionaryPackInstallBroadcastReceiver extends BroadcastReceiver {
+
+ final LatinIME mService;
+ /**
+ * The action of the intent for publishing that new dictionary data is available.
+ */
+ /* package */ static final String NEW_DICTIONARY_INTENT_ACTION =
+ "com.android.inputmethod.latin.dictionarypack.newdict";
+
+ public DictionaryPackInstallBroadcastReceiver(final LatinIME service) {
+ mService = service;
+ }
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ final String action = intent.getAction();
+ final PackageManager manager = context.getPackageManager();
+
+ // We need to reread the dictionary if a new dictionary package is installed.
+ if (action.equals(Intent.ACTION_PACKAGE_ADDED)) {
+ final Uri packageUri = intent.getData();
+ if (null == packageUri) return; // No package name : we can't do anything
+ final String packageName = packageUri.getSchemeSpecificPart();
+ if (null == packageName) return;
+ final PackageInfo packageInfo;
+ try {
+ packageInfo = manager.getPackageInfo(packageName, PackageManager.GET_PROVIDERS);
+ } catch (android.content.pm.PackageManager.NameNotFoundException e) {
+ return; // No package info : we can't do anything
+ }
+ final ProviderInfo[] providers = packageInfo.providers;
+ if (null == providers) return; // No providers : it is not a dictionary.
+
+ // Search for some dictionary pack in the just-installed package. If found, reread.
+ for (ProviderInfo info : providers) {
+ if (BinaryDictionary.DICTIONARY_PACK_AUTHORITY.equals(info.authority)) {
+ mService.resetSuggestMainDict();
+ return;
+ }
+ }
+ // If we come here none of the authorities matched the one we searched for.
+ // We can exit safely.
+ return;
+ } else if (action.equals(Intent.ACTION_PACKAGE_REMOVED)
+ && !intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
+ // When the dictionary package is removed, we need to reread dictionary (to use the
+ // next-priority one, or stop using a dictionary at all if this was the only one,
+ // since this is the user request).
+ // If we are replacing the package, we will receive ADDED right away so no need to
+ // remove the dictionary at the moment, since we will do it when we receive the
+ // ADDED broadcast.
+
+ // TODO: Only reload dictionary on REMOVED when the removed package is the one we
+ // read dictionary from?
+ mService.resetSuggestMainDict();
+ } else if (action.equals(NEW_DICTIONARY_INTENT_ACTION)) {
+ mService.resetSuggestMainDict();
+ }
+ }
+}
diff --git a/java/src/com/android/inputmethod/latin/EditingUtils.java b/java/src/com/android/inputmethod/latin/EditingUtils.java
index 0ca06ddfc..80830c000 100644
--- a/java/src/com/android/inputmethod/latin/EditingUtils.java
+++ b/java/src/com/android/inputmethod/latin/EditingUtils.java
@@ -16,13 +16,13 @@
package com.android.inputmethod.latin;
+import com.android.inputmethod.compat.InputConnectionCompatUtils;
+
import android.text.TextUtils;
import android.view.inputmethod.ExtractedText;
import android.view.inputmethod.ExtractedTextRequest;
import android.view.inputmethod.InputConnection;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.util.regex.Pattern;
/**
@@ -34,11 +34,6 @@ public class EditingUtils {
*/
private static final int LOOKBACK_CHARACTER_NUM = 15;
- // Cache Method pointers
- private static boolean sMethodsInitialized;
- private static Method sMethodGetSelectedText;
- private static Method sMethodSetComposingRegion;
-
private EditingUtils() {
// Unintentional empty constructor for singleton.
}
@@ -241,7 +236,8 @@ public class EditingUtils {
}
// Extract the selection alone
- CharSequence touching = getSelectedText(ic, selStart, selEnd);
+ CharSequence touching = InputConnectionCompatUtils.getSelectedText(
+ ic, selStart, selEnd);
if (TextUtils.isEmpty(touching)) return null;
// Is any part of the selection a separator? If so, return null.
final int length = touching.length();
@@ -255,74 +251,4 @@ public class EditingUtils {
}
return null;
}
-
- /**
- * Cache method pointers for performance
- */
- private static void initializeMethodsForReflection() {
- try {
- // These will either both exist or not, so no need for separate try/catch blocks.
- // If other methods are added later, use separate try/catch blocks.
- sMethodGetSelectedText = InputConnection.class.getMethod("getSelectedText", int.class);
- sMethodSetComposingRegion = InputConnection.class.getMethod("setComposingRegion",
- int.class, int.class);
- } catch (NoSuchMethodException exc) {
- // Ignore
- }
- sMethodsInitialized = true;
- }
-
- /**
- * Returns the selected text between the selStart and selEnd positions.
- */
- private static CharSequence getSelectedText(InputConnection ic, int selStart, int selEnd) {
- // Use reflection, for backward compatibility
- CharSequence result = null;
- if (!sMethodsInitialized) {
- initializeMethodsForReflection();
- }
- if (sMethodGetSelectedText != null) {
- try {
- result = (CharSequence) sMethodGetSelectedText.invoke(ic, 0);
- return result;
- } catch (InvocationTargetException exc) {
- // Ignore
- } catch (IllegalArgumentException e) {
- // Ignore
- } catch (IllegalAccessException e) {
- // Ignore
- }
- }
- // Reflection didn't work, try it the poor way, by moving the cursor to the start,
- // getting the text after the cursor and moving the text back to selected mode.
- // TODO: Verify that this works properly in conjunction with
- // LatinIME#onUpdateSelection
- ic.setSelection(selStart, selEnd);
- result = ic.getTextAfterCursor(selEnd - selStart, 0);
- ic.setSelection(selStart, selEnd);
- return result;
- }
-
- /**
- * Tries to set the text into composition mode if there is support for it in the framework.
- */
- public static void underlineWord(InputConnection ic, SelectedWord word) {
- // Use reflection, for backward compatibility
- // If method not found, there's nothing we can do. It still works but just wont underline
- // the word.
- if (!sMethodsInitialized) {
- initializeMethodsForReflection();
- }
- if (sMethodSetComposingRegion != null) {
- try {
- sMethodSetComposingRegion.invoke(ic, word.mStart, word.mEnd);
- } catch (InvocationTargetException exc) {
- // Ignore
- } catch (IllegalArgumentException e) {
- // Ignore
- } catch (IllegalAccessException e) {
- // Ignore
- }
- }
- }
}
diff --git a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
index 0318175f6..be2c6b21b 100644
--- a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java
@@ -32,12 +32,14 @@ public class ExpandableDictionary extends Dictionary {
*/
protected static final int MAX_WORD_LENGTH = 32;
+ // Bigram frequency is a fixed point number with 1 meaning 1.2 and 255 meaning 1.8.
+ protected static final int BIGRAM_MAX_FREQUENCY = 255;
+
private Context mContext;
private char[] mWordBuilder = new char[MAX_WORD_LENGTH];
private int mDicTypeId;
private int mMaxDepth;
private int mInputLength;
- private StringBuilder sb = new StringBuilder(MAX_WORD_LENGTH);
private static final char QUOTE = '\'';
@@ -98,6 +100,7 @@ public class ExpandableDictionary extends Dictionary {
public int addFrequency(int add) {
mFrequency += add;
+ if (mFrequency > BIGRAM_MAX_FREQUENCY) mFrequency = BIGRAM_MAX_FREQUENCY;
return mFrequency;
}
}
@@ -327,7 +330,7 @@ public class ExpandableDictionary extends Dictionary {
final int finalFreq;
if (skipPos < 0) {
finalFreq = freq * snr * addedAttenuation
- * FULL_WORD_FREQ_MULTIPLIER;
+ * FULL_WORD_SCORE_MULTIPLIER;
} else {
finalFreq = computeSkippedWordFinalFreq(freq,
snr * addedAttenuation, mInputLength);
@@ -462,6 +465,9 @@ public class ExpandableDictionary extends Dictionary {
}
}
+ // Local to reverseLookUp, but do not allocate each time.
+ private final char[] mLookedUpString = new char[MAX_WORD_LENGTH];
+
/**
* reverseLookUp retrieves the full word given a list of terminal nodes and adds those words
* through callback.
@@ -474,18 +480,15 @@ public class ExpandableDictionary extends Dictionary {
for (NextWord nextWord : terminalNodes) {
node = nextWord.mWord;
freq = nextWord.getFrequency();
- // TODO Not the best way to limit suggestion threshold
- if (freq >= UserBigramDictionary.SUGGEST_THRESHOLD) {
- sb.setLength(0);
- do {
- sb.insert(0, node.mCode);
- node = node.mParent;
- } while(node != null);
-
- // TODO better way to feed char array?
- callback.addWord(sb.toString().toCharArray(), 0, sb.length(), freq, mDicTypeId,
- DataType.BIGRAM);
- }
+ int index = MAX_WORD_LENGTH;
+ do {
+ --index;
+ mLookedUpString[index] = node.mCode;
+ node = node.mParent;
+ } while (node != null);
+
+ callback.addWord(mLookedUpString, index, MAX_WORD_LENGTH - index, freq, mDicTypeId,
+ DataType.BIGRAM);
}
}
diff --git a/java/src/com/android/inputmethod/latin/InputLanguageSelection.java b/java/src/com/android/inputmethod/latin/InputLanguageSelection.java
index 5587c685f..be5e015aa 100644
--- a/java/src/com/android/inputmethod/latin/InputLanguageSelection.java
+++ b/java/src/com/android/inputmethod/latin/InputLanguageSelection.java
@@ -106,8 +106,8 @@ public class InputLanguageSelection extends PreferenceActivity {
conf.locale = locale;
res.updateConfiguration(conf, res.getDisplayMetrics());
- int mainDicResId = Utils.getMainDictionaryResourceId(res);
- BinaryDictionary bd = BinaryDictionary.initDictionary(this, mainDicResId, Suggest.DIC_MAIN);
+ BinaryDictionary bd = BinaryDictionary.initDictionaryFromManager(this, Suggest.DIC_MAIN,
+ locale, Utils.getMainDictionaryResourceId(res));
// Is the dictionary larger than a placeholder? Arbitrarily chose a lower limit of
// 4000-5000 words, whereas the LARGE_DICTIONARY is about 20000+ words.
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 6e76cadf2..88b3ded8e 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -16,14 +16,21 @@
package com.android.inputmethod.latin;
+import com.android.inputmethod.compat.CompatUtils;
+import com.android.inputmethod.compat.EditorInfoCompatUtils;
+import com.android.inputmethod.compat.InputConnectionCompatUtils;
+import com.android.inputmethod.compat.InputMethodManagerCompatWrapper;
+import com.android.inputmethod.compat.InputMethodServiceCompatWrapper;
+import com.android.inputmethod.compat.InputTypeCompatUtils;
+import com.android.inputmethod.compat.VibratorCompatWrapper;
+import com.android.inputmethod.deprecated.LanguageSwitcherProxy;
+import com.android.inputmethod.deprecated.VoiceProxy;
import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.KeyboardActionListener;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.keyboard.KeyboardView;
import com.android.inputmethod.keyboard.LatinKeyboard;
import com.android.inputmethod.keyboard.LatinKeyboardView;
-import com.android.inputmethod.latin.Utils.RingCharBuffer;
-import com.android.inputmethod.voice.VoiceIMEConnector;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
@@ -42,7 +49,6 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.SystemClock;
-import android.os.Vibrator;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.text.InputType;
@@ -51,7 +57,6 @@ import android.util.DisplayMetrics;
import android.util.Log;
import android.util.PrintWriterPrinter;
import android.util.Printer;
-import android.view.Gravity;
import android.view.HapticFeedbackConstants;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -61,15 +66,10 @@ import android.view.ViewParent;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.CompletionInfo;
-import android.view.inputmethod.CorrectionInfo;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.ExtractedText;
import android.view.inputmethod.ExtractedTextRequest;
import android.view.inputmethod.InputConnection;
-import android.view.inputmethod.InputMethodManager;
-import android.view.inputmethod.InputMethodSubtype;
-import android.widget.FrameLayout;
-import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
import java.io.FileDescriptor;
@@ -81,7 +81,7 @@ import java.util.Locale;
/**
* Input method implementation for Qwerty'ish keyboard.
*/
-public class LatinIME extends InputMethodService implements KeyboardActionListener {
+public class LatinIME extends InputMethodServiceCompatWrapper implements KeyboardActionListener {
private static final String TAG = LatinIME.class.getSimpleName();
private static final boolean PERF_DEBUG = false;
private static final boolean TRACE = false;
@@ -94,6 +94,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
*
* @deprecated Use {@link LatinIME#IME_OPTION_NO_MICROPHONE} with package name prefixed.
*/
+ @SuppressWarnings("dep-ann")
public static final String IME_OPTION_NO_MICROPHONE_COMPAT = "nm";
/**
@@ -119,6 +120,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Key events coming any faster than this are long-presses.
private static final int QUICK_PRESS = 200;
+ /**
+ * The name of the scheme used by the Package Manager to warn of a new package installation,
+ * replacement or removal.
+ */
+ private static final String SCHEME_PACKAGE = "package";
+
private int mSuggestionVisibility;
private static final int SUGGESTION_VISIBILILTY_SHOW_VALUE
= R.string.prefs_suggestion_visibility_show_value;
@@ -134,19 +141,20 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
};
private View mCandidateViewContainer;
+ private int mCandidateStripHeight;
private CandidateView mCandidateView;
private Suggest mSuggest;
private CompletionInfo[] mApplicationSpecifiedCompletions;
private AlertDialog mOptionsDialog;
- private InputMethodManager mImm;
+ private InputMethodManagerCompatWrapper mImm;
private Resources mResources;
private SharedPreferences mPrefs;
private String mInputMethodId;
private KeyboardSwitcher mKeyboardSwitcher;
private SubtypeSwitcher mSubtypeSwitcher;
- private VoiceIMEConnector mVoiceConnector;
+ private VoiceProxy mVoiceProxy;
private UserDictionary mUserDictionary;
private UserBigramDictionary mUserBigramDictionary;
@@ -204,59 +212,47 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
/* package */ String mWordSeparators;
private String mSentenceSeparators;
private String mSuggestPuncs;
- // TODO: Move this flag to VoiceIMEConnector
+ // TODO: Move this flag to VoiceProxy
private boolean mConfigurationChanging;
+ // Object for reacting to adding/removing a dictionary pack.
+ private BroadcastReceiver mDictionaryPackInstallReceiver =
+ new DictionaryPackInstallBroadcastReceiver(this);
+
// Keeps track of most recently inserted text (multi-character key) for reverting
private CharSequence mEnteredText;
private final ArrayList<WordAlternatives> mWordHistory = new ArrayList<WordAlternatives>();
- public abstract static class WordAlternatives {
- protected CharSequence mChosenWord;
-
- public WordAlternatives() {
- // Nothing
- }
+ public class WordAlternatives {
+ private final CharSequence mChosenWord;
+ private final WordComposer mWordComposer;
- public WordAlternatives(CharSequence chosenWord) {
+ public WordAlternatives(CharSequence chosenWord, WordComposer wordComposer) {
mChosenWord = chosenWord;
+ mWordComposer = wordComposer;
}
- @Override
- public int hashCode() {
- return mChosenWord.hashCode();
- }
-
- public abstract CharSequence getOriginalWord();
-
public CharSequence getChosenWord() {
return mChosenWord;
}
- public abstract SuggestedWords.Builder getAlternatives();
- }
-
- public class TypedWordAlternatives extends WordAlternatives {
- private WordComposer word;
-
- public TypedWordAlternatives() {
- // Nothing
+ public CharSequence getOriginalWord() {
+ return mWordComposer.getTypedWord();
}
- public TypedWordAlternatives(CharSequence chosenWord, WordComposer wordComposer) {
- super(chosenWord);
- word = wordComposer;
+ public SuggestedWords.Builder getAlternatives() {
+ return getTypedSuggestions(mWordComposer);
}
@Override
- public CharSequence getOriginalWord() {
- return word.getTypedWord();
+ public int hashCode() {
+ return mChosenWord.hashCode();
}
@Override
- public SuggestedWords.Builder getAlternatives() {
- return getTypedSuggestions(word);
+ public boolean equals(Object o) {
+ return o instanceof CharSequence && TextUtils.equals(mChosenWord, (CharSequence)o);
}
}
@@ -286,7 +282,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
switcher.updateShiftState();
break;
case MSG_VOICE_RESULTS:
- mVoiceConnector.handleVoiceResults(preferCapitalization()
+ mVoiceProxy.handleVoiceResults(preferCapitalization()
|| (switcher.isAlphabetMode() && switcher.isShiftedOrShiftLocked()));
break;
case MSG_FADEOUT_LANGUAGE_ON_SPACEBAR:
@@ -379,13 +375,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
mPrefs = prefs;
LatinImeLogger.init(this, prefs);
+ LanguageSwitcherProxy.init(this, prefs);
SubtypeSwitcher.init(this, prefs);
KeyboardSwitcher.init(this, prefs);
AccessibilityUtils.init(this, prefs);
super.onCreate();
- mImm = ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE));
+ mImm = InputMethodManagerCompatWrapper.getInstance(this);
mInputMethodId = Utils.getInputMethodId(mImm, getPackageName());
mSubtypeSwitcher = SubtypeSwitcher.getInstance();
mKeyboardSwitcher = KeyboardSwitcher.getInstance();
@@ -430,18 +427,31 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mOrientation = res.getConfiguration().orientation;
initSuggestPuncList();
- // register to receive ringer mode change and network state change.
+ // Register to receive ringer mode change and network state change.
+ // Also receive installation and removal of a dictionary pack.
final IntentFilter filter = new IntentFilter();
filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
registerReceiver(mReceiver, filter);
- mVoiceConnector = VoiceIMEConnector.init(this, prefs, mHandler);
+ mVoiceProxy = VoiceProxy.init(this, prefs, mHandler);
+
+ final IntentFilter packageFilter = new IntentFilter();
+ packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
+ packageFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
+ packageFilter.addDataScheme(SCHEME_PACKAGE);
+ registerReceiver(mDictionaryPackInstallReceiver, packageFilter);
+
+ final IntentFilter newDictFilter = new IntentFilter();
+ newDictFilter.addAction(
+ DictionaryPackInstallBroadcastReceiver.NEW_DICTIONARY_INTENT_ACTION);
+ registerReceiver(mDictionaryPackInstallReceiver, newDictFilter);
}
private void initSuggest() {
- String locale = mSubtypeSwitcher.getInputLocaleStr();
+ final String localeStr = mSubtypeSwitcher.getInputLocaleStr();
+ final Locale keyboardLocale = new Locale(localeStr);
- Locale savedLocale = mSubtypeSwitcher.changeSystemLocale(new Locale(locale));
+ final Locale savedLocale = mSubtypeSwitcher.changeSystemLocale(keyboardLocale);
if (mSuggest != null) {
mSuggest.close();
}
@@ -450,20 +460,20 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final Resources res = mResources;
int mainDicResId = Utils.getMainDictionaryResourceId(res);
- mSuggest = new Suggest(this, mainDicResId);
+ mSuggest = new Suggest(this, mainDicResId, keyboardLocale);
loadAndSetAutoCorrectionThreshold(prefs);
updateAutoTextEnabled();
- mUserDictionary = new UserDictionary(this, locale);
+ mUserDictionary = new UserDictionary(this, localeStr);
mSuggest.setUserDictionary(mUserDictionary);
mContactsDictionary = new ContactsDictionary(this, Suggest.DIC_CONTACTS);
mSuggest.setContactsDictionary(mContactsDictionary);
- mAutoDictionary = new AutoDictionary(this, this, locale, Suggest.DIC_AUTO);
+ mAutoDictionary = new AutoDictionary(this, this, localeStr, Suggest.DIC_AUTO);
mSuggest.setAutoDictionary(mAutoDictionary);
- mUserBigramDictionary = new UserBigramDictionary(this, this, locale, Suggest.DIC_USER);
+ mUserBigramDictionary = new UserBigramDictionary(this, this, localeStr, Suggest.DIC_USER);
mSuggest.setUserBigramDictionary(mUserBigramDictionary);
updateCorrectionMode();
@@ -473,6 +483,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mSubtypeSwitcher.changeSystemLocale(savedLocale);
}
+ /* package private */ void resetSuggestMainDict() {
+ final String localeStr = mSubtypeSwitcher.getInputLocaleStr();
+ final Locale keyboardLocale = new Locale(localeStr);
+ int mainDicResId = Utils.getMainDictionaryResourceId(mResources);
+ mSuggest.resetMainDict(this, mainDicResId, keyboardLocale);
+ }
+
@Override
public void onDestroy() {
if (mSuggest != null) {
@@ -480,7 +497,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mSuggest = null;
}
unregisterReceiver(mReceiver);
- mVoiceConnector.destroy();
+ unregisterReceiver(mDictionaryPackInstallReceiver);
+ mVoiceProxy.destroy();
LatinImeLogger.commit();
LatinImeLogger.onDestroy();
super.onDestroy();
@@ -501,8 +519,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mConfigurationChanging = true;
super.onConfigurationChanged(conf);
- mVoiceConnector.onConfigurationChanged(conf);
+ mVoiceProxy.onConfigurationChanged(conf);
mConfigurationChanging = false;
+
+ // This will work only when the subtype is not supported.
+ LanguageSwitcherProxy.onConfigurationChanged(conf);
}
@Override
@@ -515,12 +536,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
LayoutInflater inflater = getLayoutInflater();
LinearLayout container = (LinearLayout)inflater.inflate(R.layout.candidates, null);
mCandidateViewContainer = container;
- if (container.getPaddingRight() != 0) {
- HorizontalScrollView scrollView =
- (HorizontalScrollView) container.findViewById(R.id.candidates_scroll_view);
- scrollView.setOverScrollMode(View.OVER_SCROLL_NEVER);
- container.setGravity(Gravity.CENTER_HORIZONTAL);
- }
+ mCandidateStripHeight = (int)mResources.getDimension(R.dimen.candidate_strip_height);
mCandidateView = (CandidateView) container.findViewById(R.id.candidates);
mCandidateView.setService(this);
setCandidatesViewShown(true);
@@ -547,9 +563,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Most such things we decide below in initializeInputAttributesAndGetMode, but we need to
// know now whether this is a password text field, because we need to know now whether we
// want to enable the voice button.
- final VoiceIMEConnector voiceIme = mVoiceConnector;
- voiceIme.resetVoiceStates(Utils.isPasswordInputType(attribute.inputType)
- || Utils.isVisiblePasswordInputType(attribute.inputType));
+ final VoiceProxy voiceIme = mVoiceProxy;
+ voiceIme.resetVoiceStates(InputTypeCompatUtils.isPasswordInputType(attribute.inputType)
+ || InputTypeCompatUtils.isVisiblePasswordInputType(attribute.inputType));
initializeInputAttributes(attribute);
@@ -568,8 +584,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
switcher.updateShiftState();
}
- setCandidatesViewShownInternal(isCandidateStripVisible(),
- false /* needsInputViewShown */ );
+ setCandidatesViewShownInternal(isCandidateStripVisible(), false /* needsInputViewShown */ );
// Delay updating suggestions because keyboard input view may not be shown at this point.
mHandler.postUpdateSuggestions();
@@ -603,17 +618,17 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if ((inputType & InputType.TYPE_MASK_CLASS) == InputType.TYPE_CLASS_TEXT) {
mIsSettingsSuggestionStripOn = true;
// Make sure that passwords are not displayed in candidate view
- if (Utils.isPasswordInputType(inputType)
- || Utils.isVisiblePasswordInputType(inputType)) {
+ if (InputTypeCompatUtils.isPasswordInputType(inputType)
+ || InputTypeCompatUtils.isVisiblePasswordInputType(inputType)) {
mIsSettingsSuggestionStripOn = false;
}
- if (Utils.isEmailVariation(variation)
+ if (InputTypeCompatUtils.isEmailVariation(variation)
|| variation == InputType.TYPE_TEXT_VARIATION_PERSON_NAME) {
mAutoSpace = false;
} else {
mAutoSpace = true;
}
- if (Utils.isEmailVariation(variation)) {
+ if (InputTypeCompatUtils.isEmailVariation(variation)) {
mIsSettingsSuggestionStripOn = false;
} else if (variation == InputType.TYPE_TEXT_VARIATION_URI) {
mIsSettingsSuggestionStripOn = false;
@@ -679,7 +694,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
LatinImeLogger.commit();
mKeyboardSwitcher.onAutoCorrectionStateChanged(false);
- mVoiceConnector.flushVoiceInputLogs(mConfigurationChanging);
+ mVoiceProxy.flushVoiceInputLogs(mConfigurationChanging);
KeyboardView inputView = mKeyboardSwitcher.getInputView();
if (inputView != null) inputView.closing();
@@ -700,7 +715,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override
public void onUpdateExtractedText(int token, ExtractedText text) {
super.onUpdateExtractedText(token, text);
- mVoiceConnector.showPunctuationHintIfNecessary();
+ mVoiceProxy.showPunctuationHintIfNecessary();
}
@Override
@@ -721,7 +736,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
+ ", ce=" + candidatesEnd);
}
- mVoiceConnector.setCursorAndSelection(newSelEnd, newSelStart);
+ mVoiceProxy.setCursorAndSelection(newSelEnd, newSelStart);
// If the current selection in the text view changes, we should
// clear whatever candidate text we have.
@@ -729,7 +744,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|| newSelEnd != candidatesEnd) && mLastSelectionStart != newSelStart;
final boolean candidatesCleared = candidatesStart == -1 && candidatesEnd == -1;
if (((mComposing.length() > 0 && mHasValidSuggestions)
- || mVoiceConnector.isVoiceInputHighlighted())
+ || mVoiceProxy.isVoiceInputHighlighted())
&& (selectionChanged || candidatesCleared)) {
if (candidatesCleared) {
// If the composing span has been cleared, save the typed word in the history for
@@ -745,7 +760,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (ic != null) {
ic.finishComposingText();
}
- mVoiceConnector.setVoiceInputHighlighted(false);
+ mVoiceProxy.setVoiceInputHighlighted(false);
} else if (!mHasValidSuggestions && !mJustAccepted) {
if (TextEntryState.isAcceptedDefault() || TextEntryState.isSpaceAfterPicked()) {
if (TextEntryState.isAcceptedDefault())
@@ -825,7 +840,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mOptionsDialog.dismiss();
mOptionsDialog = null;
}
- mVoiceConnector.hideVoiceWindow(mConfigurationChanging);
+ mVoiceProxy.hideVoiceWindow(mConfigurationChanging);
mWordHistory.clear();
super.hideWindow();
}
@@ -859,10 +874,21 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
private void setCandidatesViewShownInternal(boolean shown, boolean needsInputViewShown) {
- // TODO: Remove this if we support candidates with hard keyboard
+ // TODO: Modify this if we support candidates with hard keyboard
if (onEvaluateInputViewShown()) {
- super.setCandidatesViewShown(shown
- && (needsInputViewShown ? mKeyboardSwitcher.isInputViewShown() : true));
+ final boolean shouldShowCandidates = shown
+ && (needsInputViewShown ? mKeyboardSwitcher.isInputViewShown() : true);
+ if (isExtractViewShown()) {
+ // No need to have extra space to show the key preview.
+ mCandidateViewContainer.setMinimumHeight(0);
+ super.setCandidatesViewShown(shown);
+ } else {
+ // We must control the visibility of the suggestion strip in order to avoid clipped
+ // key previews, even when we don't show the suggestion strip.
+ mCandidateViewContainer.setVisibility(
+ shouldShowCandidates ? View.VISIBLE : View.INVISIBLE);
+ super.setCandidatesViewShown(true);
+ }
}
}
@@ -874,36 +900,25 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override
public void onComputeInsets(InputMethodService.Insets outInsets) {
super.onComputeInsets(outInsets);
- if (!isFullscreenMode()) {
- outInsets.contentTopInsets = outInsets.visibleTopInsets;
- }
- KeyboardView inputView = mKeyboardSwitcher.getInputView();
+ final KeyboardView inputView = mKeyboardSwitcher.getInputView();
// Need to set touchable region only if input view is being shown
if (inputView != null && mKeyboardSwitcher.isInputViewShown()) {
- final int x = 0;
- int y = 0;
- final int width = inputView.getWidth();
- int height = inputView.getHeight() + EXTENDED_TOUCHABLE_REGION_HEIGHT;
- if (mCandidateViewContainer != null) {
- ViewParent candidateParent = mCandidateViewContainer.getParent();
- if (candidateParent instanceof FrameLayout) {
- FrameLayout fl = (FrameLayout) candidateParent;
- if (fl != null) {
- // Check frame layout's visibility
- if (fl.getVisibility() == View.INVISIBLE) {
- y = fl.getHeight();
- height += y;
- } else if (fl.getVisibility() == View.VISIBLE) {
- height += fl.getHeight();
- }
- }
- }
+ final int containerHeight = mCandidateViewContainer.getHeight();
+ int touchY = containerHeight;
+ if (mCandidateViewContainer.getVisibility() == View.VISIBLE) {
+ touchY -= mCandidateStripHeight;
}
+ outInsets.contentTopInsets = touchY;
+ outInsets.visibleTopInsets = touchY;
+ final int touchWidth = inputView.getWidth();
+ final int touchHeight = inputView.getHeight() + containerHeight
+ // Extend touchable region below the keyboard.
+ + EXTENDED_TOUCHABLE_REGION_HEIGHT;
if (DEBUG) {
- Log.d(TAG, "Touchable region " + x + ", " + y + ", " + width + ", " + height);
+ Log.d(TAG, "Touchable region: y=" + touchY + " width=" + touchWidth
+ + " height=" + touchHeight);
}
- outInsets.touchableInsets = InputMethodService.Insets.TOUCHABLE_INSETS_REGION;
- outInsets.touchableRegion.set(x, y, width, height);
+ setTouchableRegionCompat(outInsets, 0, touchY, touchWidth, touchHeight);
}
}
@@ -1143,10 +1158,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
onSettingsKeyLongPressed();
break;
case Keyboard.CODE_NEXT_LANGUAGE:
- toggleLanguage(false, true);
+ toggleLanguage(true);
break;
case Keyboard.CODE_PREV_LANGUAGE:
- toggleLanguage(false, false);
+ toggleLanguage(false);
break;
case Keyboard.CODE_CAPSLOCK:
switcher.toggleCapsLock();
@@ -1161,10 +1176,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (primaryCode != Keyboard.CODE_ENTER) {
mJustAddedAutoSpace = false;
}
- RingCharBuffer.getInstance().push((char)primaryCode, x, y);
- LatinImeLogger.logOnInputChar();
if (isWordSeparator(primaryCode)) {
- handleSeparator(primaryCode);
+ handleSeparator(primaryCode, x, y);
} else {
handleCharacter(primaryCode, keyCodes, x, y);
}
@@ -1176,7 +1189,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override
public void onTextInput(CharSequence text) {
- mVoiceConnector.commitVoiceInput();
+ mVoiceProxy.commitVoiceInput();
InputConnection ic = getCurrentInputConnection();
if (ic == null) return;
abortRecorrection(false);
@@ -1198,13 +1211,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
private void handleBackspace() {
- if (mVoiceConnector.logAndRevertVoiceInput()) return;
+ if (mVoiceProxy.logAndRevertVoiceInput()) return;
final InputConnection ic = getCurrentInputConnection();
if (ic == null) return;
ic.beginBatchEdit();
- mVoiceConnector.handleBackspace();
+ mVoiceProxy.handleBackspace();
boolean deleteChar = false;
if (mHasValidSuggestions) {
@@ -1256,9 +1269,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private void handleTab() {
final int imeOptions = getCurrentInputEditorInfo().imeOptions;
- final int navigationFlags =
- EditorInfo.IME_FLAG_NAVIGATE_NEXT | EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS;
- if ((imeOptions & navigationFlags) == 0) {
+ if (!EditorInfoCompatUtils.hasFlagNavigateNext(imeOptions)
+ && !EditorInfoCompatUtils.hasFlagNavigatePrevious(imeOptions)) {
sendDownUpKeyEvents(KeyEvent.KEYCODE_TAB);
return;
}
@@ -1269,12 +1281,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// True if keyboard is in either chording shift or manual temporary upper case mode.
final boolean isManualTemporaryUpperCase = mKeyboardSwitcher.isManualTemporaryUpperCase();
- if ((imeOptions & EditorInfo.IME_FLAG_NAVIGATE_NEXT) != 0
+ if (EditorInfoCompatUtils.hasFlagNavigateNext(imeOptions)
&& !isManualTemporaryUpperCase) {
+ EditorInfoCompatUtils.performEditorActionNext(ic);
ic.performEditorAction(EditorInfo.IME_ACTION_NEXT);
- } else if ((imeOptions & EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS) != 0
+ } else if (EditorInfoCompatUtils.hasFlagNavigatePrevious(imeOptions)
&& isManualTemporaryUpperCase) {
- ic.performEditorAction(EditorInfo.IME_ACTION_PREVIOUS);
+ EditorInfoCompatUtils.performEditorActionPrevious(ic);
}
}
@@ -1288,7 +1301,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
private void handleCharacter(int primaryCode, int[] keyCodes, int x, int y) {
- mVoiceConnector.handleCharacter();
+ mVoiceProxy.handleCharacter();
if (mLastSelectionStart == mLastSelectionEnd && TextEntryState.isRecorrecting()) {
abortRecorrection(false);
@@ -1344,11 +1357,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
switcher.updateShiftState();
if (LatinIME.PERF_DEBUG) measureCps();
- TextEntryState.typedCharacter((char) code, isWordSeparator(code));
+ TextEntryState.typedCharacter((char) code, isWordSeparator(code), x, y);
}
- private void handleSeparator(int primaryCode) {
- mVoiceConnector.handleSeparator();
+ private void handleSeparator(int primaryCode, int x, int y) {
+ mVoiceProxy.handleSeparator();
// Should dismiss the "Touch again to save" message when handling separator
if (mCandidateView != null && mCandidateView.dismissAddToDictionaryHint()) {
@@ -1368,7 +1381,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// in Italian dov' should not be expanded to dove' because the elision
// requires the last vowel to be removed.
if (mAutoCorrectOn && primaryCode != '\'') {
- pickedDefault = pickDefaultSuggestion();
+ pickedDefault = pickDefaultSuggestion(primaryCode);
// Picked the suggestion by the space key. We consider this
// as "added an auto space".
if (primaryCode == Keyboard.CODE_SPACE) {
@@ -1390,7 +1403,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
reswapPeriodAndSpace();
}
- TextEntryState.typedCharacter((char) primaryCode, true);
+ TextEntryState.typedCharacter((char) primaryCode, true, x, y);
if (TextEntryState.isPunctuationAfterAccepted() && primaryCode != Keyboard.CODE_ENTER) {
swapPunctuationAndSpace();
} else if (isSuggestionsRequested() && primaryCode == Keyboard.CODE_SPACE) {
@@ -1400,11 +1413,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
CharSequence typedWord = mWord.getTypedWord();
TextEntryState.backToAcceptedDefault(typedWord);
if (!TextUtils.isEmpty(typedWord) && !typedWord.equals(mBestWord)) {
- if (ic != null) {
- CorrectionInfo correctionInfo = new CorrectionInfo(
- mLastSelectionEnd - typedWord.length(), typedWord, mBestWord);
- ic.commitCorrection(correctionInfo);
- }
+ InputConnectionCompatUtils.commitCorrection(
+ ic, mLastSelectionEnd - typedWord.length(), typedWord, mBestWord);
if (mCandidateView != null)
mCandidateView.onAutoCorrectionInverted(mBestWord);
}
@@ -1418,7 +1428,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private void handleClose() {
commitTyped(getCurrentInputConnection());
- mVoiceConnector.handleClose();
+ mVoiceProxy.handleClose();
requestHideSelf(0);
LatinKeyboardView inputView = mKeyboardSwitcher.getInputView();
if (inputView != null)
@@ -1436,7 +1446,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Make a copy of the CharSequence, since it is/could be a mutable CharSequence
final String resultCopy = result.toString();
- TypedWordAlternatives entry = new TypedWordAlternatives(resultCopy,
+ WordAlternatives entry = new WordAlternatives(resultCopy,
new WordComposer(mWord));
mWordHistory.add(entry);
}
@@ -1491,7 +1501,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
public void setSuggestions(SuggestedWords words) {
- if (mVoiceConnector.getAndResetIsShowingHint()) {
+ if (mVoiceProxy.getAndResetIsShowingHint()) {
setCandidatesView(mCandidateViewContainer);
}
@@ -1507,7 +1517,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
public void updateSuggestions() {
// Check if we have a suggestion engine attached.
if ((mSuggest == null || !isSuggestionsRequested())
- && !mVoiceConnector.isVoiceInputHighlighted()) {
+ && !mVoiceProxy.isVoiceInputHighlighted()) {
return;
}
@@ -1582,14 +1592,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
setCandidatesViewShown(isCandidateStripVisible());
}
- private boolean pickDefaultSuggestion() {
+ private boolean pickDefaultSuggestion(int separatorCode) {
// Complete any pending candidate query first
if (mHandler.hasPendingUpdateSuggestions()) {
mHandler.cancelUpdateSuggestions();
updateSuggestions();
}
if (mBestWord != null && mBestWord.length() > 0) {
- TextEntryState.acceptedDefault(mWord.getTypedWord(), mBestWord);
+ TextEntryState.acceptedDefault(mWord.getTypedWord(), mBestWord, separatorCode);
mJustAccepted = true;
pickSuggestion(mBestWord);
// Add the word to the auto dictionary if it's not a known word
@@ -1602,7 +1612,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
public void pickSuggestionManually(int index, CharSequence suggestion) {
SuggestedWords suggestions = mCandidateView.getSuggestions();
- mVoiceConnector.flushAndLogAllTextModificationCounters(index, suggestion, mWordSeparators);
+ mVoiceProxy.flushAndLogAllTextModificationCounters(index, suggestion, mWordSeparators);
final boolean recorrecting = TextEntryState.isRecorrecting();
InputConnection ic = getCurrentInputConnection();
@@ -1678,7 +1688,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Fool the state watcher so that a subsequent backspace will not do a revert, unless
// we just did a correction, in which case we need to stay in
// TextEntryState.State.PICKED_SUGGESTION state.
- TextEntryState.typedCharacter((char) Keyboard.CODE_SPACE, true);
+ TextEntryState.typedCharacter((char) Keyboard.CODE_SPACE, true,
+ WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE);
setPunctuationSuggestions();
} else if (!showingAddToDictionaryHint) {
// If we're not showing the "Touch again to save", then show corrections again.
@@ -1706,7 +1717,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return;
InputConnection ic = getCurrentInputConnection();
if (ic != null) {
- mVoiceConnector.rememberReplacedWord(suggestion, mWordSeparators);
+ mVoiceProxy.rememberReplacedWord(suggestion, mWordSeparators);
ic.commitText(suggestion, 1);
}
saveWordInHistory(suggestion);
@@ -1727,9 +1738,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Search old suggestions to suggest re-corrected suggestions.
for (WordAlternatives entry : mWordHistory) {
if (TextUtils.equals(entry.getChosenWord(), touching.mWord)) {
- if (entry instanceof TypedWordAlternatives) {
- foundWord = ((TypedWordAlternatives) entry).word;
- }
+ foundWord = entry.mWordComposer;
alternatives = entry;
break;
}
@@ -1749,7 +1758,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Found a match, show suggestions
if (foundWord != null || alternatives != null) {
if (alternatives == null) {
- alternatives = new TypedWordAlternatives(touching.mWord, foundWord);
+ alternatives = new WordAlternatives(touching.mWord, foundWord);
}
showCorrections(alternatives);
if (foundWord != null) {
@@ -1763,7 +1772,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
private void setOldSuggestions() {
- mVoiceConnector.setShowingVoiceSuggestions(false);
+ if (!InputConnectionCompatUtils.RECORRECTION_SUPPORTED) return;
+ mVoiceProxy.setShowingVoiceSuggestions(false);
if (mCandidateView != null && mCandidateView.isShowingAddToDictionaryHint()) {
return;
}
@@ -1777,12 +1787,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (touching != null && touching.mWord.length() > 1) {
ic.beginBatchEdit();
- if (!mVoiceConnector.applyVoiceAlternatives(touching)
+ if (!mVoiceProxy.applyVoiceAlternatives(touching)
&& !applyTypedAlternatives(touching)) {
abortRecorrection(true);
} else {
TextEntryState.selectedForRecorrection();
- EditingUtils.underlineWord(ic, touching);
+ InputConnectionCompatUtils.underlineWord(ic, touching);
}
ic.endBatchEdit();
@@ -1886,7 +1896,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
ic.commitText(mComposing, 1);
TextEntryState.acceptedTyped(mComposing);
ic.commitText(punctuation, 1);
- TextEntryState.typedCharacter(punctuation.charAt(0), true);
+ TextEntryState.typedCharacter(punctuation.charAt(0), true,
+ WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE);
// Clear composing text
mComposing.setLength(0);
} else {
@@ -1922,23 +1933,23 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
return mWord.isFirstCharCapitalized();
}
- // Notify that language or mode have been changed and toggleLanguage will update KeyboaredID
+ // Notify that language or mode have been changed and toggleLanguage will update KeyboardID
// according to new language or mode.
public void onRefreshKeyboard() {
- toggleLanguage(true, true);
+ // Reload keyboard because the current language has been changed.
+ mKeyboardSwitcher.loadKeyboard(getCurrentInputEditorInfo(),
+ mSubtypeSwitcher.isShortcutImeEnabled() && mVoiceProxy.isVoiceButtonEnabled(),
+ mVoiceProxy.isVoiceButtonOnPrimary());
+ initSuggest();
+ mKeyboardSwitcher.updateShiftState();
}
// "reset" and "next" are used only for USE_SPACEBAR_LANGUAGE_SWITCHER.
- private void toggleLanguage(boolean reset, boolean next) {
+ private void toggleLanguage(boolean next) {
if (mSubtypeSwitcher.useSpacebarLanguageSwitcher()) {
- mSubtypeSwitcher.toggleLanguage(reset, next);
+ mSubtypeSwitcher.toggleLanguage(next);
}
- // Reload keyboard because the current language has been changed.
- mKeyboardSwitcher.loadKeyboard(getCurrentInputEditorInfo(),
- mSubtypeSwitcher.isShortcutImeEnabled() && mVoiceConnector.isVoiceButtonEnabled(),
- mVoiceConnector.isVoiceButtonOnPrimary());
- initSuggest();
- mKeyboardSwitcher.updateShiftState();
+ onRefreshKeyboard();// no need??
}
@Override
@@ -2108,9 +2119,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private void loadSettings(EditorInfo attribute) {
// Get the settings preferences
final SharedPreferences prefs = mPrefs;
- Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
- mVibrateOn = vibrator != null && vibrator.hasVibrator()
- && prefs.getBoolean(Settings.PREF_VIBRATE_ON, false);
+ final boolean hasVibrator = VibratorCompatWrapper.getInstance(this).hasVibrator();
+ mVibrateOn = hasVibrator && prefs.getBoolean(Settings.PREF_VIBRATE_ON, false);
mSoundOn = prefs.getBoolean(Settings.PREF_SOUND_ON,
mResources.getBoolean(R.bool.config_default_sound_enabled));
@@ -2122,12 +2132,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mBigramSuggestionEnabled = mAutoCorrectEnabled && isBigramSuggestionEnabled(prefs);
loadAndSetAutoCorrectionThreshold(prefs);
- mVoiceConnector.loadSettings(attribute, prefs);
+ mVoiceProxy.loadSettings(attribute, prefs);
updateCorrectionMode();
updateAutoTextEnabled();
updateSuggestionVisibility(prefs);
- SubtypeSwitcher.getInstance().loadSettings();
+
+ // This will work only when the subtype is not supported.
+ LanguageSwitcherProxy.loadSettings();
}
/**
@@ -2233,13 +2245,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
di.dismiss();
switch (position) {
case 0:
- Intent intent = new Intent(
- android.provider.Settings.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS);
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
+ Intent intent = CompatUtils.getInputLanguageSelectionIntent(
+ mInputMethodId, Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
- intent.putExtra(android.provider.Settings.EXTRA_INPUT_METHOD_ID,
- mInputMethodId);
startActivity(intent);
break;
case 1:
@@ -2332,9 +2341,4 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
for (int i = 0; i < CPS_BUFFER_SIZE; i++) total += mCpsIntervals[i];
System.out.println("CPS = " + ((CPS_BUFFER_SIZE * 1000f) / total));
}
-
- @Override
- public void onCurrentInputMethodSubtypeChanged(InputMethodSubtype subtype) {
- SubtypeSwitcher.getInstance().updateSubtype(subtype);
- }
}
diff --git a/java/src/com/android/inputmethod/latin/LatinImeLogger.java b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
index aaecfffdd..e460471a5 100644
--- a/java/src/com/android/inputmethod/latin/LatinImeLogger.java
+++ b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
@@ -45,10 +45,10 @@ public class LatinImeLogger implements SharedPreferences.OnSharedPreferenceChang
String before, String after, int position, List<CharSequence> suggestions) {
}
- public static void logOnAutoSuggestion(String before, String after) {
+ public static void logOnAutoCorrection(String before, String after, int separatorCode) {
}
- public static void logOnAutoSuggestionCanceled() {
+ public static void logOnAutoCorrectionCancelled() {
}
public static void logOnDelete() {
@@ -57,6 +57,9 @@ public class LatinImeLogger implements SharedPreferences.OnSharedPreferenceChang
public static void logOnInputChar() {
}
+ public static void logOnInputSeparator() {
+ }
+
public static void logOnException(String metaData, Throwable e) {
}
diff --git a/java/src/com/android/inputmethod/latin/PrivateBinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/PrivateBinaryDictionaryGetter.java
new file mode 100644
index 000000000..90726b0d8
--- /dev/null
+++ b/java/src/com/android/inputmethod/latin/PrivateBinaryDictionaryGetter.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2011 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;
+
+import android.content.Context;
+
+import java.util.Locale;
+
+class PrivateBinaryDictionaryGetter {
+ private PrivateBinaryDictionaryGetter() {}
+ public static AssetFileAddress getDictionaryFile(Locale locale, Context context) {
+ return null;
+ }
+}
diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java
index 341d5add0..8f7278e3a 100644
--- a/java/src/com/android/inputmethod/latin/Settings.java
+++ b/java/src/com/android/inputmethod/latin/Settings.java
@@ -16,8 +16,10 @@
package com.android.inputmethod.latin;
-import com.android.inputmethod.voice.VoiceIMEConnector;
-import com.android.inputmethod.voice.VoiceInputLogger;
+import com.android.inputmethod.compat.CompatUtils;
+import com.android.inputmethod.compat.InputMethodManagerCompatWrapper;
+import com.android.inputmethod.deprecated.VoiceProxy;
+import com.android.inputmethod.compat.VibratorCompatWrapper;
import android.app.AlertDialog;
import android.app.Dialog;
@@ -26,7 +28,6 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
-import android.os.Vibrator;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
@@ -65,6 +66,7 @@ public class Settings extends PreferenceActivity
public static final String PREF_SHOW_SUGGESTIONS_SETTING = "show_suggestions_setting";
public static final String PREF_AUTO_CORRECTION_THRESHOLD = "auto_correction_threshold";
public static final String PREF_BIGRAM_SUGGESTIONS = "bigram_suggestion";
+ public static final String PREF_DEBUG_SETTINGS = "debug_settings";
public static final String PREF_USABILITY_STUDY_MODE = "usability_study_mode";
@@ -78,11 +80,12 @@ public class Settings extends PreferenceActivity
private ListPreference mShowCorrectionSuggestionsPreference;
private ListPreference mAutoCorrectionThreshold;
private CheckBoxPreference mBigramSuggestion;
+ private Preference mDebugSettingsPreference;
private boolean mVoiceOn;
private AlertDialog mDialog;
- private VoiceInputLogger mLogger;
+ private VoiceProxy.VoiceLoggerWrapper mVoiceLogger;
private boolean mOkClicked = false;
private String mVoiceModeOff;
@@ -111,10 +114,17 @@ public class Settings extends PreferenceActivity
mVoiceModeOff = getString(R.string.voice_mode_off);
mVoiceOn = !(prefs.getString(PREF_VOICE_SETTINGS_KEY, mVoiceModeOff)
.equals(mVoiceModeOff));
- mLogger = VoiceInputLogger.getLogger(this);
+ mVoiceLogger = VoiceProxy.VoiceLoggerWrapper.getInstance(this);
mAutoCorrectionThreshold = (ListPreference) findPreference(PREF_AUTO_CORRECTION_THRESHOLD);
mBigramSuggestion = (CheckBoxPreference) findPreference(PREF_BIGRAM_SUGGESTIONS);
+ mDebugSettingsPreference = findPreference(PREF_DEBUG_SETTINGS);
+ if (mDebugSettingsPreference != null) {
+ final Intent debugSettingsIntent = new Intent(Intent.ACTION_MAIN);
+ debugSettingsIntent.setClassName(getPackageName(), DebugSettings.class.getName());
+ mDebugSettingsPreference.setIntent(debugSettingsIntent);
+ }
+
ensureConsistencyOfAutoCorrectionSettings();
final PreferenceGroup generalSettings =
@@ -134,8 +144,7 @@ public class Settings extends PreferenceActivity
generalSettings.removePreference(mVoicePreference);
}
- Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
- if (vibrator == null || !vibrator.hasVibrator()) {
+ if (!VibratorCompatWrapper.getInstance(this).hasVibrator()) {
generalSettings.removePreference(findPreference(PREF_VIBRATE_ON));
}
@@ -184,7 +193,7 @@ public class Settings extends PreferenceActivity
((PreferenceGroup) findPreference(PREF_PREDICTION_SETTINGS_KEY))
.removePreference(mQuickFixes);
}
- if (!VoiceIMEConnector.VOICE_INSTALLED
+ if (!VoiceProxy.VOICE_INSTALLED
|| !SpeechRecognizer.isRecognitionAvailable(this)) {
getPreferenceScreen().removePreference(mVoicePreference);
} else {
@@ -222,16 +231,9 @@ public class Settings extends PreferenceActivity
@Override
public boolean onPreferenceClick(Preference pref) {
if (pref == mInputLanguageSelection) {
- final String action;
- if (android.os.Build.VERSION.SDK_INT
- >= /* android.os.Build.VERSION_CODES.HONEYCOMB */ 11) {
- // Refer to android.provider.Settings.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS
- // TODO: Can this be a constant instead of literal String constant?
- action = "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS";
- } else {
- action = "com.android.inputmethod.latin.INPUT_LANGUAGE_SELECTION";
- }
- startActivity(new Intent(action));
+ startActivity(CompatUtils.getInputLanguageSelectionIntent(
+ Utils.getInputMethodId(InputMethodManagerCompatWrapper.getInstance(this),
+ getApplicationInfo().packageName), 0));
return true;
}
return false;
@@ -277,10 +279,10 @@ public class Settings extends PreferenceActivity
public void onClick(DialogInterface dialog, int whichButton) {
if (whichButton == DialogInterface.BUTTON_NEGATIVE) {
mVoicePreference.setValue(mVoiceModeOff);
- mLogger.settingsWarningDialogCancel();
+ mVoiceLogger.settingsWarningDialogCancel();
} else if (whichButton == DialogInterface.BUTTON_POSITIVE) {
mOkClicked = true;
- mLogger.settingsWarningDialogOk();
+ mVoiceLogger.settingsWarningDialogOk();
}
updateVoicePreference();
}
@@ -311,7 +313,7 @@ public class Settings extends PreferenceActivity
AlertDialog dialog = builder.create();
mDialog = dialog;
dialog.setOnDismissListener(this);
- mLogger.settingsWarningDialogShown();
+ mVoiceLogger.settingsWarningDialogShown();
return dialog;
default:
Log.e(TAG, "unknown dialog " + id);
@@ -321,7 +323,7 @@ public class Settings extends PreferenceActivity
@Override
public void onDismiss(DialogInterface dialog) {
- mLogger.settingsWarningDialogDismissed();
+ mVoiceLogger.settingsWarningDialogDismissed();
if (!mOkClicked) {
// This assumes that onPreferenceClick gets called first, and this if the user
// agreed after the warning, we set the mOkClicked value to true.
@@ -331,10 +333,6 @@ public class Settings extends PreferenceActivity
private void updateVoicePreference() {
boolean isChecked = !mVoicePreference.getValue().equals(mVoiceModeOff);
- if (isChecked) {
- mLogger.voiceInputSettingEnabled();
- } else {
- mLogger.voiceInputSettingDisabled();
- }
+ mVoiceLogger.voiceInputSettingEnabled(isChecked);
}
}
diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
index dc14d770a..2cdc4d2cd 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
@@ -16,11 +16,12 @@
package com.android.inputmethod.latin;
+import com.android.inputmethod.compat.InputMethodInfoCompatWrapper;
+import com.android.inputmethod.compat.InputMethodManagerCompatWrapper;
+import com.android.inputmethod.compat.InputMethodSubtypeCompatWrapper;
+import com.android.inputmethod.deprecated.VoiceProxy;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.keyboard.LatinKeyboard;
-import com.android.inputmethod.voice.SettingsUtil;
-import com.android.inputmethod.voice.VoiceIMEConnector;
-import com.android.inputmethod.voice.VoiceInput;
import android.content.Context;
import android.content.Intent;
@@ -31,12 +32,10 @@ import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
+import android.os.AsyncTask;
import android.os.IBinder;
import android.text.TextUtils;
import android.util.Log;
-import android.view.inputmethod.InputMethodInfo;
-import android.view.inputmethod.InputMethodManager;
-import android.view.inputmethod.InputMethodSubtype;
import java.util.ArrayList;
import java.util.Arrays;
@@ -58,27 +57,29 @@ public class SubtypeSwitcher {
private static final SubtypeSwitcher sInstance = new SubtypeSwitcher();
private /* final */ LatinIME mService;
- private /* final */ SharedPreferences mPrefs;
- private /* final */ InputMethodManager mImm;
+ private /* final */ InputMethodManagerCompatWrapper mImm;
private /* final */ Resources mResources;
private /* final */ ConnectivityManager mConnectivityManager;
private /* final */ boolean mConfigUseSpacebarLanguageSwitcher;
- private final ArrayList<InputMethodSubtype> mEnabledKeyboardSubtypesOfCurrentInputMethod =
- new ArrayList<InputMethodSubtype>();
+ private final ArrayList<InputMethodSubtypeCompatWrapper>
+ mEnabledKeyboardSubtypesOfCurrentInputMethod =
+ new ArrayList<InputMethodSubtypeCompatWrapper>();
private final ArrayList<String> mEnabledLanguagesOfCurrentInputMethod = new ArrayList<String>();
+ private final LanguageBarInfo mLanguageBarInfo = new LanguageBarInfo();
/*-----------------------------------------------------------*/
// Variants which should be changed only by reload functions.
private boolean mNeedsToDisplayLanguage;
private boolean mIsSystemLanguageSameAsInputLanguage;
- private InputMethodInfo mShortcutInputMethodInfo;
- private InputMethodSubtype mShortcutSubtype;
- private List<InputMethodSubtype> mAllEnabledSubtypesOfCurrentInputMethod;
- private InputMethodSubtype mCurrentSubtype;
+ private InputMethodInfoCompatWrapper mShortcutInputMethodInfo;
+ private InputMethodSubtypeCompatWrapper mShortcutSubtype;
+ private List<InputMethodSubtypeCompatWrapper> mAllEnabledSubtypesOfCurrentInputMethod;
+ private InputMethodSubtypeCompatWrapper mCurrentSubtype;
private Locale mSystemLocale;
private Locale mInputLocale;
private String mInputLocaleStr;
- private VoiceInput mVoiceInput;
+ private String mInputMethodId;
+ private VoiceProxy.VoiceInputWrapper mVoiceInputWrapper;
/*-----------------------------------------------------------*/
private boolean mIsNetworkConnected;
@@ -100,9 +101,8 @@ public class SubtypeSwitcher {
private void initialize(LatinIME service, SharedPreferences prefs) {
mService = service;
- mPrefs = prefs;
mResources = service.getResources();
- mImm = (InputMethodManager) service.getSystemService(Context.INPUT_METHOD_SERVICE);
+ mImm = InputMethodManagerCompatWrapper.getInstance(service);
mConnectivityManager = (ConnectivityManager) service.getSystemService(
Context.CONNECTIVITY_SERVICE);
mEnabledKeyboardSubtypesOfCurrentInputMethod.clear();
@@ -113,14 +113,13 @@ public class SubtypeSwitcher {
mCurrentSubtype = null;
mAllEnabledSubtypesOfCurrentInputMethod = null;
// TODO: Voice input should be created here
- mVoiceInput = null;
- mConfigUseSpacebarLanguageSwitcher = mResources.getBoolean(
+ mVoiceInputWrapper = null;
+ mConfigUseSpacebarLanguageSwitcher = service.getResources().getBoolean(
R.bool.config_use_spacebar_language_switcher);
- if (mConfigUseSpacebarLanguageSwitcher)
- initLanguageSwitcher(service);
final NetworkInfo info = mConnectivityManager.getActiveNetworkInfo();
mIsNetworkConnected = (info != null && info.isConnected());
+ mInputMethodId = Utils.getInputMethodId(mImm, service.getPackageName());
}
// Update all parameters stored in SubtypeSwitcher.
@@ -134,11 +133,7 @@ public class SubtypeSwitcher {
// Update parameters which are changed outside LatinIME. This parameters affect UI so they
// should be updated every time onStartInputview.
public void updateParametersOnStartInputView() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- updateForSpacebarLanguageSwitch();
- } else {
- updateEnabledSubtypes();
- }
+ updateEnabledSubtypes();
updateShortcutIME();
}
@@ -150,7 +145,7 @@ public class SubtypeSwitcher {
null, true);
mEnabledLanguagesOfCurrentInputMethod.clear();
mEnabledKeyboardSubtypesOfCurrentInputMethod.clear();
- for (InputMethodSubtype ims: mAllEnabledSubtypesOfCurrentInputMethod) {
+ for (InputMethodSubtypeCompatWrapper ims : mAllEnabledSubtypesOfCurrentInputMethod) {
final String locale = ims.getLocale();
final String mode = ims.getMode();
mLocaleSplitter.setString(locale);
@@ -172,6 +167,10 @@ public class SubtypeSwitcher {
Log.w(TAG, "Last subtype was disabled. Update to the current one.");
}
updateSubtype(mImm.getCurrentInputMethodSubtype());
+ } else {
+ // mLanguageBarInfo.update() will be called in updateSubtype so there is no need
+ // to call this in the if-clause above.
+ mLanguageBarInfo.update();
}
}
@@ -184,10 +183,10 @@ public class SubtypeSwitcher {
+ ", " + mShortcutSubtype.getMode())));
}
// TODO: Update an icon for shortcut IME
- Map<InputMethodInfo, List<InputMethodSubtype>> shortcuts =
+ final Map<InputMethodInfoCompatWrapper, List<InputMethodSubtypeCompatWrapper>> shortcuts =
mImm.getShortcutInputMethodsAndSubtypes();
- for (InputMethodInfo imi: shortcuts.keySet()) {
- List<InputMethodSubtype> subtypes = shortcuts.get(imi);
+ for (InputMethodInfoCompatWrapper imi : shortcuts.keySet()) {
+ List<InputMethodSubtypeCompatWrapper> subtypes = shortcuts.get(imi);
// TODO: Returns the first found IMI for now. Should handle all shortcuts as
// appropriate.
mShortcutInputMethodInfo = imi;
@@ -206,7 +205,7 @@ public class SubtypeSwitcher {
}
// Update the current subtype. LatinIME.onCurrentInputMethodSubtypeChanged calls this function.
- public void updateSubtype(InputMethodSubtype newSubtype) {
+ public void updateSubtype(InputMethodSubtypeCompatWrapper newSubtype) {
final String newLocale;
final String newMode;
final String oldMode = getCurrentSubtypeMode();
@@ -243,32 +242,33 @@ public class SubtypeSwitcher {
// We cancel its status when we change mode, while we reset otherwise.
if (isKeyboardMode()) {
if (modeChanged) {
- if (VOICE_MODE.equals(oldMode) && mVoiceInput != null) {
- mVoiceInput.cancel();
+ if (VOICE_MODE.equals(oldMode) && mVoiceInputWrapper != null) {
+ mVoiceInputWrapper.cancel();
}
}
if (modeChanged || languageChanged) {
updateShortcutIME();
mService.onRefreshKeyboard();
}
- } else if (isVoiceMode() && mVoiceInput != null) {
+ } else if (isVoiceMode() && mVoiceInputWrapper != null) {
if (VOICE_MODE.equals(oldMode)) {
- mVoiceInput.reset();
+ mVoiceInputWrapper.reset();
}
// If needsToShowWarningDialog is true, voice input need to show warning before
// show recognition view.
if (languageChanged || modeChanged
- || VoiceIMEConnector.getInstance().needsToShowWarningDialog()) {
+ || VoiceProxy.getInstance().needsToShowWarningDialog()) {
triggerVoiceIME();
}
} else {
Log.w(TAG, "Unknown subtype mode: " + newMode);
- if (VOICE_MODE.equals(oldMode) && mVoiceInput != null) {
+ if (VOICE_MODE.equals(oldMode) && mVoiceInputWrapper != null) {
// We need to reset the voice input to release the resources and to reset its status
// as it is not the current input mode.
- mVoiceInput.reset();
+ mVoiceInputWrapper.reset();
}
}
+ mLanguageBarInfo.update();
}
// Update the current input locale from Locale string.
@@ -303,25 +303,47 @@ public class SubtypeSwitcher {
////////////////////////////
public void switchToShortcutIME() {
- final IBinder token = mService.getWindow().getWindow().getAttributes().token;
- if (token == null || mShortcutInputMethodInfo == null) {
+ if (mShortcutInputMethodInfo == null) {
return;
}
+
final String imiId = mShortcutInputMethodInfo.getId();
- final InputMethodSubtype subtype = mShortcutSubtype;
- new Thread("SwitchToShortcutIME") {
+ final InputMethodSubtypeCompatWrapper subtype = mShortcutSubtype;
+ switchToTargetIME(imiId, subtype);
+ }
+
+ private void switchToTargetIME(
+ final String imiId, final InputMethodSubtypeCompatWrapper subtype) {
+ final IBinder token = mService.getWindow().getWindow().getAttributes().token;
+ if (token == null) {
+ return;
+ }
+ new AsyncTask<Void, Void, Void>() {
@Override
- public void run() {
+ protected Void doInBackground(Void... params) {
mImm.setInputMethodAndSubtype(token, imiId, subtype);
+ return null;
+ }
+
+ @Override
+ protected void onPostExecute(Void result) {
+ // Calls in this method need to be done in the same thread as the thread which
+ // called switchToShortcutIME().
+
+ // Notify an event that the current subtype was changed. This event will be
+ // handled if "onCurrentInputMethodSubtypeChanged" can't be implemented
+ // when the API level is 10 or previous.
+ mService.notifyOnCurrentInputMethodSubtypeChanged(subtype);
}
- }.start();
+ }.execute();
}
public Drawable getShortcutIcon() {
return getSubtypeIcon(mShortcutInputMethodInfo, mShortcutSubtype);
}
- private Drawable getSubtypeIcon(InputMethodInfo imi, InputMethodSubtype subtype) {
+ private Drawable getSubtypeIcon(
+ InputMethodInfoCompatWrapper imi, InputMethodSubtypeCompatWrapper subtype) {
final PackageManager pm = mService.getPackageManager();
if (imi != null) {
final String imiPackageName = imi.getPackageName();
@@ -361,8 +383,9 @@ public class SubtypeSwitcher {
if (mShortcutSubtype == null)
return true;
final boolean allowsImplicitlySelectedSubtypes = true;
- for (final InputMethodSubtype enabledSubtype : mImm.getEnabledInputMethodSubtypeList(
- mShortcutInputMethodInfo, allowsImplicitlySelectedSubtypes)) {
+ for (final InputMethodSubtypeCompatWrapper enabledSubtype :
+ mImm.getEnabledInputMethodSubtypeList(
+ mShortcutInputMethodInfo, allowsImplicitlySelectedSubtypes)) {
if (enabledSubtype.equals(mShortcutSubtype))
return true;
}
@@ -398,11 +421,7 @@ public class SubtypeSwitcher {
//////////////////////////////////
public int getEnabledKeyboardLocaleCount() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return mLanguageSwitcher.getLocaleCount();
- } else {
- return mEnabledKeyboardSubtypesOfCurrentInputMethod.size();
- }
+ return mEnabledKeyboardSubtypesOfCurrentInputMethod.size();
}
public boolean useSpacebarLanguageSwitcher() {
@@ -414,74 +433,37 @@ public class SubtypeSwitcher {
}
public Locale getInputLocale() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return mLanguageSwitcher.getInputLocale();
- } else {
- return mInputLocale;
- }
+ return mInputLocale;
}
public String getInputLocaleStr() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- String inputLanguage = null;
- inputLanguage = mLanguageSwitcher.getInputLanguage();
- // Should return system locale if there is no Language available.
- if (inputLanguage == null) {
- inputLanguage = getSystemLocale().getLanguage();
- }
- return inputLanguage;
- } else {
- return mInputLocaleStr;
- }
+ return mInputLocaleStr;
}
public String[] getEnabledLanguages() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return mLanguageSwitcher.getEnabledLanguages();
- } else {
- int enabledLanguageCount = mEnabledLanguagesOfCurrentInputMethod.size();
- // Workaround for explicitly specifying the voice language
- if (enabledLanguageCount == 1) {
- mEnabledLanguagesOfCurrentInputMethod.add(
- mEnabledLanguagesOfCurrentInputMethod.get(0));
- ++enabledLanguageCount;
- }
- return mEnabledLanguagesOfCurrentInputMethod.toArray(
- new String[enabledLanguageCount]);
+ int enabledLanguageCount = mEnabledLanguagesOfCurrentInputMethod.size();
+ // Workaround for explicitly specifying the voice language
+ if (enabledLanguageCount == 1) {
+ mEnabledLanguagesOfCurrentInputMethod.add(mEnabledLanguagesOfCurrentInputMethod
+ .get(0));
+ ++enabledLanguageCount;
}
+ return mEnabledLanguagesOfCurrentInputMethod.toArray(new String[enabledLanguageCount]);
}
public Locale getSystemLocale() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return mLanguageSwitcher.getSystemLocale();
- } else {
- return mSystemLocale;
- }
+ return mSystemLocale;
}
public boolean isSystemLanguageSameAsInputLanguage() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return getSystemLocale().getLanguage().equalsIgnoreCase(
- getInputLocaleStr().substring(0, 2));
- } else {
- return mIsSystemLanguageSameAsInputLanguage;
- }
+ return mIsSystemLanguageSameAsInputLanguage;
}
public void onConfigurationChanged(Configuration conf) {
final Locale systemLocale = conf.locale;
// If system configuration was changed, update all parameters.
if (!TextUtils.equals(systemLocale.toString(), mSystemLocale.toString())) {
- if (mConfigUseSpacebarLanguageSwitcher) {
- // If the system locale changes and is different from the saved
- // locale (mSystemLocale), then reload the input locale list from the
- // latin ime settings (shared prefs) and reset the input locale
- // to the first one.
- mLanguageSwitcher.loadLocales(mPrefs);
- mLanguageSwitcher.setSystemLocale(systemLocale);
- } else {
- updateAllParameters();
- }
+ updateAllParameters();
}
}
@@ -507,9 +489,9 @@ public class SubtypeSwitcher {
// Voice Input functions //
///////////////////////////
- public boolean setVoiceInput(VoiceInput vi) {
- if (mVoiceInput == null && vi != null) {
- mVoiceInput = vi;
+ public boolean setVoiceInputWrapper(VoiceProxy.VoiceInputWrapper vi) {
+ if (mVoiceInputWrapper == null && vi != null) {
+ mVoiceInputWrapper = vi;
if (isVoiceMode()) {
if (DBG) {
Log.d(TAG, "Set and call voice input.: " + getInputLocaleStr());
@@ -525,9 +507,14 @@ public class SubtypeSwitcher {
return null == mCurrentSubtype ? false : VOICE_MODE.equals(getCurrentSubtypeMode());
}
+ public boolean isDummyVoiceMode() {
+ return mCurrentSubtype != null && mCurrentSubtype.getOriginalObject() == null
+ && VOICE_MODE.equals(getCurrentSubtypeMode());
+ }
+
private void triggerVoiceIME() {
if (!mService.isInputViewShown()) return;
- VoiceIMEConnector.getInstance().startListening(false,
+ VoiceProxy.getInstance().startListening(false,
KeyboardSwitcher.getInstance().getInputView().getWindowToken());
}
@@ -535,7 +522,70 @@ public class SubtypeSwitcher {
// Spacebar Language Switch support //
//////////////////////////////////////
- private LanguageSwitcher mLanguageSwitcher;
+ private class LanguageBarInfo {
+ private int mCurrentKeyboardSubtypeIndex;
+ private InputMethodSubtypeCompatWrapper mNextKeyboardSubtype;
+ private InputMethodSubtypeCompatWrapper mPreviousKeyboardSubtype;
+ private String mNextLanguage;
+ private String mPreviousLanguage;
+ public LanguageBarInfo() {
+ update();
+ }
+
+ private String getNextLanguage() {
+ return mNextLanguage;
+ }
+
+ private String getPreviousLanguage() {
+ return mPreviousLanguage;
+ }
+
+ public InputMethodSubtypeCompatWrapper getNextKeyboardSubtype() {
+ return mNextKeyboardSubtype;
+ }
+
+ public InputMethodSubtypeCompatWrapper getPreviousKeyboardSubtype() {
+ return mPreviousKeyboardSubtype;
+ }
+
+ public void update() {
+ if (!mConfigUseSpacebarLanguageSwitcher
+ || mEnabledKeyboardSubtypesOfCurrentInputMethod == null
+ || mEnabledKeyboardSubtypesOfCurrentInputMethod.size() == 0) return;
+ mCurrentKeyboardSubtypeIndex = getCurrentIndex();
+ mNextKeyboardSubtype = getNextKeyboardSubtypeInternal(mCurrentKeyboardSubtypeIndex);
+ Locale locale = new Locale(mNextKeyboardSubtype.getLocale());
+ mNextLanguage = getDisplayLanguage(locale);
+ mPreviousKeyboardSubtype = getPreviousKeyboardSubtypeInternal(
+ mCurrentKeyboardSubtypeIndex);
+ locale = new Locale(mPreviousKeyboardSubtype.getLocale());
+ mPreviousLanguage = getDisplayLanguage(locale);
+ }
+
+ private int normalize(int index) {
+ final int N = mEnabledKeyboardSubtypesOfCurrentInputMethod.size();
+ final int ret = index % N;
+ return ret < 0 ? ret + N : ret;
+ }
+
+ private int getCurrentIndex() {
+ final int N = mEnabledKeyboardSubtypesOfCurrentInputMethod.size();
+ for (int i = 0; i < N; ++i) {
+ if (mEnabledKeyboardSubtypesOfCurrentInputMethod.get(i).equals(mCurrentSubtype)) {
+ return i;
+ }
+ }
+ return 0;
+ }
+
+ private InputMethodSubtypeCompatWrapper getNextKeyboardSubtypeInternal(int index) {
+ return mEnabledKeyboardSubtypesOfCurrentInputMethod.get(normalize(index + 1));
+ }
+
+ private InputMethodSubtypeCompatWrapper getPreviousKeyboardSubtypeInternal(int index) {
+ return mEnabledKeyboardSubtypesOfCurrentInputMethod.get(normalize(index - 1));
+ }
+ }
public static String getFullDisplayName(Locale locale, boolean returnsNameInThisLocale) {
if (returnsNameInThisLocale) {
@@ -560,32 +610,16 @@ public class SubtypeSwitcher {
return Character.toUpperCase(s.charAt(0)) + s.substring(1);
}
- private void updateForSpacebarLanguageSwitch() {
- // We need to update mNeedsToDisplayLanguage in onStartInputView because
- // getEnabledKeyboardLocaleCount could have been changed.
- mNeedsToDisplayLanguage = !(getEnabledKeyboardLocaleCount() <= 1
- && getSystemLocale().getLanguage().equalsIgnoreCase(
- getInputLocale().getLanguage()));
- }
-
public String getInputLanguageName() {
return getDisplayLanguage(getInputLocale());
}
public String getNextInputLanguageName() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return getDisplayLanguage(mLanguageSwitcher.getNextInputLocale());
- } else {
- return "";
- }
+ return mLanguageBarInfo.getNextLanguage();
}
public String getPreviousInputLanguageName() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- return getDisplayLanguage(mLanguageSwitcher.getPrevInputLocale());
- } else {
- return "";
- }
+ return mLanguageBarInfo.getPreviousLanguage();
}
/////////////////////////////
@@ -612,60 +646,36 @@ public class SubtypeSwitcher {
}
- // A list of locales which are supported by default for voice input, unless we get a
- // different list from Gservices.
- private static final String DEFAULT_VOICE_INPUT_SUPPORTED_LOCALES =
- "en " +
- "en_US " +
- "en_GB " +
- "en_AU " +
- "en_CA " +
- "en_IE " +
- "en_IN " +
- "en_NZ " +
- "en_SG " +
- "en_ZA ";
-
public boolean isVoiceSupported(String locale) {
// Get the current list of supported locales and check the current locale against that
// list. We cache this value so as not to check it every time the user starts a voice
// input. Because this method is called by onStartInputView, this should mean that as
// long as the locale doesn't change while the user is keeping the IME open, the
// value should never be stale.
- String supportedLocalesString = SettingsUtil.getSettingsString(
- mService.getContentResolver(),
- SettingsUtil.LATIN_IME_VOICE_INPUT_SUPPORTED_LOCALES,
- DEFAULT_VOICE_INPUT_SUPPORTED_LOCALES);
+ String supportedLocalesString = VoiceProxy.getSupportedLocalesString(
+ mService.getContentResolver());
List<String> voiceInputSupportedLocales = Arrays.asList(
supportedLocalesString.split("\\s+"));
return voiceInputSupportedLocales.contains(locale);
}
- public void loadSettings() {
- if (mConfigUseSpacebarLanguageSwitcher) {
- mLanguageSwitcher.loadLocales(mPrefs);
- }
+ private void changeToNextSubtype() {
+ final InputMethodSubtypeCompatWrapper subtype =
+ mLanguageBarInfo.getNextKeyboardSubtype();
+ switchToTargetIME(mInputMethodId, subtype);
}
- public void toggleLanguage(boolean reset, boolean next) {
- if (mConfigUseSpacebarLanguageSwitcher) {
- if (reset) {
- mLanguageSwitcher.reset();
- } else {
- if (next) {
- mLanguageSwitcher.next();
- } else {
- mLanguageSwitcher.prev();
- }
- }
- mLanguageSwitcher.persist(mPrefs);
- }
+ private void changeToPreviousSubtype() {
+ final InputMethodSubtypeCompatWrapper subtype =
+ mLanguageBarInfo.getPreviousKeyboardSubtype();
+ switchToTargetIME(mInputMethodId, subtype);
}
- private void initLanguageSwitcher(LatinIME service) {
- final Configuration conf = service.getResources().getConfiguration();
- mLanguageSwitcher = new LanguageSwitcher(service);
- mLanguageSwitcher.loadLocales(mPrefs);
- mLanguageSwitcher.setSystemLocale(conf.locale);
+ public void toggleLanguage(boolean next) {
+ if (next) {
+ changeToNextSubtype();
+ } else {
+ changeToPreviousSubtype();
+ }
}
}
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 0de474e59..0cc9d4198 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -27,6 +27,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -47,7 +48,7 @@ public class Suggest implements Dictionary.WordCallback {
/**
* Words that appear in both bigram and unigram data gets multiplier ranging from
- * BIGRAM_MULTIPLIER_MIN to BIGRAM_MULTIPLIER_MAX depending on the frequency score from
+ * BIGRAM_MULTIPLIER_MIN to BIGRAM_MULTIPLIER_MAX depending on the score from
* bigram data.
*/
public static final double BIGRAM_MULTIPLIER_MIN = 1.2;
@@ -92,13 +93,13 @@ public class Suggest implements Dictionary.WordCallback {
private boolean mQuickFixesEnabled;
private double mAutoCorrectionThreshold;
- private int[] mPriorities = new int[mPrefMaxSuggestions];
- private int[] mBigramPriorities = new int[PREF_MAX_BIGRAMS];
+ private int[] mScores = new int[mPrefMaxSuggestions];
+ private int[] mBigramScores = new int[PREF_MAX_BIGRAMS];
private ArrayList<CharSequence> mSuggestions = new ArrayList<CharSequence>();
ArrayList<CharSequence> mBigramSuggestions = new ArrayList<CharSequence>();
private ArrayList<CharSequence> mStringPool = new ArrayList<CharSequence>();
- private String mLowerOriginalWord;
+ private CharSequence mTypedWord;
// TODO: Remove these member variables by passing more context to addWord() callback method
private boolean mIsFirstCharCapitalized;
@@ -106,12 +107,15 @@ public class Suggest implements Dictionary.WordCallback {
private int mCorrectionMode = CORRECTION_BASIC;
- public Suggest(Context context, int dictionaryResId) {
- init(context, BinaryDictionary.initDictionary(context, dictionaryResId, DIC_MAIN));
+ public Suggest(Context context, int dictionaryResId, Locale locale) {
+ init(context, BinaryDictionary.initDictionaryFromManager(context, DIC_MAIN, locale,
+ dictionaryResId));
}
- /* package for test */ Suggest(File dictionary, long startOffset, long length) {
- init(null, BinaryDictionary.initDictionary(dictionary, startOffset, length, DIC_MAIN));
+ /* package for test */ Suggest(File dictionary, long startOffset, long length,
+ BinaryDictionary.Flag[] flagArray) {
+ init(null, BinaryDictionary.initDictionary(dictionary, startOffset, length, DIC_MAIN,
+ flagArray));
}
private void init(Context context, BinaryDictionary mainDict) {
@@ -128,6 +132,19 @@ public class Suggest implements Dictionary.WordCallback {
initPool();
}
+ public void resetMainDict(Context context, int dictionaryResId, Locale locale) {
+ final BinaryDictionary newMainDict = BinaryDictionary.initDictionaryFromManager(context,
+ DIC_MAIN, locale, dictionaryResId);
+ mMainDict = newMainDict;
+ if (null == newMainDict) {
+ mUnigramDictionaries.remove(DICT_KEY_MAIN);
+ mBigramDictionaries.remove(DICT_KEY_MAIN);
+ } else {
+ mUnigramDictionaries.put(DICT_KEY_MAIN, newMainDict);
+ mBigramDictionaries.put(DICT_KEY_MAIN, newMainDict);
+ }
+ }
+
private void initPool() {
for (int i = 0; i < mPrefMaxSuggestions; i++) {
StringBuilder sb = new StringBuilder(getApproxMaxWordLength());
@@ -207,8 +224,8 @@ public class Suggest implements Dictionary.WordCallback {
throw new IllegalArgumentException("maxSuggestions must be between 1 and 100");
}
mPrefMaxSuggestions = maxSuggestions;
- mPriorities = new int[mPrefMaxSuggestions];
- mBigramPriorities = new int[PREF_MAX_BIGRAMS];
+ mScores = new int[mPrefMaxSuggestions];
+ mBigramScores = new int[PREF_MAX_BIGRAMS];
collectGarbage(mSuggestions, mPrefMaxSuggestions);
while (mStringPool.size() < mPrefMaxSuggestions) {
StringBuilder sb = new StringBuilder(getApproxMaxWordLength());
@@ -256,25 +273,23 @@ public class Suggest implements Dictionary.WordCallback {
mIsFirstCharCapitalized = wordComposer.isFirstCharCapitalized();
mIsAllUpperCase = wordComposer.isAllUpperCase();
collectGarbage(mSuggestions, mPrefMaxSuggestions);
- Arrays.fill(mPriorities, 0);
+ Arrays.fill(mScores, 0);
// Save a lowercase version of the original word
CharSequence typedWord = wordComposer.getTypedWord();
if (typedWord != null) {
final String typedWordString = typedWord.toString();
typedWord = typedWordString;
- mLowerOriginalWord = typedWordString.toLowerCase();
// Treating USER_TYPED as UNIGRAM suggestion for logging now.
LatinImeLogger.onAddSuggestedWord(typedWordString, Suggest.DIC_USER_TYPED,
Dictionary.DataType.UNIGRAM);
- } else {
- mLowerOriginalWord = "";
}
+ mTypedWord = typedWord;
if (wordComposer.size() == 1 && (mCorrectionMode == CORRECTION_FULL_BIGRAM
|| mCorrectionMode == CORRECTION_BASIC)) {
// At first character typed, search only the bigrams
- Arrays.fill(mBigramPriorities, 0);
+ Arrays.fill(mBigramScores, 0);
collectGarbage(mBigramSuggestions, PREF_MAX_BIGRAMS);
if (!TextUtils.isEmpty(prevWordForBigram)) {
@@ -346,7 +361,7 @@ public class Suggest implements Dictionary.WordCallback {
mWhiteListDictionary.getWhiteListedWord(typedWordString));
mAutoCorrection.updateAutoCorrectionStatus(mUnigramDictionaries, wordComposer,
- mSuggestions, mPriorities, typedWord, mAutoCorrectionThreshold, mCorrectionMode,
+ mSuggestions, mScores, typedWord, mAutoCorrectionThreshold, mCorrectionMode,
autoText, whitelistedWord);
if (autoText != null) {
@@ -364,26 +379,25 @@ public class Suggest implements Dictionary.WordCallback {
if (DBG) {
double normalizedScore = mAutoCorrection.getNormalizedScore();
- ArrayList<SuggestedWords.SuggestedWordInfo> frequencyInfoList =
+ ArrayList<SuggestedWords.SuggestedWordInfo> scoreInfoList =
new ArrayList<SuggestedWords.SuggestedWordInfo>();
- frequencyInfoList.add(new SuggestedWords.SuggestedWordInfo("+", false));
- final int priorityLength = mPriorities.length;
- for (int i = 0; i < priorityLength; ++i) {
+ scoreInfoList.add(new SuggestedWords.SuggestedWordInfo("+", false));
+ for (int i = 0; i < mScores.length; ++i) {
if (normalizedScore > 0) {
- final String priorityThreshold = Integer.toString(mPriorities[i]) + " (" +
- normalizedScore + ")";
- frequencyInfoList.add(
- new SuggestedWords.SuggestedWordInfo(priorityThreshold, false));
+ final String scoreThreshold = String.format("%d (%4.2f)", mScores[i],
+ normalizedScore);
+ scoreInfoList.add(
+ new SuggestedWords.SuggestedWordInfo(scoreThreshold, false));
normalizedScore = 0.0;
} else {
- final String priority = Integer.toString(mPriorities[i]);
- frequencyInfoList.add(new SuggestedWords.SuggestedWordInfo(priority, false));
+ final String score = Integer.toString(mScores[i]);
+ scoreInfoList.add(new SuggestedWords.SuggestedWordInfo(score, false));
}
}
- for (int i = priorityLength; i < mSuggestions.size(); ++i) {
- frequencyInfoList.add(new SuggestedWords.SuggestedWordInfo("--", false));
+ for (int i = mScores.length; i < mSuggestions.size(); ++i) {
+ scoreInfoList.add(new SuggestedWords.SuggestedWordInfo("--", false));
}
- return new SuggestedWords.Builder().addWords(mSuggestions, frequencyInfoList);
+ return new SuggestedWords.Builder().addWords(mSuggestions, scoreInfoList);
}
return new SuggestedWords.Builder().addWords(mSuggestions, null);
}
@@ -419,52 +433,37 @@ public class Suggest implements Dictionary.WordCallback {
return mAutoCorrection.hasAutoCorrection();
}
- private static boolean compareCaseInsensitive(final String lowerOriginalWord,
- final char[] word, final int offset, final int length) {
- final int originalLength = lowerOriginalWord.length();
- if (originalLength == length && Character.isUpperCase(word[offset])) {
- for (int i = 0; i < originalLength; i++) {
- if (lowerOriginalWord.charAt(i) != Character.toLowerCase(word[offset+i])) {
- return false;
- }
- }
- return true;
- }
- return false;
- }
-
@Override
- public boolean addWord(final char[] word, final int offset, final int length, int freq,
+ public boolean addWord(final char[] word, final int offset, final int length, int score,
final int dicTypeId, final Dictionary.DataType dataType) {
Dictionary.DataType dataTypeForLog = dataType;
- ArrayList<CharSequence> suggestions;
- int[] priorities;
- int prefMaxSuggestions;
+ final ArrayList<CharSequence> suggestions;
+ final int[] sortedScores;
+ final int prefMaxSuggestions;
if(dataType == Dictionary.DataType.BIGRAM) {
suggestions = mBigramSuggestions;
- priorities = mBigramPriorities;
+ sortedScores = mBigramScores;
prefMaxSuggestions = PREF_MAX_BIGRAMS;
} else {
suggestions = mSuggestions;
- priorities = mPriorities;
+ sortedScores = mScores;
prefMaxSuggestions = mPrefMaxSuggestions;
}
int pos = 0;
// Check if it's the same word, only caps are different
- if (compareCaseInsensitive(mLowerOriginalWord, word, offset, length)) {
+ if (Utils.equalsIgnoreCase(mTypedWord, word, offset, length)) {
// TODO: remove this surrounding if clause and move this logic to
// getSuggestedWordBuilder.
if (suggestions.size() > 0) {
- final String currentHighestWordLowerCase =
- suggestions.get(0).toString().toLowerCase();
+ final String currentHighestWord = suggestions.get(0).toString();
// If the current highest word is also equal to typed word, we need to compare
// frequency to determine the insertion position. This does not ensure strictly
// correct ordering, but ensures the top score is on top which is enough for
// removing duplicates correctly.
- if (compareCaseInsensitive(currentHighestWordLowerCase, word, offset, length)
- && freq <= priorities[0]) {
+ if (Utils.equalsIgnoreCase(currentHighestWord, word, offset, length)
+ && score <= sortedScores[0]) {
pos = 1;
}
}
@@ -475,24 +474,24 @@ public class Suggest implements Dictionary.WordCallback {
if(bigramSuggestion >= 0) {
dataTypeForLog = Dictionary.DataType.BIGRAM;
// turn freq from bigram into multiplier specified above
- double multiplier = (((double) mBigramPriorities[bigramSuggestion])
+ double multiplier = (((double) mBigramScores[bigramSuggestion])
/ MAXIMUM_BIGRAM_FREQUENCY)
* (BIGRAM_MULTIPLIER_MAX - BIGRAM_MULTIPLIER_MIN)
+ BIGRAM_MULTIPLIER_MIN;
/* Log.d(TAG,"bigram num: " + bigramSuggestion
+ " wordB: " + mBigramSuggestions.get(bigramSuggestion).toString()
- + " currentPriority: " + freq + " bigramPriority: "
- + mBigramPriorities[bigramSuggestion]
+ + " currentScore: " + score + " bigramScore: "
+ + mBigramScores[bigramSuggestion]
+ " multiplier: " + multiplier); */
- freq = (int)Math.round((freq * multiplier));
+ score = (int)Math.round((score * multiplier));
}
}
- // Check the last one's priority and bail
- if (priorities[prefMaxSuggestions - 1] >= freq) return true;
+ // Check the last one's score and bail
+ if (sortedScores[prefMaxSuggestions - 1] >= score) return true;
while (pos < prefMaxSuggestions) {
- if (priorities[pos] < freq
- || (priorities[pos] == freq && length < suggestions.get(pos).length())) {
+ if (sortedScores[pos] < score
+ || (sortedScores[pos] == score && length < suggestions.get(pos).length())) {
break;
}
pos++;
@@ -502,8 +501,8 @@ public class Suggest implements Dictionary.WordCallback {
return true;
}
- System.arraycopy(priorities, pos, priorities, pos + 1, prefMaxSuggestions - pos - 1);
- priorities[pos] = freq;
+ System.arraycopy(sortedScores, pos, sortedScores, pos + 1, prefMaxSuggestions - pos - 1);
+ sortedScores[pos] = score;
int poolSize = mStringPool.size();
StringBuilder sb = poolSize > 0 ? (StringBuilder) mStringPool.remove(poolSize - 1)
: new StringBuilder(getApproxMaxWordLength());
diff --git a/java/src/com/android/inputmethod/latin/TextEntryState.java b/java/src/com/android/inputmethod/latin/TextEntryState.java
index 63196430b..de13f3ae4 100644
--- a/java/src/com/android/inputmethod/latin/TextEntryState.java
+++ b/java/src/com/android/inputmethod/latin/TextEntryState.java
@@ -16,6 +16,8 @@
package com.android.inputmethod.latin;
+import com.android.inputmethod.latin.Utils.RingCharBuffer;
+
import android.util.Log;
public class TextEntryState {
@@ -43,10 +45,12 @@ public class TextEntryState {
sState = newState;
}
- public static void acceptedDefault(CharSequence typedWord, CharSequence actualWord) {
+ public static void acceptedDefault(CharSequence typedWord, CharSequence actualWord,
+ int separatorCode) {
if (typedWord == null) return;
setState(ACCEPTED_DEFAULT);
- LatinImeLogger.logOnAutoSuggestion(typedWord.toString(), actualWord.toString());
+ LatinImeLogger.logOnAutoCorrection(
+ typedWord.toString(), actualWord.toString(), separatorCode);
if (DEBUG)
displayState("acceptedDefault", "typedWord", typedWord, "actualWord", actualWord);
}
@@ -95,7 +99,7 @@ public class TextEntryState {
if (DEBUG) displayState("onAbortRecorrection");
}
- public static void typedCharacter(char c, boolean isSeparator) {
+ public static void typedCharacter(char c, boolean isSeparator, int x, int y) {
final boolean isSpace = (c == ' ');
switch (sState) {
case IN_WORD:
@@ -149,13 +153,19 @@ public class TextEntryState {
setState(START);
break;
}
+ RingCharBuffer.getInstance().push(c, x, y);
+ if (isSeparator) {
+ LatinImeLogger.logOnInputSeparator();
+ } else {
+ LatinImeLogger.logOnInputChar();
+ }
if (DEBUG) displayState("typedCharacter", "char", c, "isSeparator", isSeparator);
}
public static void backspace() {
if (sState == ACCEPTED_DEFAULT) {
setState(UNDO_COMMIT);
- LatinImeLogger.logOnAutoSuggestionCanceled();
+ LatinImeLogger.logOnAutoCorrectionCancelled();
} else if (sState == UNDO_COMMIT) {
setState(IN_WORD);
}
diff --git a/java/src/com/android/inputmethod/latin/UserBigramDictionary.java b/java/src/com/android/inputmethod/latin/UserBigramDictionary.java
index 4750fb991..bb6642cd9 100644
--- a/java/src/com/android/inputmethod/latin/UserBigramDictionary.java
+++ b/java/src/com/android/inputmethod/latin/UserBigramDictionary.java
@@ -44,12 +44,6 @@ public class UserBigramDictionary extends ExpandableDictionary {
/** Maximum frequency for all pairs */
private static final int FREQUENCY_MAX = 127;
- /**
- * If this pair is typed 6 times, it would be suggested.
- * Should be smaller than ContactsDictionary.FREQUENCY_FOR_CONTACTS_BIGRAM
- */
- protected static final int SUGGEST_THRESHOLD = 6 * FREQUENCY_FOR_TYPED;
-
/** Maximum number of pairs. Pruning will start when databases goes above this number. */
private static int sMaxUserBigrams = 10000;
diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/Utils.java
index 727e3f16d..7b334ac0a 100644
--- a/java/src/com/android/inputmethod/latin/Utils.java
+++ b/java/src/com/android/inputmethod/latin/Utils.java
@@ -16,8 +16,12 @@
package com.android.inputmethod.latin;
+import com.android.inputmethod.compat.InputMethodInfoCompatWrapper;
+import com.android.inputmethod.compat.InputMethodManagerCompatWrapper;
+import com.android.inputmethod.compat.InputTypeCompatUtils;
import com.android.inputmethod.keyboard.KeyboardId;
+import android.content.Context;
import android.content.res.Resources;
import android.inputmethodservice.InputMethodService;
import android.os.AsyncTask;
@@ -28,8 +32,6 @@ import android.text.InputType;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputMethodInfo;
-import android.view.inputmethod.InputMethodManager;
import java.io.BufferedReader;
import java.io.File;
@@ -101,17 +103,22 @@ public class Utils {
}
}
- public static boolean hasMultipleEnabledIMEsOrSubtypes(InputMethodManager imm) {
+ public static boolean hasMultipleEnabledIMEsOrSubtypes(InputMethodManagerCompatWrapper imm) {
return imm.getEnabledInputMethodList().size() > 1
// imm.getEnabledInputMethodSubtypeList(null, false) will return the current IME's enabled
// input method subtype (The current IME should be LatinIME.)
|| imm.getEnabledInputMethodSubtypeList(null, false).size() > 1;
}
- public static String getInputMethodId(InputMethodManager imm, String packageName) {
- for (final InputMethodInfo imi : imm.getEnabledInputMethodList()) {
+ public static String getInputMethodId(InputMethodManagerCompatWrapper imm, String packageName) {
+ return getInputMethodInfo(imm, packageName).getId();
+ }
+
+ public static InputMethodInfoCompatWrapper getInputMethodInfo(
+ InputMethodManagerCompatWrapper imm, String packageName) {
+ for (final InputMethodInfoCompatWrapper imi : imm.getEnabledInputMethodList()) {
if (imi.getPackageName().equals(packageName))
- return imi.getId();
+ return imi;
}
throw new RuntimeException("Can not find input method id for " + packageName);
}
@@ -202,11 +209,11 @@ public class Utils {
return mCharBuf[mEnd];
}
}
- public char getLastChar() {
- if (mLength < 1) {
+ public char getBackwardNthChar(int n) {
+ if (mLength <= n || n < 0) {
return PLACEHOLDER_DELIMITER_CHAR;
} else {
- return mCharBuf[normalize(mEnd - 1)];
+ return mCharBuf[normalize(mEnd - n - 1)];
}
}
public int getPreviousX(char c, int back) {
@@ -227,9 +234,16 @@ public class Utils {
return mYBuf[index];
}
}
- public String getLastString() {
+ public String getLastWord(int ignoreCharCount) {
StringBuilder sb = new StringBuilder();
- for (int i = 0; i < mLength; ++i) {
+ int i = ignoreCharCount;
+ for (; i < mLength; ++i) {
+ char c = mCharBuf[normalize(mEnd - 1 - i)];
+ if (!((LatinIME)mContext).isWordSeparator(c)) {
+ break;
+ }
+ }
+ for (; i < mLength; ++i) {
char c = mCharBuf[normalize(mEnd - 1 - i)];
if (!((LatinIME)mContext).isWordSeparator(c)) {
sb.append(c);
@@ -285,7 +299,7 @@ public class Utils {
// In dictionary.cpp, getSuggestion() method,
// suggestion scores are computed using the below formula.
- // original score (called 'frequency')
+ // original score
// := pow(mTypedLetterMultiplier (this is defined 2),
// (the number of matched characters between typed word and suggested word))
// * (individual word's score which defined in the unigram dictionary,
@@ -295,7 +309,7 @@ public class Utils {
// (full match up to min(before.length(), after.length())
// => Then multiply by FULL_MATCHED_WORDS_PROMOTION_RATE (this is defined 1.2)
// - If the word is a true full match except for differences in accents or
- // capitalization, then treat it as if the frequency was 255.
+ // capitalization, then treat it as if the score was 255.
// - If before.length() == after.length()
// => multiply by mFullWordMultiplier (this is defined 2))
// So, maximum original score is pow(2, min(before.length(), after.length())) * 255 * 2 * 1.2
@@ -485,7 +499,7 @@ public class Utils {
case InputType.TYPE_CLASS_PHONE:
return KeyboardId.MODE_PHONE;
case InputType.TYPE_CLASS_TEXT:
- if (Utils.isEmailVariation(variation)) {
+ if (InputTypeCompatUtils.isEmailVariation(variation)) {
return KeyboardId.MODE_EMAIL;
} else if (variation == InputType.TYPE_TEXT_VARIATION_URI) {
return KeyboardId.MODE_URL;
@@ -503,31 +517,6 @@ public class Utils {
}
}
- public static boolean isEmailVariation(int variation) {
- return variation == InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS
- || variation == InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
- }
-
- // Please refer to TextView.isPasswordInputType
- public static boolean isPasswordInputType(int inputType) {
- final int variation =
- inputType & (InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION);
- return (variation
- == (InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD))
- || (variation
- == (InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD))
- || (variation
- == (InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD));
- }
-
- // Please refer to TextView.isVisiblePasswordInputType
- public static boolean isVisiblePasswordInputType(int inputType) {
- final int variation =
- inputType & (InputType.TYPE_MASK_CLASS | InputType.TYPE_MASK_VARIATION);
- return variation
- == (InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
- }
-
public static boolean containsInCsv(String key, String csv) {
if (csv == null)
return false;
@@ -551,7 +540,9 @@ public class Utils {
* @return main dictionary resource id
*/
public static int getMainDictionaryResourceId(Resources res) {
- return res.getIdentifier("main", "raw", LatinIME.class.getPackage().getName());
+ final String MAIN_DIC_NAME = "main";
+ String packageName = LatinIME.class.getPackage().getName();
+ return res.getIdentifier(MAIN_DIC_NAME, "raw", packageName);
}
public static void loadNativeLibrary() {
@@ -561,4 +552,76 @@ public class Utils {
Log.e(TAG, "Could not load native library jni_latinime");
}
}
+
+ /**
+ * Returns true if a and b are equal ignoring the case of the character.
+ * @param a first character to check
+ * @param b second character to check
+ * @return {@code true} if a and b are equal, {@code false} otherwise.
+ */
+ public static boolean equalsIgnoreCase(char a, char b) {
+ // Some language, such as Turkish, need testing both cases.
+ return a == b
+ || Character.toLowerCase(a) == Character.toLowerCase(b)
+ || Character.toUpperCase(a) == Character.toUpperCase(b);
+ }
+
+ /**
+ * Returns true if a and b are equal ignoring the case of the characters, including if they are
+ * both null.
+ * @param a first CharSequence to check
+ * @param b second CharSequence to check
+ * @return {@code true} if a and b are equal, {@code false} otherwise.
+ */
+ public static boolean equalsIgnoreCase(CharSequence a, CharSequence b) {
+ if (a == b)
+ return true; // including both a and b are null.
+ if (a == null || b == null)
+ return false;
+ final int length = a.length();
+ if (length != b.length())
+ return false;
+ for (int i = 0; i < length; i++) {
+ if (!equalsIgnoreCase(a.charAt(i), b.charAt(i)))
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Returns true if a and b are equal ignoring the case of the characters, including if a is null
+ * and b is zero length.
+ * @param a CharSequence to check
+ * @param b character array to check
+ * @param offset start offset of array b
+ * @param length length of characters in array b
+ * @return {@code true} if a and b are equal, {@code false} otherwise.
+ * @throws IndexOutOfBoundsException
+ * if {@code offset < 0 || length < 0 || offset + length > data.length}.
+ * @throws NullPointerException if {@code b == null}.
+ */
+ public static boolean equalsIgnoreCase(CharSequence a, char[] b, int offset, int length) {
+ if (offset < 0 || length < 0 || length > b.length - offset)
+ throw new IndexOutOfBoundsException("array.length=" + b.length + " offset=" + offset
+ + " length=" + length);
+ if (a == null)
+ return length == 0; // including a is null and b is zero length.
+ if (a.length() != length)
+ return false;
+ for (int i = 0; i < length; i++) {
+ if (!equalsIgnoreCase(a.charAt(i), b[offset + i]))
+ return false;
+ }
+ return true;
+ }
+
+ public static float getDipScale(Context context) {
+ final float scale = context.getResources().getDisplayMetrics().density;
+ return scale;
+ }
+
+ /** Convert pixel to DIP */
+ public static int dipToPixel(float scale, int dip) {
+ return (int) ((float) dip * scale + 0.5);
+ }
}