diff options
author | 2011-02-10 17:31:37 +0900 | |
---|---|---|
committer | 2011-02-10 17:31:37 +0900 | |
commit | a7ea6cad8269c2b621dbf585ed90121b495f6ebc (patch) | |
tree | efe9106dacb45cf2cf4f17d80f870a030436ca53 | |
parent | b7b83125544964bf128e07456edfd0170d889dc4 (diff) | |
parent | 03b5579b3b7380f8e12519cca1662317282c6bd9 (diff) | |
download | latinime-a7ea6cad8269c2b621dbf585ed90121b495f6ebc.tar.gz latinime-a7ea6cad8269c2b621dbf585ed90121b495f6ebc.tar.xz latinime-a7ea6cad8269c2b621dbf585ed90121b495f6ebc.zip |
Merge remote branch 'goog/master' into merge
Conflicts:
java/res/xml/method.xml
java/src/com/android/inputmethod/latin/LatinIME.java
java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
java/src/com/android/inputmethod/voice/VoiceIMEConnector.java
Change-Id: I9b62da120dcc08327fde92459ee5c7564a5eb6b8
379 files changed, 2083 insertions, 1172 deletions
diff --git a/java/AndroidManifest.xml b/java/AndroidManifest.xml index da91d6451..cc4c74441 100644 --- a/java/AndroidManifest.xml +++ b/java/AndroidManifest.xml @@ -4,6 +4,7 @@ <original-package android:name="com.android.inputmethod.latin" /> <uses-permission android:name="android.permission.VIBRATE"/> + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.READ_USER_DICTIONARY" /> <uses-permission android:name="android.permission.WRITE_USER_DICTIONARY" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> diff --git a/java/res/drawable-hdpi/btn_candidate_normal.9.png b/java/res/drawable-hdpi/btn_candidate_normal.9.png Binary files differindex 0ccdb6ab2..7cab5a899 100644 --- a/java/res/drawable-hdpi/btn_candidate_normal.9.png +++ b/java/res/drawable-hdpi/btn_candidate_normal.9.png diff --git a/java/res/drawable-hdpi/btn_candidate_pressed.9.png b/java/res/drawable-hdpi/btn_candidate_pressed.9.png Binary files differindex ba79cf7f8..7acceaee7 100644 --- a/java/res/drawable-hdpi/btn_candidate_pressed.9.png +++ b/java/res/drawable-hdpi/btn_candidate_pressed.9.png 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 Binary files differindex 01fc8ca78..50cc49fdb 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 diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_holo.9.png Binary files differindex d13386a0c..a8c1688f7 100644 --- a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_holo.9.png +++ b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_holo.9.png 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 Binary files differindex af4017e2c..dabf77ec6 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 diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_off_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_off_holo.9.png Binary files differindex 95b73c07e..829647663 100644 --- a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_off_holo.9.png +++ b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_off_holo.9.png 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 Binary files differindex 4c35aca95..6e7d74c88 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 diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on_holo.9.png Binary files differindex 3bd224911..020a65d6e 100644 --- a/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on_holo.9.png +++ b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on_holo.9.png 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 Binary files differindex 174f3452c..ddb77c224 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 diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_holo.9.png Binary files differindex 77a0e7d75..88b27c07b 100644 --- a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_holo.9.png +++ b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_holo.9.png 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 Binary files differindex 1fcbd9a88..1e9227e1c 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 diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off_holo.9.png Binary files differindex 1760075a8..87497bc1f 100644 --- a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off_holo.9.png +++ b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off_holo.9.png 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 Binary files differindex 072753f37..7207b2ece 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 diff --git a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on_holo.9.png Binary files differindex b6d0dbca7..f0d76dfa2 100644 --- a/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on_holo.9.png +++ b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on_holo.9.png 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 Binary files differindex b6c234c04..a524168c9 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 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 Binary files differindex 73a8cd1c3..4395e978a 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 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 Binary files differindex 1ad746053..9d85c7b74 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 diff --git a/java/res/drawable-hdpi/btn_keyboard_key_light_normal_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_light_normal_holo.9.png Binary files differindex 763c538d3..3115fa436 100644 --- a/java/res/drawable-hdpi/btn_keyboard_key_light_normal_holo.9.png +++ b/java/res/drawable-hdpi/btn_keyboard_key_light_normal_holo.9.png 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 Binary files differindex e3a77d61b..2ed1b3447 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 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 Binary files differindex 431c44967..77e17dbae 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 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 Binary files differindex ccd59d5fa..a409639e7 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 diff --git a/java/res/drawable-hdpi/btn_keyboard_key_light_pressed_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_light_pressed_holo.9.png Binary files differindex 328fe160a..dc08102a7 100644 --- a/java/res/drawable-hdpi/btn_keyboard_key_light_pressed_holo.9.png +++ b/java/res/drawable-hdpi/btn_keyboard_key_light_pressed_holo.9.png diff --git a/java/res/drawable-hdpi/btn_keyboard_key_normal.9.png b/java/res/drawable-hdpi/btn_keyboard_key_normal.9.png Binary files differindex 42c7c146d..6ec7e6592 100644 --- a/java/res/drawable-hdpi/btn_keyboard_key_normal.9.png +++ b/java/res/drawable-hdpi/btn_keyboard_key_normal.9.png 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 Binary files differindex 01e2506b0..995780cbf 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 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 Binary files differindex fad0ec458..1388b6694 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 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 Binary files differindex 83c6eb3fc..7215782eb 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 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 Binary files differindex 215f8157c..5a94cb6ac 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 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 Binary files differindex 88acdd748..c6373a8af 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 diff --git a/java/res/drawable-hdpi/btn_keyboard_key_popup_selected_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_popup_selected_holo.9.png Binary files differindex e0129ab10..5ecdaf428 100644 --- a/java/res/drawable-hdpi/btn_keyboard_key_popup_selected_holo.9.png +++ b/java/res/drawable-hdpi/btn_keyboard_key_popup_selected_holo.9.png diff --git a/java/res/drawable-hdpi/btn_keyboard_key_pressed.9.png b/java/res/drawable-hdpi/btn_keyboard_key_pressed.9.png Binary files differindex e047eaff1..0bd49a0e7 100644 --- a/java/res/drawable-hdpi/btn_keyboard_key_pressed.9.png +++ b/java/res/drawable-hdpi/btn_keyboard_key_pressed.9.png 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 Binary files differindex 218a2d29e..634419f1b 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 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 Binary files differindex afe49512e..8474f9f42 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 diff --git a/java/res/drawable-hdpi/cancel.png b/java/res/drawable-hdpi/cancel.png Binary files differindex 506cf99d0..fdf01dba6 100644 --- a/java/res/drawable-hdpi/cancel.png +++ b/java/res/drawable-hdpi/cancel.png diff --git a/java/res/drawable-hdpi/cancel_holo.9.png b/java/res/drawable-hdpi/cancel_holo.9.png Binary files differnew file mode 100644 index 000000000..33548d606 --- /dev/null +++ b/java/res/drawable-hdpi/cancel_holo.9.png diff --git a/java/res/drawable-hdpi/candidate_feedback_background.9.png b/java/res/drawable-hdpi/candidate_feedback_background.9.png Binary files differindex 203c4e640..16499002e 100644 --- a/java/res/drawable-hdpi/candidate_feedback_background.9.png +++ b/java/res/drawable-hdpi/candidate_feedback_background.9.png diff --git a/java/res/drawable-hdpi/caution.png b/java/res/drawable-hdpi/caution.png Binary files differindex 5cb6c54b9..caed9419d 100644 --- a/java/res/drawable-hdpi/caution.png +++ b/java/res/drawable-hdpi/caution.png diff --git a/java/res/drawable-hdpi/dialog_bubble_step02.9.png b/java/res/drawable-hdpi/dialog_bubble_step02.9.png Binary files differindex b338364c5..2a3ac18c0 100644 --- a/java/res/drawable-hdpi/dialog_bubble_step02.9.png +++ b/java/res/drawable-hdpi/dialog_bubble_step02.9.png diff --git a/java/res/drawable-hdpi/dialog_bubble_step07.9.png b/java/res/drawable-hdpi/dialog_bubble_step07.9.png Binary files differindex 94b915432..0a5046b07 100644 --- a/java/res/drawable-hdpi/dialog_bubble_step07.9.png +++ b/java/res/drawable-hdpi/dialog_bubble_step07.9.png diff --git a/java/res/drawable-hdpi/highlight_pressed.png b/java/res/drawable-hdpi/highlight_pressed.png Binary files differindex ae04901a0..638df19bc 100644 --- a/java/res/drawable-hdpi/highlight_pressed.png +++ b/java/res/drawable-hdpi/highlight_pressed.png diff --git a/java/res/drawable-hdpi/hint_popup.9.png b/java/res/drawable-hdpi/hint_popup.9.png Binary files differindex b5ec003e6..5b2ad5388 100644 --- a/java/res/drawable-hdpi/hint_popup.9.png +++ b/java/res/drawable-hdpi/hint_popup.9.png diff --git a/java/res/drawable-hdpi/hint_popup_holo.9.png b/java/res/drawable-hdpi/hint_popup_holo.9.png Binary files differnew file mode 100644 index 000000000..2ffc6ea2b --- /dev/null +++ b/java/res/drawable-hdpi/hint_popup_holo.9.png diff --git a/java/res/drawable-hdpi/ic_dialog_keyboard.png b/java/res/drawable-hdpi/ic_dialog_keyboard.png Binary files differindex c7729566c..fb6d89879 100644 --- a/java/res/drawable-hdpi/ic_dialog_keyboard.png +++ b/java/res/drawable-hdpi/ic_dialog_keyboard.png diff --git a/java/res/drawable-hdpi/ic_mic_dialog.png b/java/res/drawable-hdpi/ic_mic_dialog.png Binary files differindex 349dc4b37..6498cd589 100644 --- a/java/res/drawable-hdpi/ic_mic_dialog.png +++ b/java/res/drawable-hdpi/ic_mic_dialog.png diff --git a/java/res/drawable-hdpi/ic_subtype_keyboard.png b/java/res/drawable-hdpi/ic_subtype_keyboard.png Binary files differnew file mode 100644 index 000000000..b5a9fa866 --- /dev/null +++ b/java/res/drawable-hdpi/ic_subtype_keyboard.png diff --git a/java/res/drawable-hdpi/ic_subtype_mic.png b/java/res/drawable-hdpi/ic_subtype_mic.png Binary files differnew file mode 100644 index 000000000..5d68e85a6 --- /dev/null +++ b/java/res/drawable-hdpi/ic_subtype_mic.png diff --git a/java/res/drawable-hdpi/ic_suggest_strip_microphone.png b/java/res/drawable-hdpi/ic_suggest_strip_microphone.png Binary files differindex c00b4aaa6..0462bdd16 100644 --- a/java/res/drawable-hdpi/ic_suggest_strip_microphone.png +++ b/java/res/drawable-hdpi/ic_suggest_strip_microphone.png diff --git a/java/res/drawable-hdpi/ic_suggest_strip_microphone_swipe.png b/java/res/drawable-hdpi/ic_suggest_strip_microphone_swipe.png Binary files differindex 256dc3d61..80c20f691 100644 --- a/java/res/drawable-hdpi/ic_suggest_strip_microphone_swipe.png +++ b/java/res/drawable-hdpi/ic_suggest_strip_microphone_swipe.png diff --git a/java/res/drawable-hdpi/key_hint_at_holo.9.png b/java/res/drawable-hdpi/key_hint_at_holo.9.png Binary files differindex ebde12dd9..129e19853 100644 --- a/java/res/drawable-hdpi/key_hint_at_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_at_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_at_large_holo.9.png b/java/res/drawable-hdpi/key_hint_at_large_holo.9.png Binary files differindex 29d21bc58..d90bc31ab 100644 --- a/java/res/drawable-hdpi/key_hint_at_large_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_at_large_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_colon_holo.9.png b/java/res/drawable-hdpi/key_hint_colon_holo.9.png Binary files differindex 14c46990d..e82e41c94 100644 --- a/java/res/drawable-hdpi/key_hint_colon_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_colon_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_colon_large_holo.9.png b/java/res/drawable-hdpi/key_hint_colon_large_holo.9.png Binary files differindex 91e788323..e46845dbd 100644 --- a/java/res/drawable-hdpi/key_hint_colon_large_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_colon_large_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_comma_holo.9.png b/java/res/drawable-hdpi/key_hint_comma_holo.9.png Binary files differindex 82e4a93b7..47ae5efaf 100644 --- a/java/res/drawable-hdpi/key_hint_comma_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_comma_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_dash_holo.9.png b/java/res/drawable-hdpi/key_hint_dash_holo.9.png Binary files differindex 2ee22ba79..a2b2fceeb 100644 --- a/java/res/drawable-hdpi/key_hint_dash_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_dash_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_doublecross_holo.9.png b/java/res/drawable-hdpi/key_hint_doublecross_holo.9.png Binary files differindex 0da933239..d5af9f8c7 100644 --- a/java/res/drawable-hdpi/key_hint_doublecross_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_doublecross_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_equal_holo.9.png b/java/res/drawable-hdpi/key_hint_equal_holo.9.png Binary files differindex f5a9ba2f4..4acc3c3be 100644 --- a/java/res/drawable-hdpi/key_hint_equal_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_equal_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_exclamation_holo.9.png b/java/res/drawable-hdpi/key_hint_exclamation_holo.9.png Binary files differindex 6887156a5..8d99a27d2 100644 --- a/java/res/drawable-hdpi/key_hint_exclamation_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_exclamation_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_exclamation_large_holo.9.png b/java/res/drawable-hdpi/key_hint_exclamation_large_holo.9.png Binary files differindex e20a13715..e93e49187 100644 --- a/java/res/drawable-hdpi/key_hint_exclamation_large_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_exclamation_large_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_larger_holo.9.png b/java/res/drawable-hdpi/key_hint_larger_holo.9.png Binary files differindex 50652bb13..10614d9fe 100644 --- a/java/res/drawable-hdpi/key_hint_larger_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_larger_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_parenclose_holo.9.png b/java/res/drawable-hdpi/key_hint_parenclose_holo.9.png Binary files differindex 52ee86a0f..9096362e0 100644 --- a/java/res/drawable-hdpi/key_hint_parenclose_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_parenclose_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_parenopen_holo.9.png b/java/res/drawable-hdpi/key_hint_parenopen_holo.9.png Binary files differindex b0ed388ad..bb4cbd40d 100644 --- a/java/res/drawable-hdpi/key_hint_parenopen_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_parenopen_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_period_holo.9.png b/java/res/drawable-hdpi/key_hint_period_holo.9.png Binary files differindex 8d798a57f..68f789b95 100644 --- a/java/res/drawable-hdpi/key_hint_period_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_period_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_plus_holo.9.png b/java/res/drawable-hdpi/key_hint_plus_holo.9.png Binary files differindex f1d232e99..3dd85065a 100644 --- a/java/res/drawable-hdpi/key_hint_plus_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_plus_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_plus_large_holo.9.png b/java/res/drawable-hdpi/key_hint_plus_large_holo.9.png Binary files differindex 5f7d31563..b0d75f433 100644 --- a/java/res/drawable-hdpi/key_hint_plus_large_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_plus_large_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_question_holo.9.png b/java/res/drawable-hdpi/key_hint_question_holo.9.png Binary files differindex 9055c7688..4fe6a5b80 100644 --- a/java/res/drawable-hdpi/key_hint_question_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_question_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_question_large_holo.9.png b/java/res/drawable-hdpi/key_hint_question_large_holo.9.png Binary files differindex ade394cdd..44dfdc4ea 100644 --- a/java/res/drawable-hdpi/key_hint_question_large_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_question_large_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_quote_holo.9.png b/java/res/drawable-hdpi/key_hint_quote_holo.9.png Binary files differindex 361e3a8e4..8308aa647 100644 --- a/java/res/drawable-hdpi/key_hint_quote_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_quote_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_quote_large_holo.9.png b/java/res/drawable-hdpi/key_hint_quote_large_holo.9.png Binary files differindex cc5e8d710..e73b9e0c6 100644 --- a/java/res/drawable-hdpi/key_hint_quote_large_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_quote_large_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_semicolon_holo.9.png b/java/res/drawable-hdpi/key_hint_semicolon_holo.9.png Binary files differindex 7f9e8c90e..ac3de374c 100644 --- a/java/res/drawable-hdpi/key_hint_semicolon_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_semicolon_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_simplequote_holo.9.png b/java/res/drawable-hdpi/key_hint_simplequote_holo.9.png Binary files differindex 5e1a45c0e..20d56c549 100644 --- a/java/res/drawable-hdpi/key_hint_simplequote_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_simplequote_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_slash_holo.9.png b/java/res/drawable-hdpi/key_hint_slash_holo.9.png Binary files differindex 645586a30..3fe2c4271 100644 --- a/java/res/drawable-hdpi/key_hint_slash_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_slash_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_slash_large_holo.9.png b/java/res/drawable-hdpi/key_hint_slash_large_holo.9.png Binary files differindex 75c3bb1a6..47e767557 100644 --- a/java/res/drawable-hdpi/key_hint_slash_large_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_slash_large_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_smaller_holo.9.png b/java/res/drawable-hdpi/key_hint_smaller_holo.9.png Binary files differindex 2a0587cbd..19a7d937e 100644 --- a/java/res/drawable-hdpi/key_hint_smaller_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_smaller_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_star_holo.9.png b/java/res/drawable-hdpi/key_hint_star_holo.9.png Binary files differindex 9f33b9830..4e4340d63 100644 --- a/java/res/drawable-hdpi/key_hint_star_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_star_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_underline_holo.9.png b/java/res/drawable-hdpi/key_hint_underline_holo.9.png Binary files differindex a8841d08c..e4f271918 100644 --- a/java/res/drawable-hdpi/key_hint_underline_holo.9.png +++ b/java/res/drawable-hdpi/key_hint_underline_holo.9.png diff --git a/java/res/drawable-hdpi/key_hint_underline_large_holo.9.png b/java/res/drawable-hdpi/key_hint_underline_large_holo.9.png Binary files differnew file mode 100644 index 000000000..dad34fc72 --- /dev/null +++ b/java/res/drawable-hdpi/key_hint_underline_large_holo.9.png diff --git a/java/res/drawable-hdpi/keyboard_background.9.png b/java/res/drawable-hdpi/keyboard_background.9.png Binary files differindex edffac5b8..d57463fb6 100644 --- a/java/res/drawable-hdpi/keyboard_background.9.png +++ b/java/res/drawable-hdpi/keyboard_background.9.png diff --git a/java/res/drawable-hdpi/keyboard_background_holo.9.png b/java/res/drawable-hdpi/keyboard_background_holo.9.png Binary files differindex 87aa98e8e..76fe2c8b8 100644 --- a/java/res/drawable-hdpi/keyboard_background_holo.9.png +++ b/java/res/drawable-hdpi/keyboard_background_holo.9.png diff --git a/java/res/drawable-hdpi/keyboard_dark_background.9.png b/java/res/drawable-hdpi/keyboard_dark_background.9.png Binary files differindex f315cbdd4..fa3d449f7 100644 --- a/java/res/drawable-hdpi/keyboard_dark_background.9.png +++ b/java/res/drawable-hdpi/keyboard_dark_background.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_0.9.png b/java/res/drawable-hdpi/keyboard_hint_0.9.png Binary files differindex 271264e92..da52e0f5b 100644 --- a/java/res/drawable-hdpi/keyboard_hint_0.9.png +++ b/java/res/drawable-hdpi/keyboard_hint_0.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_1.9.png b/java/res/drawable-hdpi/keyboard_hint_1.9.png Binary files differindex eaf374262..7325c4cbb 100644 --- a/java/res/drawable-hdpi/keyboard_hint_1.9.png +++ b/java/res/drawable-hdpi/keyboard_hint_1.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_2.9.png b/java/res/drawable-hdpi/keyboard_hint_2.9.png Binary files differindex 8a1657117..35b7f2527 100644 --- a/java/res/drawable-hdpi/keyboard_hint_2.9.png +++ b/java/res/drawable-hdpi/keyboard_hint_2.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_3.9.png b/java/res/drawable-hdpi/keyboard_hint_3.9.png Binary files differindex 34b501109..1ae284838 100644 --- a/java/res/drawable-hdpi/keyboard_hint_3.9.png +++ b/java/res/drawable-hdpi/keyboard_hint_3.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_4.9.png b/java/res/drawable-hdpi/keyboard_hint_4.9.png Binary files differindex d4cc250dd..b67d6dd51 100644 --- a/java/res/drawable-hdpi/keyboard_hint_4.9.png +++ b/java/res/drawable-hdpi/keyboard_hint_4.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_5.9.png b/java/res/drawable-hdpi/keyboard_hint_5.9.png Binary files differindex 6a054b42f..ec52198d8 100644 --- a/java/res/drawable-hdpi/keyboard_hint_5.9.png +++ b/java/res/drawable-hdpi/keyboard_hint_5.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_6.9.png b/java/res/drawable-hdpi/keyboard_hint_6.9.png Binary files differindex 66e91400a..66dcf67e5 100644 --- a/java/res/drawable-hdpi/keyboard_hint_6.9.png +++ b/java/res/drawable-hdpi/keyboard_hint_6.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_7.9.png b/java/res/drawable-hdpi/keyboard_hint_7.9.png Binary files differindex 5eae24f4f..9d5499272 100644 --- a/java/res/drawable-hdpi/keyboard_hint_7.9.png +++ b/java/res/drawable-hdpi/keyboard_hint_7.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_8.9.png b/java/res/drawable-hdpi/keyboard_hint_8.9.png Binary files differindex ea7f512fd..beba1624c 100644 --- a/java/res/drawable-hdpi/keyboard_hint_8.9.png +++ b/java/res/drawable-hdpi/keyboard_hint_8.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_9.9.png b/java/res/drawable-hdpi/keyboard_hint_9.9.png Binary files differindex 0bf85de93..31ea54f32 100644 --- a/java/res/drawable-hdpi/keyboard_hint_9.9.png +++ b/java/res/drawable-hdpi/keyboard_hint_9.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_at.9.png b/java/res/drawable-hdpi/keyboard_hint_at.9.png Binary files differnew file mode 100644 index 000000000..4b49c0dd9 --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_hint_at.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_colon.9.png b/java/res/drawable-hdpi/keyboard_hint_colon.9.png Binary files differnew file mode 100644 index 000000000..a91dc47f1 --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_hint_colon.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_doublecross.9.png b/java/res/drawable-hdpi/keyboard_hint_doublecross.9.png Binary files differnew file mode 100644 index 000000000..c0917c200 --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_hint_doublecross.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_exclamation.9.png b/java/res/drawable-hdpi/keyboard_hint_exclamation.9.png Binary files differnew file mode 100644 index 000000000..98c07d94a --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_hint_exclamation.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_greater.9.png b/java/res/drawable-hdpi/keyboard_hint_greater.9.png Binary files differnew file mode 100644 index 000000000..f2bf37dc2 --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_hint_greater.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_plus.9.png b/java/res/drawable-hdpi/keyboard_hint_plus.9.png Binary files differnew file mode 100644 index 000000000..586e9c158 --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_hint_plus.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_question.9.png b/java/res/drawable-hdpi/keyboard_hint_question.9.png Binary files differnew file mode 100644 index 000000000..6c7d4310a --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_hint_question.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_quote.9.png b/java/res/drawable-hdpi/keyboard_hint_quote.9.png Binary files differnew file mode 100644 index 000000000..57f44e4a2 --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_hint_quote.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_smaller.9.png b/java/res/drawable-hdpi/keyboard_hint_smaller.9.png Binary files differnew file mode 100644 index 000000000..438b95ea8 --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_hint_smaller.9.png diff --git a/java/res/drawable-hdpi/keyboard_hint_star.9.png b/java/res/drawable-hdpi/keyboard_hint_star.9.png Binary files differnew file mode 100644 index 000000000..33f8281b2 --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_hint_star.9.png diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_background.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_background.9.png Binary files differindex 762a25704..27d992375 100644 --- a/java/res/drawable-hdpi/keyboard_key_feedback_background.9.png +++ b/java/res/drawable-hdpi/keyboard_key_feedback_background.9.png 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 Binary files differindex 571f3aa37..943f9e4bc 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 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 Binary files differindex 141d2d6be..33263b9d7 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 diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_more_background_holo.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_more_background_holo.9.png Binary files differnew file mode 100644 index 000000000..c21240f17 --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_key_feedback_more_background_holo.9.png diff --git a/java/res/drawable-hdpi/keyboard_popup_panel_background.9.png b/java/res/drawable-hdpi/keyboard_popup_panel_background.9.png Binary files differindex d6b2c7936..baff80950 100644 --- a/java/res/drawable-hdpi/keyboard_popup_panel_background.9.png +++ b/java/res/drawable-hdpi/keyboard_popup_panel_background.9.png diff --git a/java/res/drawable-hdpi/keyboard_popup_panel_background_holo.9.png b/java/res/drawable-hdpi/keyboard_popup_panel_background_holo.9.png Binary files differindex 2b529b887..4002dbe65 100644 --- a/java/res/drawable-hdpi/keyboard_popup_panel_background_holo.9.png +++ b/java/res/drawable-hdpi/keyboard_popup_panel_background_holo.9.png diff --git a/java/res/drawable-hdpi/keyboard_suggest_strip.9.png b/java/res/drawable-hdpi/keyboard_suggest_strip.9.png Binary files differindex 0ccdb6ab2..7cab5a899 100644 --- a/java/res/drawable-hdpi/keyboard_suggest_strip.9.png +++ b/java/res/drawable-hdpi/keyboard_suggest_strip.9.png diff --git a/java/res/drawable-hdpi/keyboard_suggest_strip_divider.png b/java/res/drawable-hdpi/keyboard_suggest_strip_divider.png Binary files differindex 7ca3e6131..7fca8c608 100644 --- a/java/res/drawable-hdpi/keyboard_suggest_strip_divider.png +++ b/java/res/drawable-hdpi/keyboard_suggest_strip_divider.png diff --git a/java/res/drawable-hdpi/keyboard_suggest_strip_holo.9.png b/java/res/drawable-hdpi/keyboard_suggest_strip_holo.9.png Binary files differnew file mode 100644 index 000000000..f55bcc933 --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_suggest_strip_holo.9.png diff --git a/java/res/drawable-hdpi/mic_slash.png b/java/res/drawable-hdpi/mic_slash.png Binary files differindex dc8da6252..71f4dc506 100644 --- a/java/res/drawable-hdpi/mic_slash.png +++ b/java/res/drawable-hdpi/mic_slash.png diff --git a/java/res/drawable-hdpi/mic_slash_holo.png b/java/res/drawable-hdpi/mic_slash_holo.png Binary files differindex 8108b6e13..27a05dec3 100644 --- a/java/res/drawable-hdpi/mic_slash_holo.png +++ b/java/res/drawable-hdpi/mic_slash_holo.png diff --git a/java/res/drawable-hdpi/ok_cancel.png b/java/res/drawable-hdpi/ok_cancel.png Binary files differindex f11e57a38..48c00f094 100644 --- a/java/res/drawable-hdpi/ok_cancel.png +++ b/java/res/drawable-hdpi/ok_cancel.png diff --git a/java/res/drawable-hdpi/ok_cancel_holo.9.png b/java/res/drawable-hdpi/ok_cancel_holo.9.png Binary files differnew file mode 100644 index 000000000..5be81c35a --- /dev/null +++ b/java/res/drawable-hdpi/ok_cancel_holo.9.png diff --git a/java/res/drawable-hdpi/speak_now_level0.png b/java/res/drawable-hdpi/speak_now_level0.png Binary files differindex 342849cfe..31571f75b 100644 --- a/java/res/drawable-hdpi/speak_now_level0.png +++ b/java/res/drawable-hdpi/speak_now_level0.png diff --git a/java/res/drawable-hdpi/speak_now_level0_holo.png b/java/res/drawable-hdpi/speak_now_level0_holo.png Binary files differnew file mode 100644 index 000000000..29eef926b --- /dev/null +++ b/java/res/drawable-hdpi/speak_now_level0_holo.png diff --git a/java/res/drawable-hdpi/speak_now_level1.png b/java/res/drawable-hdpi/speak_now_level1.png Binary files differindex 8947a4306..c8d0aae5d 100644 --- a/java/res/drawable-hdpi/speak_now_level1.png +++ b/java/res/drawable-hdpi/speak_now_level1.png diff --git a/java/res/drawable-hdpi/speak_now_level1_holo.png b/java/res/drawable-hdpi/speak_now_level1_holo.png Binary files differnew file mode 100644 index 000000000..a76e990b7 --- /dev/null +++ b/java/res/drawable-hdpi/speak_now_level1_holo.png diff --git a/java/res/drawable-hdpi/speak_now_level2.png b/java/res/drawable-hdpi/speak_now_level2.png Binary files differindex 44fc58c4e..123eea66e 100644 --- a/java/res/drawable-hdpi/speak_now_level2.png +++ b/java/res/drawable-hdpi/speak_now_level2.png diff --git a/java/res/drawable-hdpi/speak_now_level2_holo.png b/java/res/drawable-hdpi/speak_now_level2_holo.png Binary files differnew file mode 100644 index 000000000..8cd462d20 --- /dev/null +++ b/java/res/drawable-hdpi/speak_now_level2_holo.png diff --git a/java/res/drawable-hdpi/speak_now_level3.png b/java/res/drawable-hdpi/speak_now_level3.png Binary files differindex cfa5c1b87..a8a2c5cff 100644 --- a/java/res/drawable-hdpi/speak_now_level3.png +++ b/java/res/drawable-hdpi/speak_now_level3.png diff --git a/java/res/drawable-hdpi/speak_now_level3_holo.png b/java/res/drawable-hdpi/speak_now_level3_holo.png Binary files differnew file mode 100644 index 000000000..b7371dc88 --- /dev/null +++ b/java/res/drawable-hdpi/speak_now_level3_holo.png diff --git a/java/res/drawable-hdpi/speak_now_level4.png b/java/res/drawable-hdpi/speak_now_level4.png Binary files differindex a050d8836..b84d7b0e9 100644 --- a/java/res/drawable-hdpi/speak_now_level4.png +++ b/java/res/drawable-hdpi/speak_now_level4.png diff --git a/java/res/drawable-hdpi/speak_now_level4_holo.png b/java/res/drawable-hdpi/speak_now_level4_holo.png Binary files differnew file mode 100644 index 000000000..74befc8c3 --- /dev/null +++ b/java/res/drawable-hdpi/speak_now_level4_holo.png diff --git a/java/res/drawable-hdpi/speak_now_level5.png b/java/res/drawable-hdpi/speak_now_level5.png Binary files differindex 8cd5ae7ad..8dd2b607f 100644 --- a/java/res/drawable-hdpi/speak_now_level5.png +++ b/java/res/drawable-hdpi/speak_now_level5.png diff --git a/java/res/drawable-hdpi/speak_now_level5_holo.png b/java/res/drawable-hdpi/speak_now_level5_holo.png Binary files differnew file mode 100644 index 000000000..b027e8343 --- /dev/null +++ b/java/res/drawable-hdpi/speak_now_level5_holo.png diff --git a/java/res/drawable-hdpi/speak_now_level6.png b/java/res/drawable-hdpi/speak_now_level6.png Binary files differindex 9f4481eb4..888d0e5c7 100644 --- a/java/res/drawable-hdpi/speak_now_level6.png +++ b/java/res/drawable-hdpi/speak_now_level6.png diff --git a/java/res/drawable-hdpi/speak_now_level6_holo.png b/java/res/drawable-hdpi/speak_now_level6_holo.png Binary files differnew file mode 100644 index 000000000..17bb03452 --- /dev/null +++ b/java/res/drawable-hdpi/speak_now_level6_holo.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_123_mic.png b/java/res/drawable-hdpi/sym_bkeyboard_123_mic.png Binary files differindex 3e4eff698..24edfaa1c 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_123_mic.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_123_mic.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_delete.png b/java/res/drawable-hdpi/sym_bkeyboard_delete.png Binary files differindex 1d24cc85c..4ccd218ac 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_delete.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_delete.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_done.png b/java/res/drawable-hdpi/sym_bkeyboard_done.png Binary files differindex b77803d21..6959aeeef 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_done.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_done.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_mic.png b/java/res/drawable-hdpi/sym_bkeyboard_mic.png Binary files differindex 512f46080..6876fb64a 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_mic.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_mic.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num0.png b/java/res/drawable-hdpi/sym_bkeyboard_num0.png Binary files differindex 678a790de..08df3f3dd 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_num0.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_num0.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num1.png b/java/res/drawable-hdpi/sym_bkeyboard_num1.png Binary files differindex 4e68e35b3..36d8e5696 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_num1.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_num1.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num2.png b/java/res/drawable-hdpi/sym_bkeyboard_num2.png Binary files differindex 546663fda..c67fe2ea4 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_num2.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_num2.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num3.png b/java/res/drawable-hdpi/sym_bkeyboard_num3.png Binary files differindex 57f9a8d8e..cf80b2745 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_num3.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_num3.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num4.png b/java/res/drawable-hdpi/sym_bkeyboard_num4.png Binary files differindex de504388f..bfbb55a8f 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_num4.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_num4.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num5.png b/java/res/drawable-hdpi/sym_bkeyboard_num5.png Binary files differindex 1d2e1ef89..9f121ec12 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_num5.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_num5.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num6.png b/java/res/drawable-hdpi/sym_bkeyboard_num6.png Binary files differindex 39788b727..256186f3a 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_num6.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_num6.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num7.png b/java/res/drawable-hdpi/sym_bkeyboard_num7.png Binary files differindex fff6f27bf..7c8ce205e 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_num7.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_num7.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num8.png b/java/res/drawable-hdpi/sym_bkeyboard_num8.png Binary files differindex 8cc1a955e..4cfe7b11c 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_num8.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_num8.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_num9.png b/java/res/drawable-hdpi/sym_bkeyboard_num9.png Binary files differindex 021742509..d19c15cc8 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_num9.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_num9.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_numalt.png b/java/res/drawable-hdpi/sym_bkeyboard_numalt.png Binary files differindex 200714f66..762fd8cd7 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_numalt.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_numalt.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_numpound.png b/java/res/drawable-hdpi/sym_bkeyboard_numpound.png Binary files differindex 0a46122b2..2bd800d68 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_numpound.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_numpound.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_numstar.png b/java/res/drawable-hdpi/sym_bkeyboard_numstar.png Binary files differindex ca22bd535..b574f83f3 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_numstar.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_numstar.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_return.png b/java/res/drawable-hdpi/sym_bkeyboard_return.png Binary files differindex 426e1599e..2f9631a20 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_return.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_return.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_search.png b/java/res/drawable-hdpi/sym_bkeyboard_search.png Binary files differindex 1b6f884fa..7a5a0aab8 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_search.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_search.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_settings.png b/java/res/drawable-hdpi/sym_bkeyboard_settings.png Binary files differindex 08ba18f28..8a8caa895 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_settings.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_settings.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_shift.png b/java/res/drawable-hdpi/sym_bkeyboard_shift.png Binary files differindex 5a22dd309..1e3d5ec14 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_shift.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_shift.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_shift_locked.png b/java/res/drawable-hdpi/sym_bkeyboard_shift_locked.png Binary files differindex 566449126..e8a4d6423 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_shift_locked.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_shift_locked.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_space.png b/java/res/drawable-hdpi/sym_bkeyboard_space.png Binary files differindex cd0ebe2f4..9937a6288 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_space.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_space.png diff --git a/java/res/drawable-hdpi/sym_bkeyboard_tab.png b/java/res/drawable-hdpi/sym_bkeyboard_tab.png Binary files differindex 3466e1271..8dee747d2 100644 --- a/java/res/drawable-hdpi/sym_bkeyboard_tab.png +++ b/java/res/drawable-hdpi/sym_bkeyboard_tab.png diff --git a/java/res/drawable-hdpi/sym_keyboard_123_mic.png b/java/res/drawable-hdpi/sym_keyboard_123_mic.png Binary files differindex 62669803d..6f8292912 100644 --- a/java/res/drawable-hdpi/sym_keyboard_123_mic.png +++ b/java/res/drawable-hdpi/sym_keyboard_123_mic.png diff --git a/java/res/drawable-hdpi/sym_keyboard_delete.png b/java/res/drawable-hdpi/sym_keyboard_delete.png Binary files differindex 459ebcff8..8db099a7a 100644 --- a/java/res/drawable-hdpi/sym_keyboard_delete.png +++ b/java/res/drawable-hdpi/sym_keyboard_delete.png diff --git a/java/res/drawable-hdpi/sym_keyboard_delete_holo.png b/java/res/drawable-hdpi/sym_keyboard_delete_holo.png Binary files differnew file mode 100644 index 000000000..ff2a4acbb --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_delete_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_done.png b/java/res/drawable-hdpi/sym_keyboard_done.png Binary files differindex 471c5021b..6ba51d58c 100644 --- a/java/res/drawable-hdpi/sym_keyboard_done.png +++ b/java/res/drawable-hdpi/sym_keyboard_done.png diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_123_mic.png b/java/res/drawable-hdpi/sym_keyboard_feedback_123_mic.png Binary files differindex eef789680..4867298fa 100644 --- a/java/res/drawable-hdpi/sym_keyboard_feedback_123_mic.png +++ b/java/res/drawable-hdpi/sym_keyboard_feedback_123_mic.png diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_delete.png b/java/res/drawable-hdpi/sym_keyboard_feedback_delete.png Binary files differindex 8322e8e1d..7c12f79a1 100644 --- a/java/res/drawable-hdpi/sym_keyboard_feedback_delete.png +++ b/java/res/drawable-hdpi/sym_keyboard_feedback_delete.png diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_done.png b/java/res/drawable-hdpi/sym_keyboard_feedback_done.png Binary files differindex 7015e266a..e79bbb382 100644 --- a/java/res/drawable-hdpi/sym_keyboard_feedback_done.png +++ b/java/res/drawable-hdpi/sym_keyboard_feedback_done.png 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 Binary files differindex 889477cfb..4f4923b85 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 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 Binary files differindex b0f6d7feb..ed2ebe66c 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 diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_mic.png b/java/res/drawable-hdpi/sym_keyboard_feedback_mic.png Binary files differindex f82c33ae3..f228910c3 100644 --- a/java/res/drawable-hdpi/sym_keyboard_feedback_mic.png +++ b/java/res/drawable-hdpi/sym_keyboard_feedback_mic.png diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_numalt.png b/java/res/drawable-hdpi/sym_keyboard_feedback_numalt.png Binary files differindex 819236c8e..bb69300d1 100644 --- a/java/res/drawable-hdpi/sym_keyboard_feedback_numalt.png +++ b/java/res/drawable-hdpi/sym_keyboard_feedback_numalt.png diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_return.png b/java/res/drawable-hdpi/sym_keyboard_feedback_return.png Binary files differindex f038d3abe..99fa13cae 100644 --- a/java/res/drawable-hdpi/sym_keyboard_feedback_return.png +++ b/java/res/drawable-hdpi/sym_keyboard_feedback_return.png diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_search.png b/java/res/drawable-hdpi/sym_keyboard_feedback_search.png Binary files differindex 337f9e4fe..c006866d2 100644 --- a/java/res/drawable-hdpi/sym_keyboard_feedback_search.png +++ b/java/res/drawable-hdpi/sym_keyboard_feedback_search.png diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_settings.png b/java/res/drawable-hdpi/sym_keyboard_feedback_settings.png Binary files differindex 8a02be07e..5c685f9c3 100644 --- a/java/res/drawable-hdpi/sym_keyboard_feedback_settings.png +++ b/java/res/drawable-hdpi/sym_keyboard_feedback_settings.png diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_shift.png b/java/res/drawable-hdpi/sym_keyboard_feedback_shift.png Binary files differindex abf15f8f9..5b91afb82 100644 --- a/java/res/drawable-hdpi/sym_keyboard_feedback_shift.png +++ b/java/res/drawable-hdpi/sym_keyboard_feedback_shift.png diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.png b/java/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.png Binary files differindex 1fd822ea6..77e6a5fe9 100644 --- a/java/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.png +++ b/java/res/drawable-hdpi/sym_keyboard_feedback_shift_locked.png diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_space.png b/java/res/drawable-hdpi/sym_keyboard_feedback_space.png Binary files differindex 70debca9b..2d1b4a4b4 100644 --- a/java/res/drawable-hdpi/sym_keyboard_feedback_space.png +++ b/java/res/drawable-hdpi/sym_keyboard_feedback_space.png diff --git a/java/res/drawable-hdpi/sym_keyboard_feedback_tab.png b/java/res/drawable-hdpi/sym_keyboard_feedback_tab.png Binary files differindex d2efb1619..82280c608 100644 --- a/java/res/drawable-hdpi/sym_keyboard_feedback_tab.png +++ b/java/res/drawable-hdpi/sym_keyboard_feedback_tab.png diff --git a/java/res/drawable-hdpi/sym_keyboard_language_arrows_left.png b/java/res/drawable-hdpi/sym_keyboard_language_arrows_left.png Binary files differindex dcc4bd59b..34b8e931a 100644 --- a/java/res/drawable-hdpi/sym_keyboard_language_arrows_left.png +++ b/java/res/drawable-hdpi/sym_keyboard_language_arrows_left.png diff --git a/java/res/drawable-hdpi/sym_keyboard_language_arrows_right.png b/java/res/drawable-hdpi/sym_keyboard_language_arrows_right.png Binary files differindex ecf61a98e..b6ea3362b 100644 --- a/java/res/drawable-hdpi/sym_keyboard_language_arrows_right.png +++ b/java/res/drawable-hdpi/sym_keyboard_language_arrows_right.png diff --git a/java/res/drawable-hdpi/sym_keyboard_mic.png b/java/res/drawable-hdpi/sym_keyboard_mic.png Binary files differindex c8dca62a0..7207f8a92 100644 --- a/java/res/drawable-hdpi/sym_keyboard_mic.png +++ b/java/res/drawable-hdpi/sym_keyboard_mic.png diff --git a/java/res/drawable-hdpi/sym_keyboard_mic_disabled.png b/java/res/drawable-hdpi/sym_keyboard_mic_disabled.png Binary files differnew file mode 100644 index 000000000..c8dca62a0 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_mic_disabled.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num0.png b/java/res/drawable-hdpi/sym_keyboard_num0.png Binary files differindex 10ac70b9d..169efe21e 100644 --- a/java/res/drawable-hdpi/sym_keyboard_num0.png +++ b/java/res/drawable-hdpi/sym_keyboard_num0.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num0_holo.png b/java/res/drawable-hdpi/sym_keyboard_num0_holo.png Binary files differnew file mode 100644 index 000000000..ec8b5a8d2 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_num0_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num1.png b/java/res/drawable-hdpi/sym_keyboard_num1.png Binary files differindex 0fc03efa5..5b868489f 100644 --- a/java/res/drawable-hdpi/sym_keyboard_num1.png +++ b/java/res/drawable-hdpi/sym_keyboard_num1.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num1_holo.png b/java/res/drawable-hdpi/sym_keyboard_num1_holo.png Binary files differnew file mode 100644 index 000000000..60c8ab8a8 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_num1_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num2.png b/java/res/drawable-hdpi/sym_keyboard_num2.png Binary files differindex 283560b35..ddbe2199c 100644 --- a/java/res/drawable-hdpi/sym_keyboard_num2.png +++ b/java/res/drawable-hdpi/sym_keyboard_num2.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num2_holo.png b/java/res/drawable-hdpi/sym_keyboard_num2_holo.png Binary files differnew file mode 100644 index 000000000..578e37d6e --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_num2_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num3.png b/java/res/drawable-hdpi/sym_keyboard_num3.png Binary files differindex 9a3b3294b..1de90f3b1 100644 --- a/java/res/drawable-hdpi/sym_keyboard_num3.png +++ b/java/res/drawable-hdpi/sym_keyboard_num3.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num3_holo.png b/java/res/drawable-hdpi/sym_keyboard_num3_holo.png Binary files differnew file mode 100644 index 000000000..fb6250699 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_num3_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num4.png b/java/res/drawable-hdpi/sym_keyboard_num4.png Binary files differindex f13ff1ae9..c67ba5206 100644 --- a/java/res/drawable-hdpi/sym_keyboard_num4.png +++ b/java/res/drawable-hdpi/sym_keyboard_num4.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num4_holo.png b/java/res/drawable-hdpi/sym_keyboard_num4_holo.png Binary files differnew file mode 100644 index 000000000..c0e54a523 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_num4_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num5.png b/java/res/drawable-hdpi/sym_keyboard_num5.png Binary files differindex c251329fa..8410f2537 100644 --- a/java/res/drawable-hdpi/sym_keyboard_num5.png +++ b/java/res/drawable-hdpi/sym_keyboard_num5.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num5_holo.png b/java/res/drawable-hdpi/sym_keyboard_num5_holo.png Binary files differnew file mode 100644 index 000000000..b581a4657 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_num5_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num6.png b/java/res/drawable-hdpi/sym_keyboard_num6.png Binary files differindex 4acba4c91..22fa29d3f 100644 --- a/java/res/drawable-hdpi/sym_keyboard_num6.png +++ b/java/res/drawable-hdpi/sym_keyboard_num6.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num6_holo.png b/java/res/drawable-hdpi/sym_keyboard_num6_holo.png Binary files differnew file mode 100644 index 000000000..0791802ba --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_num6_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num7.png b/java/res/drawable-hdpi/sym_keyboard_num7.png Binary files differindex 14931c18c..a3798ea34 100644 --- a/java/res/drawable-hdpi/sym_keyboard_num7.png +++ b/java/res/drawable-hdpi/sym_keyboard_num7.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num7_holo.png b/java/res/drawable-hdpi/sym_keyboard_num7_holo.png Binary files differnew file mode 100644 index 000000000..7b3d3a825 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_num7_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num8.png b/java/res/drawable-hdpi/sym_keyboard_num8.png Binary files differindex d4973fdc9..7e963ad6b 100644 --- a/java/res/drawable-hdpi/sym_keyboard_num8.png +++ b/java/res/drawable-hdpi/sym_keyboard_num8.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num8_holo.png b/java/res/drawable-hdpi/sym_keyboard_num8_holo.png Binary files differnew file mode 100644 index 000000000..e076aedbe --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_num8_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num9.png b/java/res/drawable-hdpi/sym_keyboard_num9.png Binary files differindex 49cec66f4..1160d8545 100644 --- a/java/res/drawable-hdpi/sym_keyboard_num9.png +++ b/java/res/drawable-hdpi/sym_keyboard_num9.png diff --git a/java/res/drawable-hdpi/sym_keyboard_num9_holo.png b/java/res/drawable-hdpi/sym_keyboard_num9_holo.png Binary files differnew file mode 100644 index 000000000..4189cda79 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_num9_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_numalt.png b/java/res/drawable-hdpi/sym_keyboard_numalt.png Binary files differindex 3cc5311cd..f3a73deb0 100644 --- a/java/res/drawable-hdpi/sym_keyboard_numalt.png +++ b/java/res/drawable-hdpi/sym_keyboard_numalt.png diff --git a/java/res/drawable-hdpi/sym_keyboard_numbpound_holo.png b/java/res/drawable-hdpi/sym_keyboard_numbpound_holo.png Binary files differnew file mode 100644 index 000000000..73f8be054 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_numbpound_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_numbstar_holo.png b/java/res/drawable-hdpi/sym_keyboard_numbstar_holo.png Binary files differnew file mode 100644 index 000000000..fcb891b93 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_numbstar_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_numpound.png b/java/res/drawable-hdpi/sym_keyboard_numpound.png Binary files differindex d09133929..471f4fda3 100644 --- a/java/res/drawable-hdpi/sym_keyboard_numpound.png +++ b/java/res/drawable-hdpi/sym_keyboard_numpound.png diff --git a/java/res/drawable-hdpi/sym_keyboard_numstar.png b/java/res/drawable-hdpi/sym_keyboard_numstar.png Binary files differindex e838e169f..017c0f461 100644 --- a/java/res/drawable-hdpi/sym_keyboard_numstar.png +++ b/java/res/drawable-hdpi/sym_keyboard_numstar.png diff --git a/java/res/drawable-hdpi/sym_keyboard_return.png b/java/res/drawable-hdpi/sym_keyboard_return.png Binary files differindex 9d97e1efd..984db426e 100644 --- a/java/res/drawable-hdpi/sym_keyboard_return.png +++ b/java/res/drawable-hdpi/sym_keyboard_return.png diff --git a/java/res/drawable-hdpi/sym_keyboard_return_holo.png b/java/res/drawable-hdpi/sym_keyboard_return_holo.png Binary files differnew file mode 100644 index 000000000..ca3c02dbe --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_return_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_search.png b/java/res/drawable-hdpi/sym_keyboard_search.png Binary files differindex 1aa22d7e2..179e725f6 100644 --- a/java/res/drawable-hdpi/sym_keyboard_search.png +++ b/java/res/drawable-hdpi/sym_keyboard_search.png diff --git a/java/res/drawable-hdpi/sym_keyboard_settings.png b/java/res/drawable-hdpi/sym_keyboard_settings.png Binary files differindex 35d1ed6e6..164117812 100644 --- a/java/res/drawable-hdpi/sym_keyboard_settings.png +++ b/java/res/drawable-hdpi/sym_keyboard_settings.png diff --git a/java/res/drawable-hdpi/sym_keyboard_settings_holo.png b/java/res/drawable-hdpi/sym_keyboard_settings_holo.png Binary files differnew file mode 100644 index 000000000..b3af0c638 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_settings_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_shift.png b/java/res/drawable-hdpi/sym_keyboard_shift.png Binary files differindex bf217d147..2b3bd668d 100644 --- a/java/res/drawable-hdpi/sym_keyboard_shift.png +++ b/java/res/drawable-hdpi/sym_keyboard_shift.png diff --git a/java/res/drawable-hdpi/sym_keyboard_shift_holo.png b/java/res/drawable-hdpi/sym_keyboard_shift_holo.png Binary files differnew file mode 100644 index 000000000..375c1b4ca --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_shift_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_shift_locked.png b/java/res/drawable-hdpi/sym_keyboard_shift_locked.png Binary files differindex d11b39712..8a34a98a3 100644 --- a/java/res/drawable-hdpi/sym_keyboard_shift_locked.png +++ b/java/res/drawable-hdpi/sym_keyboard_shift_locked.png diff --git a/java/res/drawable-hdpi/sym_keyboard_shift_locked_holo.png b/java/res/drawable-hdpi/sym_keyboard_shift_locked_holo.png Binary files differindex f99a0edcf..57362eaf4 100644 --- a/java/res/drawable-hdpi/sym_keyboard_shift_locked_holo.png +++ b/java/res/drawable-hdpi/sym_keyboard_shift_locked_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_smiley_holo.png b/java/res/drawable-hdpi/sym_keyboard_smiley_holo.png Binary files differnew file mode 100644 index 000000000..a3f5e840d --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_smiley_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_space.png b/java/res/drawable-hdpi/sym_keyboard_space.png Binary files differindex fcd20de7d..dacc97d0a 100644 --- a/java/res/drawable-hdpi/sym_keyboard_space.png +++ b/java/res/drawable-hdpi/sym_keyboard_space.png diff --git a/java/res/drawable-hdpi/sym_keyboard_space_holo.png b/java/res/drawable-hdpi/sym_keyboard_space_holo.png Binary files differnew file mode 100644 index 000000000..a8e5f7d5e --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_space_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_space_led.9.png b/java/res/drawable-hdpi/sym_keyboard_space_led.9.png Binary files differindex 2c6f4a925..c76f64b94 100644 --- a/java/res/drawable-hdpi/sym_keyboard_space_led.9.png +++ b/java/res/drawable-hdpi/sym_keyboard_space_led.9.png diff --git a/java/res/drawable-hdpi/sym_keyboard_tab.png b/java/res/drawable-hdpi/sym_keyboard_tab.png Binary files differindex 51d17d989..efd740b5b 100644 --- a/java/res/drawable-hdpi/sym_keyboard_tab.png +++ b/java/res/drawable-hdpi/sym_keyboard_tab.png diff --git a/java/res/drawable-hdpi/sym_keyboard_voice_holo.png b/java/res/drawable-hdpi/sym_keyboard_voice_holo.png Binary files differnew file mode 100644 index 000000000..5ea2edc53 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_voice_holo.png diff --git a/java/res/drawable-hdpi/sym_keyboard_voice_off_holo.png b/java/res/drawable-hdpi/sym_keyboard_voice_off_holo.png Binary files differnew file mode 100644 index 000000000..8a445eb56 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_voice_off_holo.png diff --git a/java/res/drawable-hdpi/top_suggest_line_holo.9.png b/java/res/drawable-hdpi/top_suggest_line_holo.9.png Binary files differnew file mode 100644 index 000000000..dcce3015f --- /dev/null +++ b/java/res/drawable-hdpi/top_suggest_line_holo.9.png diff --git a/java/res/drawable-hdpi/voice_ime_background.9.png b/java/res/drawable-hdpi/voice_ime_background.9.png Binary files differindex 42868522f..a604f497c 100644 --- a/java/res/drawable-hdpi/voice_ime_background.9.png +++ b/java/res/drawable-hdpi/voice_ime_background.9.png diff --git a/java/res/drawable-hdpi/voice_swipe_hint.png b/java/res/drawable-hdpi/voice_swipe_hint.png Binary files differindex 130f83a9c..976fd56d6 100644 --- a/java/res/drawable-hdpi/voice_swipe_hint.png +++ b/java/res/drawable-hdpi/voice_swipe_hint.png diff --git a/java/res/drawable-hdpi/working.png b/java/res/drawable-hdpi/working.png Binary files differindex 5ea702307..c43439e93 100644 --- a/java/res/drawable-hdpi/working.png +++ b/java/res/drawable-hdpi/working.png diff --git a/java/res/drawable-land-hdpi/hint_popup_holo.9.png b/java/res/drawable-land-hdpi/hint_popup_holo.9.png Binary files differnew file mode 100644 index 000000000..2b93014e1 --- /dev/null +++ b/java/res/drawable-land-hdpi/hint_popup_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_at_holo.9.png b/java/res/drawable-land-hdpi/key_hint_at_holo.9.png Binary files differnew file mode 100644 index 000000000..874802fcb --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_at_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_at_large_holo.9.png b/java/res/drawable-land-hdpi/key_hint_at_large_holo.9.png Binary files differnew file mode 100644 index 000000000..d90bc31ab --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_at_large_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_colon_holo.9.png b/java/res/drawable-land-hdpi/key_hint_colon_holo.9.png Binary files differnew file mode 100644 index 000000000..e82e41c94 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_colon_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_colon_large_holo.9.png b/java/res/drawable-land-hdpi/key_hint_colon_large_holo.9.png Binary files differnew file mode 100644 index 000000000..e46845dbd --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_colon_large_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_comma_holo.9.png b/java/res/drawable-land-hdpi/key_hint_comma_holo.9.png Binary files differnew file mode 100644 index 000000000..9ab5dadac --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_comma_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_dash_holo.9.png b/java/res/drawable-land-hdpi/key_hint_dash_holo.9.png Binary files differnew file mode 100644 index 000000000..c045b8c54 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_dash_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_doublecross_holo.9.png b/java/res/drawable-land-hdpi/key_hint_doublecross_holo.9.png Binary files differnew file mode 100644 index 000000000..6975ab71f --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_doublecross_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_equal_holo.9.png b/java/res/drawable-land-hdpi/key_hint_equal_holo.9.png Binary files differnew file mode 100644 index 000000000..a619fb29f --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_equal_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_exclamation_holo.9.png b/java/res/drawable-land-hdpi/key_hint_exclamation_holo.9.png Binary files differnew file mode 100644 index 000000000..570a1b87d --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_exclamation_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_exclamation_large_holo.9.png b/java/res/drawable-land-hdpi/key_hint_exclamation_large_holo.9.png Binary files differnew file mode 100644 index 000000000..e93e49187 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_exclamation_large_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_larger_holo.9.png b/java/res/drawable-land-hdpi/key_hint_larger_holo.9.png Binary files differnew file mode 100644 index 000000000..f8d960f17 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_larger_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_parenclose_holo.9.png b/java/res/drawable-land-hdpi/key_hint_parenclose_holo.9.png Binary files differnew file mode 100644 index 000000000..9d8b05761 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_parenclose_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_parenopen_holo.9.png b/java/res/drawable-land-hdpi/key_hint_parenopen_holo.9.png Binary files differnew file mode 100644 index 000000000..8e2d8f2ad --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_parenopen_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_period_holo.9.png b/java/res/drawable-land-hdpi/key_hint_period_holo.9.png Binary files differnew file mode 100644 index 000000000..bf8c6d722 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_period_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_plus_holo.9.png b/java/res/drawable-land-hdpi/key_hint_plus_holo.9.png Binary files differnew file mode 100644 index 000000000..3dd85065a --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_plus_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_plus_large_holo.9.png b/java/res/drawable-land-hdpi/key_hint_plus_large_holo.9.png Binary files differnew file mode 100644 index 000000000..b0d75f433 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_plus_large_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_question_holo.9.png b/java/res/drawable-land-hdpi/key_hint_question_holo.9.png Binary files differnew file mode 100644 index 000000000..1a0db31ec --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_question_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_question_large_holo.9.png b/java/res/drawable-land-hdpi/key_hint_question_large_holo.9.png Binary files differnew file mode 100644 index 000000000..44dfdc4ea --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_question_large_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_quote_holo.9.png b/java/res/drawable-land-hdpi/key_hint_quote_holo.9.png Binary files differnew file mode 100644 index 000000000..bfb612f59 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_quote_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_quote_large_holo.9.png b/java/res/drawable-land-hdpi/key_hint_quote_large_holo.9.png Binary files differnew file mode 100644 index 000000000..e73b9e0c6 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_quote_large_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_semicolon_holo.9.png b/java/res/drawable-land-hdpi/key_hint_semicolon_holo.9.png Binary files differnew file mode 100644 index 000000000..f35275857 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_semicolon_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_simplequote_holo.9.png b/java/res/drawable-land-hdpi/key_hint_simplequote_holo.9.png Binary files differnew file mode 100644 index 000000000..e69a9696e --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_simplequote_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_slash_holo.9.png b/java/res/drawable-land-hdpi/key_hint_slash_holo.9.png Binary files differnew file mode 100644 index 000000000..592ea4434 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_slash_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_slash_large_holo.9.png b/java/res/drawable-land-hdpi/key_hint_slash_large_holo.9.png Binary files differnew file mode 100644 index 000000000..b18be7bb5 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_slash_large_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_smaller_holo.9.png b/java/res/drawable-land-hdpi/key_hint_smaller_holo.9.png Binary files differnew file mode 100644 index 000000000..145320dab --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_smaller_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_star_holo.9.png b/java/res/drawable-land-hdpi/key_hint_star_holo.9.png Binary files differnew file mode 100644 index 000000000..9bde78a21 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_star_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_underline_holo.9.png b/java/res/drawable-land-hdpi/key_hint_underline_holo.9.png Binary files differnew file mode 100644 index 000000000..b2ab17d41 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_underline_holo.9.png diff --git a/java/res/drawable-land-hdpi/key_hint_underline_large_holo.9.png b/java/res/drawable-land-hdpi/key_hint_underline_large_holo.9.png Binary files differnew file mode 100644 index 000000000..dad34fc72 --- /dev/null +++ b/java/res/drawable-land-hdpi/key_hint_underline_large_holo.9.png diff --git a/java/res/drawable-land-mdpi/key_hint_colon_holo.9.png b/java/res/drawable-land-mdpi/key_hint_colon_holo.9.png Binary files differindex 6470ed391..12ce26758 100644 --- a/java/res/drawable-land-mdpi/key_hint_colon_holo.9.png +++ b/java/res/drawable-land-mdpi/key_hint_colon_holo.9.png diff --git a/java/res/drawable-land-mdpi/key_hint_colon_large_holo.9.png b/java/res/drawable-land-mdpi/key_hint_colon_large_holo.9.png Binary files differindex bdf4ed574..a51bada57 100644 --- a/java/res/drawable-land-mdpi/key_hint_colon_large_holo.9.png +++ b/java/res/drawable-land-mdpi/key_hint_colon_large_holo.9.png diff --git a/java/res/drawable-land-mdpi/key_hint_plus_holo.9.png b/java/res/drawable-land-mdpi/key_hint_plus_holo.9.png Binary files differindex 7698a5806..a80c03169 100644 --- a/java/res/drawable-land-mdpi/key_hint_plus_holo.9.png +++ b/java/res/drawable-land-mdpi/key_hint_plus_holo.9.png diff --git a/java/res/drawable-land-mdpi/key_hint_plus_large_holo.9.png b/java/res/drawable-land-mdpi/key_hint_plus_large_holo.9.png Binary files differindex 206d99073..e8daaf085 100644 --- a/java/res/drawable-land-mdpi/key_hint_plus_large_holo.9.png +++ b/java/res/drawable-land-mdpi/key_hint_plus_large_holo.9.png diff --git a/java/res/drawable-mdpi/sym_keyboard_smiley_holo.png b/java/res/drawable-land-mdpi/key_hint_underline_large_holo.9.png Binary files differindex 90a127212..50f99a191 100644 --- a/java/res/drawable-mdpi/sym_keyboard_smiley_holo.png +++ b/java/res/drawable-land-mdpi/key_hint_underline_large_holo.9.png diff --git a/java/res/drawable-mdpi/ic_subtype_keyboard.png b/java/res/drawable-mdpi/ic_subtype_keyboard.png Binary files differnew file mode 100644 index 000000000..d28efc106 --- /dev/null +++ b/java/res/drawable-mdpi/ic_subtype_keyboard.png diff --git a/java/res/drawable-mdpi/ic_subtype_mic.png b/java/res/drawable-mdpi/ic_subtype_mic.png Binary files differnew file mode 100644 index 000000000..0b6aca802 --- /dev/null +++ b/java/res/drawable-mdpi/ic_subtype_mic.png diff --git a/java/res/drawable-mdpi/key_hint_colon_holo.9.png b/java/res/drawable-mdpi/key_hint_colon_holo.9.png Binary files differindex 14c46990d..12ce26758 100644 --- a/java/res/drawable-mdpi/key_hint_colon_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_colon_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_colon_large_holo.9.png b/java/res/drawable-mdpi/key_hint_colon_large_holo.9.png Binary files differindex 91e788323..a51bada57 100644 --- a/java/res/drawable-mdpi/key_hint_colon_large_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_colon_large_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_plus_holo.9.png b/java/res/drawable-mdpi/key_hint_plus_holo.9.png Binary files differindex f1d232e99..a80c03169 100644 --- a/java/res/drawable-mdpi/key_hint_plus_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_plus_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_plus_large_holo.9.png b/java/res/drawable-mdpi/key_hint_plus_large_holo.9.png Binary files differindex 5f7d31563..e8daaf085 100644 --- a/java/res/drawable-mdpi/key_hint_plus_large_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_plus_large_holo.9.png diff --git a/java/res/drawable-mdpi/sym_bkeyboard_voice_off.png b/java/res/drawable-mdpi/sym_bkeyboard_voice_off.png Binary files differnew file mode 100644 index 000000000..081a13096 --- /dev/null +++ b/java/res/drawable-mdpi/sym_bkeyboard_voice_off.png diff --git a/java/res/drawable-mdpi/sym_keyboard_mic_disabled.png b/java/res/drawable-mdpi/sym_keyboard_mic_disabled.png Binary files differnew file mode 100644 index 000000000..e926b3fa6 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_mic_disabled.png diff --git a/java/res/drawable-mdpi/sym_keyboard_settings_holo.png b/java/res/drawable-mdpi/sym_keyboard_settings_holo.png Binary files differindex ad7618fa0..8233623e3 100644 --- a/java/res/drawable-mdpi/sym_keyboard_settings_holo.png +++ b/java/res/drawable-mdpi/sym_keyboard_settings_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_voice_off_holo.png b/java/res/drawable-mdpi/sym_keyboard_voice_off_holo.png Binary files differnew file mode 100644 index 000000000..081a13096 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_voice_off_holo.png diff --git a/java/res/drawable/ic_subtype_keyboard.png b/java/res/drawable/ic_subtype_keyboard.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_cs.png b/java/res/drawable/ic_subtype_keyboard_cs.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_cs.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_da.png b/java/res/drawable/ic_subtype_keyboard_da.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_da.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_de.png b/java/res/drawable/ic_subtype_keyboard_de.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_de.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_en_gb.png b/java/res/drawable/ic_subtype_keyboard_en_gb.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_en_gb.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_en_us.png b/java/res/drawable/ic_subtype_keyboard_en_us.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_en_us.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_es.png b/java/res/drawable/ic_subtype_keyboard_es.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_es.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_es_us.png b/java/res/drawable/ic_subtype_keyboard_es_us.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_es_us.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_fr.png b/java/res/drawable/ic_subtype_keyboard_fr.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_fr.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_fr_ca.png b/java/res/drawable/ic_subtype_keyboard_fr_ca.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_fr_ca.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_fr_ch.png b/java/res/drawable/ic_subtype_keyboard_fr_ch.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_fr_ch.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_it.png b/java/res/drawable/ic_subtype_keyboard_it.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_it.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_nb.png b/java/res/drawable/ic_subtype_keyboard_nb.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_nb.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_nl.png b/java/res/drawable/ic_subtype_keyboard_nl.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_nl.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_ru.png b/java/res/drawable/ic_subtype_keyboard_ru.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_ru.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_sr.png b/java/res/drawable/ic_subtype_keyboard_sr.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_sr.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_keyboard_sv.png b/java/res/drawable/ic_subtype_keyboard_sv.png Binary files differdeleted file mode 100644 index 001a38c5c..000000000 --- a/java/res/drawable/ic_subtype_keyboard_sv.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic.png b/java/res/drawable/ic_subtype_mic.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_cs.png b/java/res/drawable/ic_subtype_mic_cs.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_cs.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_de.png b/java/res/drawable/ic_subtype_mic_de.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_de.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_en_au.png b/java/res/drawable/ic_subtype_mic_en_au.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_en_au.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_en_gb.png b/java/res/drawable/ic_subtype_mic_en_gb.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_en_gb.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_en_in.png b/java/res/drawable/ic_subtype_mic_en_in.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_en_in.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_en_nz.png b/java/res/drawable/ic_subtype_mic_en_nz.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_en_nz.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_en_us.png b/java/res/drawable/ic_subtype_mic_en_us.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_en_us.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_es.png b/java/res/drawable/ic_subtype_mic_es.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_es.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_fr.png b/java/res/drawable/ic_subtype_mic_fr.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_fr.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_ja.png b/java/res/drawable/ic_subtype_mic_ja.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_ja.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_ko.png b/java/res/drawable/ic_subtype_mic_ko.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_ko.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_pl.png b/java/res/drawable/ic_subtype_mic_pl.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_pl.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_pt.png b/java/res/drawable/ic_subtype_mic_pt.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_pt.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_ru.png b/java/res/drawable/ic_subtype_mic_ru.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_ru.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_tr.png b/java/res/drawable/ic_subtype_mic_tr.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_tr.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_zh_cn.png b/java/res/drawable/ic_subtype_mic_zh_cn.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_zh_cn.png +++ /dev/null diff --git a/java/res/drawable/ic_subtype_mic_zh_tw.png b/java/res/drawable/ic_subtype_mic_zh_tw.png Binary files differdeleted file mode 100644 index 03c0b6982..000000000 --- a/java/res/drawable/ic_subtype_mic_zh_tw.png +++ /dev/null diff --git a/java/res/layout/input_stone_bold.xml b/java/res/layout/input_stone_bold.xml index bf25e1597..6fdc93855 100644 --- a/java/res/layout/input_stone_bold.xml +++ b/java/res/layout/input_stone_bold.xml @@ -29,6 +29,7 @@ latin:keyBackground="@drawable/btn_keyboard_key_stone" latin:keyTextColor="@color/latinkeyboard_key_color_black" + latin:keyTextColorDisabled="#FF808080" latin:shadowColor="@color/latinkeyboard_key_color_white" latin:keyLetterStyle="bold" latin:colorScheme="black" diff --git a/java/res/layout/input_stone_normal.xml b/java/res/layout/input_stone_normal.xml index cf4708612..6ae9aed55 100644 --- a/java/res/layout/input_stone_normal.xml +++ b/java/res/layout/input_stone_normal.xml @@ -29,6 +29,7 @@ latin:keyBackground="@drawable/btn_keyboard_key_stone" latin:keyTextColor="@color/latinkeyboard_key_color_black" + latin:keyTextColorDisabled="#FF808080" latin:shadowColor="@color/latinkeyboard_key_color_white" latin:colorScheme="black" latin:popupLayout="@layout/input_stone_popup" diff --git a/java/res/layout/recognition_status.xml b/java/res/layout/recognition_status.xml index b2c9f4a51..9474d6f58 100644 --- a/java/res/layout/recognition_status.xml +++ b/java/res/layout/recognition_status.xml @@ -26,7 +26,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/popup_layout" android:orientation="vertical" - android:layout_height="0dip" + android:layout_height="371dip" android:layout_width="500dip" android:layout_centerInParent="true" android:background="@drawable/vs_dialog_red"> @@ -70,6 +70,22 @@ android:layout_centerInParent="true" android:visibility="gone"/> </RelativeLayout> + <!-- + The text is set by the code. We specify a random text (voice_error), so the + text view does not have a zero height. This is necessary to keep the slash + mic and the recording mic is the same position + --> + <TextView + android:id="@+id/language" + android:text="@string/voice_error" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:singleLine="true" + android:textSize="14sp" + android:layout_marginBottom="3dip" + android:layout_gravity="center" + android:textColor="#ffffff" + android:visibility="invisible"/> <Button android:id="@+id/button" android:layout_width="match_parent" diff --git a/java/res/values-ca/donottranslate-altchars.xml b/java/res/values-ca/donottranslate-altchars.xml new file mode 100644 index 000000000..336057be0 --- /dev/null +++ b/java/res/values-ca/donottranslate-altchars.xml @@ -0,0 +1,29 @@ +<?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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="alternates_for_a">à,á,ä,â,ã,å,ą,æ,ā,ª</string> + <string name="alternates_for_e">3,è,é,ë,ê,ę,ė,ē</string> + <string name="alternates_for_i">8,í,ï,ì,î,į,ī</string> + <string name="alternates_for_o">9,ò,ó,ö,ô,õ,ø,œ,ō,º</string> + <string name="alternates_for_u">7,ú,ü,ù,û,ū</string> + <string name="alternates_for_n">ñ,ń</string> + <string name="alternates_for_c">ç,ć,č</string> + <string name="alternates_for_l">ŀ,ł</string> +</resources> diff --git a/java/res/values-cs/donottranslate-altchars.xml b/java/res/values-cs/donottranslate-altchars.xml index f19ac0026..541cd2154 100644 --- a/java/res/values-cs/donottranslate-altchars.xml +++ b/java/res/values-cs/donottranslate-altchars.xml @@ -18,16 +18,17 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_a">á,à,â,ã,ä,å,æ</string> - <string name="alternates_for_e">3,é,ě,è,ê,ë</string> - <string name="alternates_for_i">í,ì,î,ï,8</string> - <string name="alternates_for_o">ó,ò,ô,õ,ö,œ,ø,9</string> - <string name="alternates_for_u">ů,ú,ù,û,ü,7</string> - <string name="alternates_for_s">š,§,ß</string> - <string name="alternates_for_n">ň,ñ</string> - <string name="alternates_for_c">č,ç</string> + <string name="alternates_for_a">á,à,â,ä,æ,ã,å,ā</string> + <string name="alternates_for_e">3,é,ě,è,ê,ë,ę,ė,ē</string> + <string name="alternates_for_i">8,í,î,ï,ì,į,ī</string> + <string name="alternates_for_o">9,ó,ö,ô,ò,õ,œ,ø,ō</string> + <string name="alternates_for_u">7,ú,ů,û,ü,ù,ū</string> + <string name="alternates_for_s">š,ß,ś</string> + <string name="alternates_for_n">ň,ñ,ń</string> + <string name="alternates_for_c">č,ç,ć</string> + <string name="alternates_for_y">ý,ÿ</string> <string name="alternates_for_d">ď</string> - <string name="alternates_for_r">ř,4</string> - <string name="alternates_for_t">ť,5</string> - <string name="alternates_for_z">ž</string> + <string name="alternates_for_r">4,ř</string> + <string name="alternates_for_t">5,ť</string> + <string name="alternates_for_z">6,ž,ź,ż</string> </resources> diff --git a/java/res/values-da/donottranslate-altchars.xml b/java/res/values-da/donottranslate-altchars.xml index ca1df7c25..46f1644ad 100644 --- a/java/res/values-da/donottranslate-altchars.xml +++ b/java/res/values-da/donottranslate-altchars.xml @@ -18,23 +18,18 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_a">á,à,â,ą,ã</string> - <string name="alternates_for_e">3,é,è,ê,ë,ę,€</string> - <string name="alternates_for_i">í,ì,î,ï,8</string> - <string name="alternates_for_o">ó,ò,ô,õ,9</string> - <string name="alternates_for_u">ú,ù,û,ū,7</string> - <string name="alternates_for_s">ś,š,ş,ß</string> - <string name="alternates_for_n">ń,ñ,ň</string> - <string name="alternates_for_c">ç,ć,č</string> - <string name="alternates_for_y">ý,ÿ,ü,6</string> - <string name="alternates_for_d">ð,ď</string> - <string name="alternates_for_r">ř,4</string> - <string name="alternates_for_t">ť,þ,5</string> - <string name="alternates_for_z">ź,ž,ż</string> + <string name="alternates_for_a">á,ä,à,â,ã,ā</string> + <string name="alternates_for_e">3,é,ë</string> + <string name="alternates_for_i">8,í,ï</string> + <string name="alternates_for_o">9,ó,ô,ò,õ,œ,ō</string> + <string name="alternates_for_u">7,ú,ü,û,ù,ū</string> + <string name="alternates_for_s">ß,ś,š</string> + <string name="alternates_for_n">ñ,ń</string> + <string name="alternates_for_y">6,ý,ÿ</string> + <string name="alternates_for_d">ð</string> <string name="alternates_for_l">ł</string> - <string name="alternates_for_v">w</string> <string name="keylabel_for_scandinavia_row2_10">æ</string> <string name="keylabel_for_scandinavia_row2_11">ø</string> <string name="alternates_for_scandinavia_row2_10">ä</string> - <string name="alternates_for_scandinavia_row2_11">ö,œ</string> + <string name="alternates_for_scandinavia_row2_11">ö</string> </resources> diff --git a/java/res/values-de/donottranslate-altchars.xml b/java/res/values-de/donottranslate-altchars.xml index 6c1abc6d0..8b8b6aed7 100644 --- a/java/res/values-de/donottranslate-altchars.xml +++ b/java/res/values-de/donottranslate-altchars.xml @@ -18,8 +18,12 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_a">ä</string> - <string name="alternates_for_o">ö,9</string> - <string name="alternates_for_y">ý,ÿ</string> + <string name="alternates_for_a">ä,â,à,á,æ,ã,å,ā</string> + <string name="alternates_for_e">3,ė</string> + <string name="alternates_for_o">9,ö,ô,ò,ó,õ,œ,ø,ō</string> + <string name="alternates_for_u">7,ü,û,ù,ú,ū</string> + <string name="alternates_for_s">ß,ś,š</string> + <string name="alternates_for_n">ñ,ń</string> + <string name="alternates_for_y"></string> <string name="alternates_for_z">6</string> </resources> diff --git a/java/res/values-en/donottranslate-altchars.xml b/java/res/values-en/donottranslate-altchars.xml index baded885a..3950d7dff 100644 --- a/java/res/values-en/donottranslate-altchars.xml +++ b/java/res/values-en/donottranslate-altchars.xml @@ -18,9 +18,11 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_a">à,á,â,ã,ä,å,ā,æ</string> + <string name="alternates_for_a">à,á,â,ä,æ,ã,å,ā</string> <string name="alternates_for_e">3,è,é,ê,ë,ē</string> - <string name="alternates_for_i">ì,í,î,ï,ī,8</string> - <string name="alternates_for_o">ò,ó,ô,õ,ö,ō,œ,ø,9</string> - <string name="alternates_for_u">ù,ú,û,ü,ū,7</string> + <string name="alternates_for_i">8,î,ï,í,ī,ì</string> + <string name="alternates_for_o">9,ô,ö,ò,ó,œ,ø,ō,õ</string> + <string name="alternates_for_u">7,û,ü,ù,ú,ū</string> + <string name="alternates_for_n">ñ</string> + <string name="alternates_for_c">ç</string> </resources> diff --git a/java/res/values-es-rUS-xlarge/strings.xml b/java/res/values-es-rUS-xlarge/strings.xml index 55598ebd2..24d2b4f90 100644 --- a/java/res/values-es-rUS-xlarge/strings.xml +++ b/java/res/values-es-rUS-xlarge/strings.xml @@ -88,19 +88,13 @@ <!-- XL --> <string name="subtype_mode_sv_keyboard" msgid="3874083866564515371">"Teclado en sueco"</string> <!-- XL --> + <string name="subtype_mode_af_voice">"Voz en Afrikáans"</string> + <!-- XL --> <string name="subtype_mode_cs_voice" msgid="8290007904951946296">"Voz en checo"</string> <!-- XL --> <string name="subtype_mode_de_voice" msgid="672328729666823853">"Voz en alemán"</string> <!-- XL --> - <string name="subtype_mode_en_AU_voice" msgid="4170989257043892770">"Voz en inglés (Australia)"</string> - <!-- XL --> - <string name="subtype_mode_en_GB_voice" msgid="3134961988951205695">"Voz en inglés (Reino Unido)"</string> - <!-- XL --> - <string name="subtype_mode_en_IN_voice" msgid="5699787782487633128">"Voz en inglés (India)"</string> - <!-- XL --> - <string name="subtype_mode_en_NZ_voice" msgid="4121688717194804130">"Voz en inglés (Nueva Zelanda)"</string> - <!-- XL --> - <string name="subtype_mode_en_US_voice" msgid="8006563098744135975">"Voz en inglés (EE.UU.)"</string> + <string name="subtype_mode_en_voice">"Voz en inglés"</string> <!-- XL --> <string name="subtype_mode_es_voice" msgid="1243071504878834350">"Voz en español"</string> <!-- XL --> @@ -118,9 +112,11 @@ <!-- XL --> <string name="subtype_mode_tr_voice" msgid="5242644971865917801">"Voz en turco"</string> <!-- XL --> - <string name="subtype_mode_zh_CN_voice" msgid="4505329319557358473">"Voz en chino (China, simplificado)"</string> + <string name="subtype_mode_yue_voice">"Voz en chino, yue"</string> + <!-- XL --> + <string name="subtype_mode_zh_voice">"Voz en chino, mandarín"</string> <!-- XL --> - <string name="subtype_mode_zh_TW_voice" msgid="3976996097508134329">"Voz en chino (Taiwán, tradicional)"</string> + <string name="subtype_mode_zu_voice">"Voz en isiZulu"</string> <!-- XL --> <string name="prefs_usability_study_mode" msgid="8423000345880575687">"Modo estudio de usabilidad"</string> </resources> diff --git a/java/res/values-es/donottranslate-altchars.xml b/java/res/values-es/donottranslate-altchars.xml index 35187d0de..99f1663a1 100644 --- a/java/res/values-es/donottranslate-altchars.xml +++ b/java/res/values-es/donottranslate-altchars.xml @@ -18,7 +18,11 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_a">á</string> - <string name="alternates_for_e">3,é</string> - <string name="alternates_for_o">ó,9</string> + <string name="alternates_for_a">á,à,ä,â,ã,å,ą,æ,ā,ª</string> + <string name="alternates_for_e">3,é,è,ë,ê,ę,ė,ē</string> + <string name="alternates_for_i">8,í,ï,ì,î,į,ī</string> + <string name="alternates_for_o">9,ó,ò,ö,ô,õ,ø,œ,ō,º</string> + <string name="alternates_for_u">7,ú,ü,ù,û,ū</string> + <string name="alternates_for_n">ñ,ń</string> + <string name="alternates_for_c">ç,ć,č</string> </resources> diff --git a/java/res/values-fi/donottranslate-altchars.xml b/java/res/values-fi/donottranslate-altchars.xml new file mode 100644 index 000000000..ff87a3258 --- /dev/null +++ b/java/res/values-fi/donottranslate-altchars.xml @@ -0,0 +1,30 @@ +<?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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="alternates_for_a">æ,à,á,â,ã,ā</string> + <string name="alternates_for_o">9,ø,ô,ò,ó,õ,œ,ō</string> + <string name="alternates_for_u">7,ü</string> + <string name="alternates_for_s">š,ß,ś</string> + <string name="alternates_for_z">ž,ź,ż</string> + <string name="keylabel_for_scandinavia_row2_10">ö</string> + <string name="keylabel_for_scandinavia_row2_11">ä</string> + <string name="alternates_for_scandinavia_row2_10">ø</string> + <string name="alternates_for_scandinavia_row2_11">æ</string> +</resources> diff --git a/java/res/values-fr/donottranslate-altchars.xml b/java/res/values-fr/donottranslate-altchars.xml index 830119d52..e01f63f14 100644 --- a/java/res/values-fr/donottranslate-altchars.xml +++ b/java/res/values-fr/donottranslate-altchars.xml @@ -18,7 +18,13 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_a">1,à,á,â,ã,ä,å,æ</string> + <string name="alternates_for_a">1,à,â,æ,á,ä,ã,å,ā,ª</string> + <string name="alternates_for_e">3,é,è,ê,ë,ę,ė,ē</string> + <string name="alternates_for_i">8,î,ï,ì,í,į,ī</string> + <string name="alternates_for_o">9,ô,œ,ö,ò,ó,õ,ø,ō,º</string> + <string name="alternates_for_u">7,û,ù,ü,ú,ū</string> + <string name="alternates_for_c">ç,ć,č</string> + <string name="alternates_for_y">6,ÿ</string> <string name="alternates_for_q"></string> <string name="alternates_for_w"></string> <string name="alternates_for_z">2</string> diff --git a/java/res/xml-fr-rCA-xlarge/kbd_qwerty.xml b/java/res/values-hu/donottranslate-altchars.xml index 92d92f0e6..ae28cc5b8 100644 --- a/java/res/xml-fr-rCA-xlarge/kbd_qwerty.xml +++ b/java/res/values-hu/donottranslate-altchars.xml @@ -2,7 +2,7 @@ <!-- /* ** -** Copyright 2008, 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. @@ -17,18 +17,12 @@ ** limitations under the License. */ --> - -<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_qwerty_rows" /> -</Keyboard> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="alternates_for_a">á,à,â,ä,æ,ã,å,ā</string> + <string name="alternates_for_e">3,é,è,ê,ë,ę,ė,ē</string> + <string name="alternates_for_i">8,í,î,ï,ì,į,ī</string> + <string name="alternates_for_o">9,ó,ö,ő,ô,ò,õ,œ,ø,ō</string> + <string name="alternates_for_u">7,ú,ü,ű,û,ù,ū</string> + <string name="alternates_for_y"></string> + <string name="alternates_for_z">6</string> +</resources> diff --git a/java/res/values-it/donottranslate-altchars.xml b/java/res/values-it/donottranslate-altchars.xml index 0e4a285f1..1131d4852 100644 --- a/java/res/values-it/donottranslate-altchars.xml +++ b/java/res/values-it/donottranslate-altchars.xml @@ -18,8 +18,9 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_a">à,á</string> - <string name="alternates_for_e">3,è,é</string> - <string name="alternates_for_o">ò,ó,9</string> - <string name="alternates_for_s">§</string> + <string name="alternates_for_a">à,á,â,ä,æ,ã,å,ā,ª</string> + <string name="alternates_for_e">3,è,é,ê,ë,ę,ė,ē</string> + <string name="alternates_for_i">8,ì,í,î,ï,į,ī</string> + <string name="alternates_for_o">9,ò,ó,ô,ö,õ,œ,ø,ō,º</string> + <string name="alternates_for_u">7,ù,ú,û,ü,ū</string> </resources> diff --git a/java/res/values-lt/donottranslate-altchars.xml b/java/res/values-lt/donottranslate-altchars.xml new file mode 100644 index 000000000..4aba93a3a --- /dev/null +++ b/java/res/values-lt/donottranslate-altchars.xml @@ -0,0 +1,28 @@ +<?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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="alternates_for_a">ą,à,á,â,ä,æ,ã,å,ā</string> + <string name="alternates_for_e">3,ė,ę,è,é,ê,ë,ē</string> + <string name="alternates_for_i">8,į,î,ï,ì,í,ī</string> + <string name="alternates_for_u">7,ų,ū,û,ü,ù,ú</string> + <string name="alternates_for_s">š,ß,ś</string> + <string name="alternates_for_c">č,ç,ć</string> + <string name="alternates_for_z">ž,ź,ż</string> +</resources> diff --git a/java/res/values-lv/donottranslate-altchars.xml b/java/res/values-lv/donottranslate-altchars.xml new file mode 100644 index 000000000..05d9bc894 --- /dev/null +++ b/java/res/values-lv/donottranslate-altchars.xml @@ -0,0 +1,33 @@ +<?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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="alternates_for_a">ā,à,á,â,ä,æ,ã,å</string> + <string name="alternates_for_e">3,ē,è,é,ê,ë,ę,ė</string> + <string name="alternates_for_i">8,ī,î,ï,ì,í,į</string> + <string name="alternates_for_u">7,ū,û,ü,ù,ú</string> + <string name="alternates_for_s">š,ß,ś</string> + <string name="alternates_for_n">ņ,ñ,ń</string> + <string name="alternates_for_c">č,ç,ć</string> + <string name="alternates_for_r">4,ŗ</string> + <string name="alternates_for_z">ž,ź,ż</string> + <string name="alternates_for_k">ķ</string> + <string name="alternates_for_l">ļ,ł</string> + <string name="alternates_for_g">ģ</string> +</resources> diff --git a/java/res/values-nb/donottranslate-altchars.xml b/java/res/values-nb/donottranslate-altchars.xml index c65dea9fb..798e51c9a 100644 --- a/java/res/values-nb/donottranslate-altchars.xml +++ b/java/res/values-nb/donottranslate-altchars.xml @@ -18,20 +18,10 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_a">ä,á,à,â,ą,ã</string> - <string name="alternates_for_e">3,é,è,ê,ë,ę,€</string> - <string name="alternates_for_i">í,ì,î,ï,8</string> - <string name="alternates_for_o">ö,ó,ò,ô,õ,9</string> - <string name="alternates_for_u">ü,ú,ù,û,ū,7</string> - <string name="alternates_for_s">ś,š,ş,ß</string> - <string name="alternates_for_n">ń,ñ,ň</string> - <string name="alternates_for_c">ç,ć,č</string> - <string name="alternates_for_d">ð,ď</string> - <string name="alternates_for_r">ř,4</string> - <string name="alternates_for_t">ť,þ,5</string> - <string name="alternates_for_z">ź,ž,ż</string> - <string name="alternates_for_l">ł</string> - <string name="alternates_for_v">w</string> + <string name="alternates_for_a">à,ä,á,â,ã,ā</string> + <string name="alternates_for_e">3,é,è,ê,ë,ę,ė,ē</string> + <string name="alternates_for_o">9,ô,ò,ó,ö,õ,œ,ō</string> + <string name="alternates_for_u">7,ü,û,ù,ú,ū</string> <string name="keylabel_for_scandinavia_row2_10">ø</string> <string name="keylabel_for_scandinavia_row2_11">æ</string> <string name="alternates_for_scandinavia_row2_10">ö</string> diff --git a/java/res/values-nl/donottranslate-altchars.xml b/java/res/values-nl/donottranslate-altchars.xml new file mode 100644 index 000000000..e26a74967 --- /dev/null +++ b/java/res/values-nl/donottranslate-altchars.xml @@ -0,0 +1,27 @@ +<?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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="alternates_for_a">á,ä,â,à,æ,ã,å,ā</string> + <string name="alternates_for_e">3,é,ë,ê,è,ę,ė,ē</string> + <string name="alternates_for_i">8,í,ï,ì,î,į,ī</string> + <string name="alternates_for_o">9,ó,ö,ô,ò,õ,œ,ø,ō</string> + <string name="alternates_for_u">7,ú,ü,û,ù,ū</string> + <string name="alternates_for_n">ñ,ń</string> +</resources> diff --git a/java/res/values-pl/donottranslate-altchars.xml b/java/res/values-pl/donottranslate-altchars.xml index df8c52b47..971d73bc5 100644 --- a/java/res/values-pl/donottranslate-altchars.xml +++ b/java/res/values-pl/donottranslate-altchars.xml @@ -18,12 +18,12 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_a">ą</string> - <string name="alternates_for_e">ę,3</string> - <string name="alternates_for_o">ó,9</string> - <string name="alternates_for_s">ś</string> - <string name="alternates_for_n">ń</string> - <string name="alternates_for_c">ć</string> - <string name="alternates_for_z">ź,ż</string> + <string name="alternates_for_a">ą,á,à,â,ä,æ,ã,å,ā</string> + <string name="alternates_for_e">3,ę,è,é,ê,ë,ė,ē</string> + <string name="alternates_for_o">9,ó,ö,ô,ò,õ,œ,ø,ō</string> + <string name="alternates_for_s">ś,ß,š</string> + <string name="alternates_for_n">ń,ñ</string> + <string name="alternates_for_c">ć,ç,č</string> + <string name="alternates_for_z">ż,ź,ž</string> <string name="alternates_for_l">ł</string> </resources> diff --git a/java/res/values-pt/donottranslate-altchars.xml b/java/res/values-pt/donottranslate-altchars.xml new file mode 100644 index 000000000..a39976151 --- /dev/null +++ b/java/res/values-pt/donottranslate-altchars.xml @@ -0,0 +1,27 @@ +<?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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="alternates_for_a">á,ã,à,â,ä,å,æ,ª</string> + <string name="alternates_for_e">3,é,ê,è,ę,ė,ē,ë</string> + <string name="alternates_for_i">8,í,î,ì,ï,į,ī</string> + <string name="alternates_for_o">9,ó,õ,ô,ò,ö,œ,ø,ō,º</string> + <string name="alternates_for_u">7,ú,ü,ù,û,ū</string> + <string name="alternates_for_c">ç,č,ć</string> +</resources> diff --git a/java/res/values-rm/donottranslate-altchars.xml b/java/res/values-rm/donottranslate-altchars.xml index b44c3c005..0a5d2aad1 100644 --- a/java/res/values-rm/donottranslate-altchars.xml +++ b/java/res/values-rm/donottranslate-altchars.xml @@ -18,5 +18,5 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_o">ò,ó,ö,ô,õ,œ,ø,9</string> + <string name="alternates_for_o">9,ò,ó,ö,ô,õ,œ,ø</string> </resources> diff --git a/java/res/values-ro/donottranslate-altchars.xml b/java/res/values-ro/donottranslate-altchars.xml new file mode 100644 index 000000000..728ead472 --- /dev/null +++ b/java/res/values-ro/donottranslate-altchars.xml @@ -0,0 +1,25 @@ +<?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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="alternates_for_a">ă,â,à,á,ä,æ,ã,å,ā</string> + <string name="alternates_for_i">8,î,ï,ì,í,į,ī</string> + <string name="alternates_for_s">ș,ß,ś,š</string> + <string name="alternates_for_t">5,ț</string> +</resources> diff --git a/java/res/values-ru/donottranslate-altchars.xml b/java/res/values-ru/donottranslate-altchars.xml index c4f9d66d3..2da8b8469 100644 --- a/java/res/values-ru/donottranslate-altchars.xml +++ b/java/res/values-ru/donottranslate-altchars.xml @@ -18,6 +18,6 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_cyrillic_e">ё5</string> + <string name="alternates_for_cyrillic_e">5,ё</string> <string name="alternates_for_cyrillic_soft_sign">ъ</string> </resources> diff --git a/java/res/values-sk/donottranslate-altchars.xml b/java/res/values-sk/donottranslate-altchars.xml new file mode 100644 index 000000000..6d9836e9c --- /dev/null +++ b/java/res/values-sk/donottranslate-altchars.xml @@ -0,0 +1,35 @@ +<?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. +*/ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="alternates_for_a">ä,á,à,â,æ,ã,å,ā</string> + <string name="alternates_for_e">3,é,ě,è,ê,ë,ę,ė,ē</string> + <string name="alternates_for_i">8,í,î,ï,ì,į,ī</string> + <string name="alternates_for_o">9,ô,ó,ö,ò,õ,œ,ø,ō</string> + <string name="alternates_for_u">7,ú,ú,û,ü,ù,ū</string> + <string name="alternates_for_s">š,ß,ś</string> + <string name="alternates_for_n">ň,ñ,ń</string> + <string name="alternates_for_c">č,ç,ć</string> + <string name="alternates_for_y">6,ý,ÿ</string> + <string name="alternates_for_d">ď</string> + <string name="alternates_for_r">4,ŕ,ř</string> + <string name="alternates_for_t">5,ť</string> + <string name="alternates_for_z">ž,ź,ż</string> + <string name="alternates_for_l">ľ,ĺ,ł</string> +</resources> diff --git a/java/res/values-sv/donottranslate-altchars.xml b/java/res/values-sv/donottranslate-altchars.xml index e156de896..d03ae1a6c 100644 --- a/java/res/values-sv/donottranslate-altchars.xml +++ b/java/res/values-sv/donottranslate-altchars.xml @@ -18,23 +18,12 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_a">á,à,â,ą,ã</string> - <string name="alternates_for_e">3,é,è,ê,ë,ę,€</string> - <string name="alternates_for_i">í,ì,î,ï,8</string> - <string name="alternates_for_o">ó,ò,ô,õ,9</string> - <string name="alternates_for_u">ú,ù,û,ū,7</string> - <string name="alternates_for_s">ś,š,ş,ß</string> - <string name="alternates_for_n">ń,ñ,ň</string> - <string name="alternates_for_c">ç,ć,č</string> - <string name="alternates_for_y">ý,ÿ,ü,6</string> - <string name="alternates_for_d">ð,ď</string> - <string name="alternates_for_r">ř,4</string> - <string name="alternates_for_t">ť,þ,5</string> - <string name="alternates_for_z">ź,ž,ż</string> - <string name="alternates_for_l">ł</string> - <string name="alternates_for_v">w</string> + <string name="alternates_for_e">3,é,è,ê,ë,ę</string> + <string name="alternates_for_o">9,œ,ô,ò,ó,õ,ō</string> + <string name="alternates_for_u">7,ü,û,ù,ú,ū</string> + <string name="alternates_for_s">ß,ś,š</string> <string name="keylabel_for_scandinavia_row2_10">ö</string> <string name="keylabel_for_scandinavia_row2_11">ä</string> - <string name="alternates_for_scandinavia_row2_10">ø,œ</string> + <string name="alternates_for_scandinavia_row2_10">ø</string> <string name="alternates_for_scandinavia_row2_11">æ</string> </resources> diff --git a/java/res/values-tr/donottranslate-altchars.xml b/java/res/values-tr/donottranslate-altchars.xml index 5e98cc30e..1b83b65c8 100644 --- a/java/res/values-tr/donottranslate-altchars.xml +++ b/java/res/values-tr/donottranslate-altchars.xml @@ -18,8 +18,11 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_o">ö,ò,ó,ô,õ,œ,ø,9</string> - <string name="alternates_for_u">ü,ù,ú,û,7</string> - <string name="alternates_for_s">ş,§,ß</string> + <string name="alternates_for_a">â</string> + <string name="alternates_for_i">8,ı,î,ï,ì,í,į,ī</string> + <string name="alternates_for_o">9,ö,ô,œ,ò,ó,õ,ø,ō</string> + <string name="alternates_for_u">7,ü,û,ù,ú,ū</string> + <string name="alternates_for_s">ş,ß,ś,š</string> <string name="alternates_for_g">ğ</string> + <string name="alternates_for_c">ç,ć,č</string> </resources> diff --git a/java/res/values-xlarge/config.xml b/java/res/values-xlarge/config.xml index 004b39b92..f075b1b50 100644 --- a/java/res/values-xlarge/config.xml +++ b/java/res/values-xlarge/config.xml @@ -32,11 +32,14 @@ <bool name="config_digit_popup_characters_enabled">false</bool> <!-- Whether or not Popup on key press is enabled by default --> <bool name="config_default_popup_preview">false</bool> + <bool name="config_default_sound_enabled">true</bool> <bool name="config_use_spacebar_language_switcher">false</bool> + <!-- Showing mini keyboard, just above the touched point if true, aligned to the key if false --> + <bool name="config_show_mini_keyboard_at_touched_point">true</bool> <!-- The language is never displayed if == 0, always displayed if < 0 --> <integer name="config_delay_before_fadeout_language_on_spacebar">1200</integer> <!-- This configuration is the index of the array {@link KeyboardSwitcher.KEYBOARD_THEMES}. --> <string name="config_default_keyboard_theme_id" translatable="false">5</string> <string name="config_text_size_of_language_on_spacebar" translatable="false">medium</string> - <integer name="config_max_popup_keyboard_column">9</integer> + <integer name="config_max_popup_keyboard_column">5</integer> </resources> diff --git a/java/res/values/config.xml b/java/res/values/config.xml index 6a1b27a05..bf42589ea 100644 --- a/java/res/values/config.xml +++ b/java/res/values/config.xml @@ -20,7 +20,6 @@ <resources> <bool name="config_swipeDisambiguation">true</bool> - <bool name="default_recorrection_enabled">true</bool> <bool name="config_long_press_comma_for_settings_enabled">true</bool> <bool name="config_enable_show_settings_key_option">true</bool> <bool name="config_enable_show_subtype_settings">true</bool> @@ -39,7 +38,11 @@ <!-- Default values for whether quick fixes and bigram suggestions are activated --> <bool name="config_default_quick_fixes">true</bool> <bool name="config_default_bigram_suggestions">true</bool> + <bool name="config_default_recorrection_enabled">true</bool> + <bool name="config_default_sound_enabled">false</bool> <bool name="config_use_spacebar_language_switcher">true</bool> + <!-- Showing mini keyboard, just above the touched point if true, aligned to the key if false --> + <bool name="config_show_mini_keyboard_at_touched_point">false</bool> <!-- The language is never displayed if == 0, always displayed if < 0 --> <integer name="config_delay_before_fadeout_language_on_spacebar">-1</integer> <integer name="config_duration_of_fadeout_language_on_spacebar">50</integer> @@ -61,7 +64,7 @@ <!-- This configuration is the index of the array {@link KeyboardSwitcher.KEYBOARD_THEMES}. --> <string name="config_default_keyboard_theme_id" translatable="false">4</string> <string name="config_text_size_of_language_on_spacebar" translatable="false">small</string> - <integer name="config_max_popup_keyboard_column">9</integer> + <integer name="config_max_popup_keyboard_column">10</integer> <!-- Whether or not auto-correction should be enabled by default --> <bool name="enable_autocorrect">true</bool> <string-array name="auto_correction_threshold_values" translatable="false"> diff --git a/java/res/values/donottranslate-altchars.xml b/java/res/values/donottranslate-altchars.xml index 85e06f23b..4b1a6ae6d 100644 --- a/java/res/values/donottranslate-altchars.xml +++ b/java/res/values/donottranslate-altchars.xml @@ -18,21 +18,22 @@ */ --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="alternates_for_a">à,á,â,ã,ä,å,æ</string> - <string name="alternates_for_e">3,è,é,ê,ë</string> - <string name="alternates_for_i">ì,í,î,ï,8</string> - <string name="alternates_for_o">ò,ó,ô,õ,ö,œ,ø,9</string> - <string name="alternates_for_u">ù,ú,û,ü,7</string> - <string name="alternates_for_s">§,ß</string> - <string name="alternates_for_n">ñ</string> - <string name="alternates_for_c">ç</string> - <string name="alternates_for_y">ý,ÿ,6</string> + <string name="alternates_for_a"></string> + <string name="alternates_for_e">3</string> + <string name="alternates_for_i">8</string> + <string name="alternates_for_o">9</string> + <string name="alternates_for_u">7</string> + <string name="alternates_for_s"></string> + <string name="alternates_for_n"></string> + <string name="alternates_for_c"></string> + <string name="alternates_for_y">6</string> <string name="alternates_for_q">1</string> <string name="alternates_for_w">2</string> <string name="alternates_for_d"></string> <string name="alternates_for_r">4</string> <string name="alternates_for_t">5</string> <string name="alternates_for_z"></string> + <string name="alternates_for_k"></string> <string name="alternates_for_l"></string> <string name="alternates_for_g"></string> <string name="alternates_for_p">0</string> diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml index 7b8087a06..72601c37f 100644 --- a/java/res/values/strings.xml +++ b/java/res/values/strings.xml @@ -69,12 +69,12 @@ <!-- Option to enable auto correction [CHAR LIMIT=20]--> <string name="auto_correction">Auto correction</string> <!-- Description for auto correction [CHAR LIMIT=35] --> - <string name="auto_correction_summary">Spacebar and punctuation automatically insert highlighted word</string> + <string name="auto_correction_summary">Spacebar and punctuation automatically correct mistyped words</string> <!-- Option to disable auto correction. [CHAR LIMIT=20] --> <string name="auto_correction_threshold_mode_off">Off</string> - <!-- Option to use modest auto correction. [CHAR LIMIT=20] --> + <!-- Option to suggest auto correction candidates modestly. Auto-corrects only to a word which has small edit distance from typed word. [CHAR LIMIT=20] --> <string name="auto_correction_threshold_mode_modest">Modest</string> - <!-- Option to use aggressive auto correction. [CHAR LIMIT=20] --> + <!-- Option to suggest auto correction candidates aggressively. Auto-corrects to a word which has even large edit distance from typed word. [CHAR LIMIT=20] --> <string name="auto_correction_threshold_mode_aggeressive">Aggressive</string> <!-- Option to enable bigram correction --> @@ -247,29 +247,26 @@ <string name="subtype_mode_sr_keyboard">Serbian Keyboard</string> <!-- Description for Swedish keyboard subtype [CHAR LIMIT=35] --> <string name="subtype_mode_sv_keyboard">Swedish Keyboard</string> - + <!-- Description for Afrikaans voice input subtype [CHAR LIMIT=35] --> + <string name="subtype_mode_af_voice">Afrikaans Voice</string> <!-- Description for Czech voice input subtype [CHAR LIMIT=35] --> <string name="subtype_mode_cs_voice">Czech Voice</string> <!-- Description for German voice input subtype [CHAR LIMIT=35] --> <string name="subtype_mode_de_voice">German Voice</string> - <!-- Description for English (Australia) voice input subtype [CHAR LIMIT=35] --> - <string name="subtype_mode_en_AU_voice">English (Australia) Voice</string> - <!-- Description for English (United Kingdom) voice input subtype [CHAR LIMIT=35] --> - <string name="subtype_mode_en_GB_voice">English (UK) Voice</string> - <!-- Description for English (India) voice input subtype [CHAR LIMIT=35] --> - <string name="subtype_mode_en_IN_voice">English (India) Voice</string> - <!-- Description for English (New Zealand) voice input subtype [CHAR LIMIT=35] --> - <string name="subtype_mode_en_NZ_voice">English (New Zealand) Voice</string> - <!-- Description for English (United States) voice input subtype [CHAR LIMIT=35] --> - <string name="subtype_mode_en_US_voice">English (US) Voice</string> + <!-- Description for English voice input subtype [CHAR LIMIT=35] --> + <string name="subtype_mode_en_voice">English Voice</string> <!-- Description for Spanish voice input subtype [CHAR LIMIT=35] --> <string name="subtype_mode_es_voice">Spanish Voice</string> <!-- Description for French voice input subtype [CHAR LIMIT=35] --> <string name="subtype_mode_fr_voice">French Voice</string> + <!-- Description for Italian voice input subtype [CHAR LIMIT=35] --> + <string name="subtype_mode_it_voice">Italian Voice</string> <!-- Description for Japanese voice input subtype [CHAR LIMIT=35] --> <string name="subtype_mode_ja_voice">Japanese Voice</string> <!-- Description for Korean voice input subtype [CHAR LIMIT=35] --> <string name="subtype_mode_ko_voice">Korean Voice</string> + <!-- Description for Dutch voice input subtype [CHAR LIMIT=35] --> + <string name="subtype_mode_nl_voice">Dutch Voice</string> <!-- Description for Polish voice input subtype [CHAR LIMIT=35] --> <string name="subtype_mode_pl_voice">Polish Voice</string> <!-- Description for Portuguese voice input subtype [CHAR LIMIT=35] --> @@ -278,10 +275,12 @@ <string name="subtype_mode_ru_voice">Russian Voice</string> <!-- Description for Turkish voice input subtype [CHAR LIMIT=35] --> <string name="subtype_mode_tr_voice">Turkish Voice</string> - <!-- Description for Chinese (China, Simplified) voice input subtype [CHAR LIMIT=35] --> - <string name="subtype_mode_zh_CN_voice">Chinese (China, Simplified) Voice</string> - <!-- Description for Chinese (Taiwan, Traditional) voice input subtype [CHAR LIMIT=35] --> - <string name="subtype_mode_zh_TW_voice">Chinese (Taiwan, Traditional) Voice</string> + <!-- Description for Chinese, Yue voice input subtype [CHAR LIMIT=35] --> + <string name="subtype_mode_yue_voice">Chinese, Yue Voice</string> + <!-- Description for Chinese, Mandarin voice input subtype [CHAR LIMIT=35] --> + <string name="subtype_mode_zh_voice">Chinese, Mandarin Voice</string> + <!-- Description for isiZulu voice input subtype [CHAR LIMIT=35] --> + <string name="subtype_mode_zu_voice">isiZulu Voice</string> <!-- Title of an option for usability study mode --> <string name="prefs_usability_study_mode">Usability Study Mode</string> diff --git a/java/res/xml-de-xlarge/kbd_qwerty.xml b/java/res/xml-cs/kbd_qwerty.xml index a23e4fbf0..010bdb3f7 100644 --- a/java/res/xml-de-xlarge/kbd_qwerty.xml +++ b/java/res/xml-cs/kbd_qwerty.xml @@ -2,7 +2,7 @@ <!-- /* ** -** Copyright 2008, 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. diff --git a/java/res/xml-da-xlarge/kbd_qwerty.xml b/java/res/xml-da-xlarge/kbd_qwerty.xml deleted file mode 100644 index aa868e453..000000000 --- a/java/res/xml-da-xlarge/kbd_qwerty.xml +++ /dev/null @@ -1,39 +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. -*/ ---> - -<!-- - Danish Keyboard Layout - - Just a copy of the Norwegian layout, with æ/ø switched. ---> - -<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: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_qwerty_rows_scandinavia" /> -</Keyboard> diff --git a/java/res/xml-da/kbd_qwerty.xml b/java/res/xml-da/kbd_qwerty.xml index dfca1cdd2..441b7cb17 100644 --- a/java/res/xml-da/kbd_qwerty.xml +++ b/java/res/xml-da/kbd_qwerty.xml @@ -18,18 +18,11 @@ */ --> -<!-- - Danish Keyboard Layout - - Just a copy of the Norwegian layout, with æ/ø switched. ---> - <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="9.09%p" latin:horizontalGap="@dimen/key_horizontal_gap" latin:verticalGap="@dimen/key_bottom_gap" latin:popupKeyboardTemplate="@xml/kbd_popup_template" diff --git a/java/res/xml-fr-xlarge/kbd_qwerty.xml b/java/res/xml-fi/kbd_qwerty.xml index 2d0b42baf..b0a7b3eb0 100644 --- a/java/res/xml-fr-xlarge/kbd_qwerty.xml +++ b/java/res/xml-fi/kbd_qwerty.xml @@ -2,7 +2,7 @@ <!-- /* ** -** Copyright 2008, 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. @@ -23,12 +23,11 @@ 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_azerty_rows" /> + latin:keyboardLayout="@xml/kbd_qwerty_rows_scandinavia" /> </Keyboard> diff --git a/java/res/xml-fr-rCH-xlarge/kbd_qwerty.xml b/java/res/xml-hu/kbd_qwerty.xml index a23e4fbf0..010bdb3f7 100644 --- a/java/res/xml-fr-rCH-xlarge/kbd_qwerty.xml +++ b/java/res/xml-hu/kbd_qwerty.xml @@ -2,7 +2,7 @@ <!-- /* ** -** Copyright 2008, 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. diff --git a/java/res/xml-nb-xlarge/kbd_qwerty.xml b/java/res/xml-nb-xlarge/kbd_qwerty.xml deleted file mode 100644 index 5dfdc4f56..000000000 --- a/java/res/xml-nb-xlarge/kbd_qwerty.xml +++ /dev/null @@ -1,39 +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. -*/ ---> - -<!-- - Norwegian Keyboard Layout - - Just a copy of the Swedish layout, with ä/æ and ö/ø switched. ---> - -<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: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_qwerty_rows_scandinavia" /> -</Keyboard> diff --git a/java/res/xml-nb/kbd_qwerty.xml b/java/res/xml-nb/kbd_qwerty.xml index 06f1b947a..441b7cb17 100644 --- a/java/res/xml-nb/kbd_qwerty.xml +++ b/java/res/xml-nb/kbd_qwerty.xml @@ -18,18 +18,11 @@ */ --> -<!-- - Norwegian Keyboard Layout - - Just a copy of the Swedish layout, with ä/æ and ö/ø switched. ---> - <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="9.09%p" latin:horizontalGap="@dimen/key_horizontal_gap" latin:verticalGap="@dimen/key_bottom_gap" latin:popupKeyboardTemplate="@xml/kbd_popup_template" diff --git a/java/res/xml-ru/kbd_qwerty.xml b/java/res/xml-ru/kbd_qwerty.xml index 08d7a4ac5..0eb311501 100644 --- a/java/res/xml-ru/kbd_qwerty.xml +++ b/java/res/xml-ru/kbd_qwerty.xml @@ -23,123 +23,11 @@ latin:keyboardHeight="@dimen/keyboardHeight" latin:maxKeyboardHeight="50%p" latin:rowHeight="25%p" - latin:keyWidth="9.091%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_key_styles" /> - <Row - latin:rowEdgeFlags="top" - > - <Key - latin:keyLabel="й" - latin:keyHintIcon="@drawable/keyboard_hint_1" - latin:popupCharacters="1" - latin:keyWidth="8.75%p" - latin:keyEdgeFlags="left" /> - <Key - latin:keyLabel="ц" - latin:keyHintIcon="@drawable/keyboard_hint_2" - latin:popupCharacters="2" /> - <Key - latin:keyLabel="у" - latin:keyHintIcon="@drawable/keyboard_hint_3" - latin:popupCharacters="3" /> - <Key - latin:keyLabel="к" - latin:keyHintIcon="@drawable/keyboard_hint_4" - latin:popupCharacters="4" /> - <Key - latin:keyLabel="е" - latin:keyHintIcon="@drawable/keyboard_hint_5" - latin:popupCharacters="@string/alternates_for_cyrillic_e" /> - <Key - latin:keyLabel="н" - latin:keyHintIcon="@drawable/keyboard_hint_6" - latin:popupCharacters="6" /> - <Key - latin:keyLabel="г" - latin:keyHintIcon="@drawable/keyboard_hint_7" - latin:popupCharacters="7" /> - <Key - latin:keyLabel="ш" - latin:keyHintIcon="@drawable/keyboard_hint_8" - latin:popupCharacters="8" /> - <Key - latin:keyLabel="щ" - latin:keyHintIcon="@drawable/keyboard_hint_9" - latin:popupCharacters="9" /> - <Key - latin:keyLabel="з" - latin:keyHintIcon="@drawable/keyboard_hint_0" - latin:popupCharacters="0" /> - <Key - latin:keyLabel="х" - latin:keyWidth="8.75%p" - latin:keyEdgeFlags="right" /> - </Row> - <Row> - <Key - latin:keyLabel="ф" - latin:keyWidth="8.75%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="э" - latin:keyWidth="8.75%p" - latin:keyEdgeFlags="right" /> - </Row> - <Row - latin:keyWidth="8.5%p" - > - <Key - latin:keyStyle="shiftKeyStyle" - latin:keyWidth="11.75%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="ь" - latin:popupCharacters="@string/alternates_for_cyrillic_soft_sign" /> - <Key - latin:keyLabel="б" /> - <Key - latin:keyLabel="ю" /> - <Key - latin:keyStyle="deleteKeyStyle" - latin:keyWidth="11.75%p" - latin:keyEdgeFlags="right" /> - </Row> - <include - latin:keyboardLayout="@xml/kbd_qwerty_row4" /> + latin:keyboardLayout="@xml/kbd_ru_rows" /> </Keyboard> diff --git a/java/res/xml-sr/kbd_qwerty.xml b/java/res/xml-sr/kbd_qwerty.xml index 0e5f5ff79..3995e4e27 100644 --- a/java/res/xml-sr/kbd_qwerty.xml +++ b/java/res/xml-sr/kbd_qwerty.xml @@ -18,124 +18,16 @@ */ --> -<!-- Serbian keyboard layout, based on the X11 layout for Serbian --> <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="9.09%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_key_styles" /> - <Row - latin:rowEdgeFlags="top" - > - <Key - latin:keyLabel="љ" - latin:keyHintIcon="@drawable/keyboard_hint_1" - latin:popupCharacters="1" - latin:keyEdgeFlags="left" /> - <Key - latin:keyLabel="њ" - latin:keyHintIcon="@drawable/keyboard_hint_2" - latin:popupCharacters="2" /> - <Key - latin:keyLabel="е" - latin:keyHintIcon="@drawable/keyboard_hint_3" - latin:popupCharacters="3" /> - <Key - latin:keyLabel="р" - latin:keyHintIcon="@drawable/keyboard_hint_4" - latin:popupCharacters="4" /> - <Key - latin:keyLabel="т" - latin:keyHintIcon="@drawable/keyboard_hint_5" - latin:popupCharacters="5" /> - <Key - latin:keyLabel="з" - latin:keyHintIcon="@drawable/keyboard_hint_6" - latin:popupCharacters="6" /> - <Key - latin:keyLabel="у" - latin:keyHintIcon="@drawable/keyboard_hint_7" - latin:popupCharacters="7" /> - <Key - latin:keyLabel="и" - latin:keyHintIcon="@drawable/keyboard_hint_8" - latin:popupCharacters="8" /> - <Key - latin:keyLabel="о" - latin:keyHintIcon="@drawable/keyboard_hint_9" - latin:popupCharacters="9" /> - <Key - latin:keyLabel="п" - latin:keyHintIcon="@drawable/keyboard_hint_0" - latin:popupCharacters="0" /> - <Key - latin:keyLabel="ш" - latin:keyEdgeFlags="right" /> - </Row> - <Row - latin:keyWidth="8.333%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="л" /> - <Key - latin:keyLabel="ч" /> - <Key - latin:keyLabel="ћ" /> - <Key - latin:keyLabel="ђ" - latin:keyEdgeFlags="right" /> - </Row> - <Row - latin:keyWidth="8.5%p" - > - <Key - latin:keyStyle="shiftKeyStyle" - latin:keyWidth="11.75%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:keyStyle="deleteKeyStyle" - latin:keyWidth="11.75%p" - latin:keyEdgeFlags="right" /> - </Row> - <include - latin:keyboardLayout="@xml/kbd_qwerty_row4" /> + latin:keyboardLayout="@xml/kbd_sr_rows" /> </Keyboard> diff --git a/java/res/xml-sv-xlarge/kbd_qwerty.xml b/java/res/xml-sv-xlarge/kbd_qwerty.xml deleted file mode 100644 index bbb38585e..000000000 --- a/java/res/xml-sv-xlarge/kbd_qwerty.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. -*/ ---> - -<!-- - Swedish Keyboard Layout - - Key positioning: Svensk standard SS 66 22 41 - Foreign letters: Svenska skrivregler (2:a uppl.) §302 - Local additions: €ß ---> - -<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: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_qwerty_rows_scandinavia" /> -</Keyboard> diff --git a/java/res/xml-sv/kbd_qwerty.xml b/java/res/xml-sv/kbd_qwerty.xml index 60d3b45f9..72bdc339e 100644 --- a/java/res/xml-sv/kbd_qwerty.xml +++ b/java/res/xml-sv/kbd_qwerty.xml @@ -18,20 +18,11 @@ */ --> -<!-- - Swedish Keyboard Layout - - Key positioning: Svensk standard SS 66 22 41 - Foreign letters: Svenska skrivregler (2:a uppl.) §302 - Local additions: €ß ---> - <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="9.09%p" latin:horizontalGap="@dimen/key_horizontal_gap" latin:verticalGap="@dimen/key_bottom_gap" latin:popupKeyboardTemplate="@xml/kbd_popup_template" diff --git a/java/res/xml-xlarge/kbd_azerty_rows.xml b/java/res/xml-xlarge/kbd_azerty_rows.xml index 616295065..564f77629 100644 --- a/java/res/xml-xlarge/kbd_azerty_rows.xml +++ b/java/res/xml-xlarge/kbd_azerty_rows.xml @@ -93,7 +93,8 @@ <Key latin:keyLabel="j" /> <Key - latin:keyLabel="k" /> + latin:keyLabel="k" + latin:popupCharacters="@string/alternates_for_k" /> <Key latin:keyLabel="l" latin:popupCharacters="@string/alternates_for_l" /> diff --git a/java/res/xml-xlarge/kbd_key_styles.xml b/java/res/xml-xlarge/kbd_key_styles.xml index 26659a2ad..d211e5e61 100644 --- a/java/res/xml-xlarge/kbd_key_styles.xml +++ b/java/res/xml-xlarge/kbd_key_styles.xml @@ -60,8 +60,8 @@ latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> <key-style latin:styleName="smileyKeyStyle" - latin:keyIcon="@drawable/sym_keyboard_smiley_holo" - latin:keyOutputText=";-) " + latin:keyLabel=":-)" + latin:keyOutputText=":-) " latin:keyHintIcon="@drawable/hint_popup_holo" latin:popupCharacters="@string/alternates_for_smiley" latin:maxPopupKeyboardColumn="5" /> @@ -114,8 +114,8 @@ latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> <key-style latin:styleName="smileyKeyStyle" - latin:keyLabel=";-)" - latin:keyOutputText=";-) " + latin:keyLabel=":-)" + latin:keyOutputText=":-) " latin:keyHintIcon="@drawable/hint_popup_holo" latin:popupCharacters="@string/alternates_for_smiley" latin:maxPopupKeyboardColumn="5" /> diff --git a/java/res/xml-xlarge/kbd_qwerty_row2.xml b/java/res/xml-xlarge/kbd_qwerty_row2.xml index 1b4393ab2..02bd0a6c9 100644 --- a/java/res/xml-xlarge/kbd_qwerty_row2.xml +++ b/java/res/xml-xlarge/kbd_qwerty_row2.xml @@ -48,7 +48,8 @@ <Key latin:keyLabel="j" /> <Key - latin:keyLabel="k" /> + latin:keyLabel="k" + latin:popupCharacters="@string/alternates_for_k" /> <Key latin:keyLabel="l" latin:popupCharacters="@string/alternates_for_l" /> diff --git a/java/res/xml-xlarge/kbd_qwerty_rows_scandinavia.xml b/java/res/xml-xlarge/kbd_qwerty_rows_scandinavia.xml index 8c583ba85..fb2034fb7 100644 --- a/java/res/xml-xlarge/kbd_qwerty_rows_scandinavia.xml +++ b/java/res/xml-xlarge/kbd_qwerty_rows_scandinavia.xml @@ -95,7 +95,8 @@ <Key latin:keyLabel="j" /> <Key - latin:keyLabel="k" /> + latin:keyLabel="k" + latin:popupCharacters="@string/alternates_for_k" /> <Key latin:keyLabel="l" latin:popupCharacters="@string/alternates_for_l" /> diff --git a/java/res/xml-ru-xlarge/kbd_qwerty.xml b/java/res/xml-xlarge/kbd_ru_rows.xml index b86002a31..008988a84 100644 --- a/java/res/xml-ru-xlarge/kbd_qwerty.xml +++ b/java/res/xml-xlarge/kbd_ru_rows.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,16 +18,8 @@ */ --> -<Keyboard +<merge 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="9.091%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_key_styles" /> @@ -145,4 +137,4 @@ </Row> <include latin:keyboardLayout="@xml/kbd_qwerty_row4" /> -</Keyboard> +</merge> diff --git a/java/res/xml-sr-xlarge/kbd_qwerty.xml b/java/res/xml-xlarge/kbd_sr_rows.xml index 48764e7c7..ce9e20817 100644 --- a/java/res/xml-sr-xlarge/kbd_qwerty.xml +++ b/java/res/xml-xlarge/kbd_sr_rows.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,17 +18,8 @@ */ --> -<!-- Serbian keyboard layout, based on the X11 layout for Serbian --> -<Keyboard +<merge 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="9.09%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_key_styles" /> @@ -155,4 +146,4 @@ </Row> <include latin:keyboardLayout="@xml/kbd_qwerty_row4" /> -</Keyboard> +</merge> diff --git a/java/res/xml/kbd_azerty_rows.xml b/java/res/xml/kbd_azerty_rows.xml index 71109ab67..9eeb22ecb 100644 --- a/java/res/xml/kbd_azerty_rows.xml +++ b/java/res/xml/kbd_azerty_rows.xml @@ -93,7 +93,8 @@ <Key latin:keyLabel="j" /> <Key - latin:keyLabel="k" /> + latin:keyLabel="k" + latin:popupCharacters="@string/alternates_for_k" /> <Key latin:keyLabel="l" latin:popupCharacters="@string/alternates_for_l" /> diff --git a/java/res/xml/kbd_qwerty_row2.xml b/java/res/xml/kbd_qwerty_row2.xml index dd0035d93..9ed4553c4 100644 --- a/java/res/xml/kbd_qwerty_row2.xml +++ b/java/res/xml/kbd_qwerty_row2.xml @@ -46,7 +46,8 @@ <Key latin:keyLabel="j" /> <Key - latin:keyLabel="k" /> + latin:keyLabel="k" + latin:popupCharacters="@string/alternates_for_k" /> <Key latin:keyLabel="l" latin:popupCharacters="@string/alternates_for_l" diff --git a/java/res/xml/kbd_qwerty_rows_scandinavia.xml b/java/res/xml/kbd_qwerty_rows_scandinavia.xml index 490652663..1aae5a0a8 100644 --- a/java/res/xml/kbd_qwerty_rows_scandinavia.xml +++ b/java/res/xml/kbd_qwerty_rows_scandinavia.xml @@ -98,7 +98,8 @@ <Key latin:keyLabel="j" /> <Key - latin:keyLabel="k" /> + latin:keyLabel="k" + latin:popupCharacters="@string/alternates_for_k" /> <Key latin:keyLabel="l" latin:popupCharacters="@string/alternates_for_l" /> diff --git a/java/res/xml/kbd_ru_rows.xml b/java/res/xml/kbd_ru_rows.xml new file mode 100644 index 000000000..fa2af3be0 --- /dev/null +++ b/java/res/xml/kbd_ru_rows.xml @@ -0,0 +1,140 @@ +<?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="9.091%p" + latin:rowEdgeFlags="top" + > + <Key + latin:keyLabel="й" + latin:keyHintIcon="@drawable/keyboard_hint_1" + latin:popupCharacters="1" + latin:keyWidth="8.75%p" + latin:keyEdgeFlags="left" /> + <Key + latin:keyLabel="ц" + latin:keyHintIcon="@drawable/keyboard_hint_2" + latin:popupCharacters="2" /> + <Key + latin:keyLabel="у" + latin:keyHintIcon="@drawable/keyboard_hint_3" + latin:popupCharacters="3" /> + <Key + latin:keyLabel="к" + latin:keyHintIcon="@drawable/keyboard_hint_4" + latin:popupCharacters="4" /> + <Key + latin:keyLabel="е" + latin:keyHintIcon="@drawable/keyboard_hint_5" + latin:popupCharacters="@string/alternates_for_cyrillic_e" /> + <Key + latin:keyLabel="н" + latin:keyHintIcon="@drawable/keyboard_hint_6" + latin:popupCharacters="6" /> + <Key + latin:keyLabel="г" + latin:keyHintIcon="@drawable/keyboard_hint_7" + latin:popupCharacters="7" /> + <Key + latin:keyLabel="ш" + latin:keyHintIcon="@drawable/keyboard_hint_8" + latin:popupCharacters="8" /> + <Key + latin:keyLabel="щ" + latin:keyHintIcon="@drawable/keyboard_hint_9" + latin:popupCharacters="9" /> + <Key + latin:keyLabel="з" + latin:keyHintIcon="@drawable/keyboard_hint_0" + latin:popupCharacters="0" /> + <Key + latin:keyLabel="х" + latin:keyWidth="8.75%p" + latin:keyEdgeFlags="right" /> + </Row> + <Row + latin:keyWidth="9.091%p" + > + <Key + latin:keyLabel="ф" + latin:keyWidth="8.75%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="э" + latin:keyWidth="8.75%p" + latin:keyEdgeFlags="right" /> + </Row> + <Row + latin:keyWidth="8.5%p" + > + <Key + latin:keyStyle="shiftKeyStyle" + latin:keyWidth="11.75%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="ь" + latin:popupCharacters="@string/alternates_for_cyrillic_soft_sign" /> + <Key + latin:keyLabel="б" /> + <Key + latin:keyLabel="ю" /> + <Key + latin:keyStyle="deleteKeyStyle" + latin:keyWidth="11.75%p" + latin:keyEdgeFlags="right" /> + </Row> + <include + latin:keyboardLayout="@xml/kbd_qwerty_row4" /> +</merge> diff --git a/java/res/xml/kbd_sr_rows.xml b/java/res/xml/kbd_sr_rows.xml new file mode 100644 index 000000000..4a5ed1195 --- /dev/null +++ b/java/res/xml/kbd_sr_rows.xml @@ -0,0 +1,133 @@ +<?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="9.09%p" + latin:rowEdgeFlags="top" + > + <Key + latin:keyLabel="љ" + latin:keyHintIcon="@drawable/keyboard_hint_1" + latin:popupCharacters="1" + latin:keyEdgeFlags="left" /> + <Key + latin:keyLabel="њ" + latin:keyHintIcon="@drawable/keyboard_hint_2" + latin:popupCharacters="2" /> + <Key + latin:keyLabel="е" + latin:keyHintIcon="@drawable/keyboard_hint_3" + latin:popupCharacters="3" /> + <Key + latin:keyLabel="р" + latin:keyHintIcon="@drawable/keyboard_hint_4" + latin:popupCharacters="4" /> + <Key + latin:keyLabel="т" + latin:keyHintIcon="@drawable/keyboard_hint_5" + latin:popupCharacters="5" /> + <Key + latin:keyLabel="з" + latin:keyHintIcon="@drawable/keyboard_hint_6" + latin:popupCharacters="6" /> + <Key + latin:keyLabel="у" + latin:keyHintIcon="@drawable/keyboard_hint_7" + latin:popupCharacters="7" /> + <Key + latin:keyLabel="и" + latin:keyHintIcon="@drawable/keyboard_hint_8" + latin:popupCharacters="8" /> + <Key + latin:keyLabel="о" + latin:keyHintIcon="@drawable/keyboard_hint_9" + latin:popupCharacters="9" /> + <Key + latin:keyLabel="п" + latin:keyHintIcon="@drawable/keyboard_hint_0" + latin:popupCharacters="0" /> + <Key + latin:keyLabel="ш" + latin:keyEdgeFlags="right" /> + </Row> + <Row + latin:keyWidth="8.333%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="л" /> + <Key + latin:keyLabel="ч" /> + <Key + latin:keyLabel="ћ" /> + <Key + latin:keyLabel="ђ" + latin:keyEdgeFlags="right" /> + </Row> + <Row + latin:keyWidth="8.5%p" + > + <Key + latin:keyStyle="shiftKeyStyle" + latin:keyWidth="11.75%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:keyStyle="deleteKeyStyle" + latin:keyWidth="11.75%p" + latin:keyEdgeFlags="right" /> + </Row> + <include + latin:keyboardLayout="@xml/kbd_qwerty_row4" /> +</merge> diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml index e882320a3..06fa02303 100644 --- a/java/res/xml/prefs.xml +++ b/java/res/xml/prefs.xml @@ -38,6 +38,7 @@ <CheckBoxPreference android:key="sound_on" android:title="@string/sound_on_keypress" + android:defaultValue="@bool/config_default_sound_enabled" android:persistent="true" /> @@ -53,7 +54,7 @@ android:title="@string/prefs_enable_recorrection" android:summary="@string/prefs_enable_recorrection_summary" android:persistent="true" - android:defaultValue="@bool/default_recorrection_enabled" + android:defaultValue="@bool/config_default_recorrection_enabled" /> <ListPreference diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index 35bafea80..23886ad97 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -95,6 +95,8 @@ public class Key { public boolean mPressed; /** If this is a sticky key, is it on? */ public boolean mOn; + /** Key is enabled or not. */ + public boolean mEnabled = true; private final static int[] KEY_STATE_NORMAL_ON = { android.R.attr.state_checkable, @@ -385,8 +387,9 @@ public class Key { * @see android.graphics.drawable.StateListDrawable#setState(int[]) */ public int[] getCurrentDrawableState() { + final boolean pressed = mEnabled && mPressed; if (isFunctionalKey()) { - if (mPressed) { + if (pressed) { return KEY_STATE_FUNCTIONAL_PRESSED; } else { return KEY_STATE_FUNCTIONAL_NORMAL; @@ -396,20 +399,20 @@ public class Key { int[] states = KEY_STATE_NORMAL; if (mOn) { - if (mPressed) { + if (pressed) { states = KEY_STATE_PRESSED_ON; } else { states = KEY_STATE_NORMAL_ON; } } else { if (mSticky) { - if (mPressed) { + if (pressed) { states = KEY_STATE_PRESSED_OFF; } else { states = KEY_STATE_NORMAL_OFF; } } else { - if (mPressed) { + if (pressed) { states = KEY_STATE_PRESSED; } } diff --git a/java/src/com/android/inputmethod/keyboard/KeyDetector.java b/java/src/com/android/inputmethod/keyboard/KeyDetector.java index e7a9d8513..3979fb53e 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyDetector.java +++ b/java/src/com/android/inputmethod/keyboard/KeyDetector.java @@ -17,6 +17,7 @@ package com.android.inputmethod.keyboard; import java.util.Arrays; +import java.util.HashMap; import java.util.List; public abstract class KeyDetector { @@ -108,4 +109,31 @@ public abstract class KeyDetector { * @return The nearest key index */ abstract public int getKeyIndexAndNearbyCodes(int x, int y, int[] allKeys); + + /** + * Compute the most common key width in order to use it as proximity key detection threshold. + * + * @param keyboard The keyboard to compute the most common key width + * @return The most common key width in the keyboard + */ + public static int getMostCommonKeyWidth(Keyboard keyboard) { + if (keyboard == null) return 0; + final List<Key> keys = keyboard.getKeys(); + if (keys == null || keys.size() == 0) return 0; + final HashMap<Integer, Integer> histogram = new HashMap<Integer, Integer>(); + int maxCount = 0; + int mostCommonWidth = 0; + for (Key key : keys) { + final Integer width = key.mWidth + key.mGap; + Integer count = histogram.get(width); + if (count == null) + count = 0; + histogram.put(width, ++count); + if (count > maxCount) { + maxCount = count; + mostCommonWidth = width; + } + } + return mostCommonWidth; + } } diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java index 863421f18..3a0bf53ab 100644 --- a/java/src/com/android/inputmethod/keyboard/Keyboard.java +++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java @@ -107,11 +107,6 @@ public class Keyboard { private final HashSet<Key> mShiftLockEnabled = new HashSet<Key>(); private final KeyboardShiftState mShiftState = new KeyboardShiftState(); - /** Space key and its icons */ - protected Key mSpaceKey; - protected Drawable mSpaceIcon; - protected Drawable mSpacePreviewIcon; - /** Total height of the keyboard, including the padding and keys */ private int mTotalHeight; @@ -350,12 +345,6 @@ public class Keyboard { return mId != null && mId.isNumberKeyboard(); } - public void setSpaceKey(Key space) { - mSpaceKey = space; - mSpaceIcon = space.getIcon(); - mSpacePreviewIcon = space.getPreviewIcon(); - } - private void computeNearestNeighbors() { // Round-up so we don't have any pixels outside the grid mCellWidth = (getMinWidth() + GRID_WIDTH - 1) / GRID_WIDTH; diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java index c41d57075..e8324e5fd 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java @@ -286,8 +286,6 @@ public class KeyboardParser { keys.add(key); if (key.mCode == Keyboard.CODE_SHIFT) mKeyboard.getShiftKeys().add(key); - if (key.mCode == Keyboard.CODE_SPACE) - mKeyboard.setSpaceKey(key); endKey(key); } } diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index 558de66a4..2648ff3d4 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -17,11 +17,11 @@ package com.android.inputmethod.keyboard; import com.android.inputmethod.latin.LatinIME; -import com.android.inputmethod.latin.Settings; -import com.android.inputmethod.latin.Utils; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.Settings; import com.android.inputmethod.latin.SubtypeSwitcher; +import com.android.inputmethod.latin.Utils; import android.content.Context; import android.content.SharedPreferences; @@ -222,8 +222,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha keyboard.setShifted(false); // If the cached keyboard had been switched to another keyboard while the language was // displayed on its spacebar, it might have had arbitrary text fade factor. In such case, - // we should reset the text fade factor. + // we should reset the text fade factor. It is also applicable to shortcut key. keyboard.setSpacebarTextFadeFactor(0.0f, null); + keyboard.updateShortcutKey(mSubtypeSwitcher.isShortcutAvailable(), null); return keyboard; } diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index 766fdf0e6..d4c5e579b 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -68,8 +68,7 @@ import java.util.WeakHashMap; * @attr ref R.styleable#KeyboardView_popupLayout */ public class KeyboardView extends View implements PointerTracker.UIProxy { - private static final String TAG = "KeyboardView"; - private static final boolean DEBUG = false; + private static final String TAG = KeyboardView.class.getSimpleName(); private static final boolean DEBUG_SHOW_ALIGN = false; private static final boolean DEBUG_KEYBOARD_GRID = false; @@ -115,7 +114,6 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { private int[] mOffsetInWindow; private int mOldPreviewKeyIndex = KeyDetector.NOT_A_KEY; private boolean mShowPreview = true; - private boolean mShowTouchPoints = true; private int mPopupPreviewOffsetX; private int mPopupPreviewOffsetY; private int mWindowY; @@ -125,7 +123,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { // Popup mini keyboard private PopupWindow mMiniKeyboardPopup; - private KeyboardView mMiniKeyboard; + private KeyboardView mMiniKeyboardView; private View mMiniKeyboardParent; private final WeakHashMap<Key, View> mMiniKeyboardCache = new WeakHashMap<Key, View>(); private int mMiniKeyboardOriginX; @@ -134,6 +132,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { private int[] mWindowOffset; private final float mMiniKeyboardSlideAllowance; private int mMiniKeyboardTrackerId; + private final boolean mConfigShowMiniKeyboardAtTouchedPoint; /** Listener for {@link KeyboardActionListener}. */ private KeyboardActionListener mKeyboardActionListener; @@ -157,18 +156,20 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { // Drawing /** Whether the keyboard bitmap needs to be redrawn before it's blitted. **/ private boolean mDrawPending; + /** Notes if the keyboard just changed, so that we could possibly reallocate the mBuffer. */ + private boolean mKeyboardChanged; /** The dirty region in the keyboard bitmap */ private final Rect mDirtyRect = new Rect(); + /** The key to invalidate. */ + private Key mInvalidatedKey; + /** The dirty region for single key drawing */ + private final Rect mInvalidatedKeyRect = new Rect(); /** The keyboard bitmap for faster updates */ private Bitmap mBuffer; - /** Notes if the keyboard just changed, so that we could possibly reallocate the mBuffer. */ - private boolean mKeyboardChanged; - private Key mInvalidatedKey; /** The canvas for the above mutable keyboard bitmap */ private Canvas mCanvas; private final Paint mPaint; private final Rect mPadding; - private final Rect mClipRegion = new Rect(0, 0, 0, 0); // This map caches key label text height in pixel as value and key label text size as map key. private final HashMap<Integer, Integer> mTextHeightCache = new HashMap<Integer, Integer>(); // Distance from horizontal center of the key, proportional to key label text height and width. @@ -296,7 +297,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { public KeyboardView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); - TypedArray a = context.obtainStyledAttributes( + final TypedArray a = context.obtainStyledAttributes( attrs, R.styleable.KeyboardView, defStyle, R.style.KeyboardView); int previewLayout = 0; int keyTextSize = 0; @@ -381,6 +382,8 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { mMiniKeyboardPopup = new PopupWindow(context); mMiniKeyboardPopup.setBackgroundDrawable(null); mMiniKeyboardPopup.setAnimationStyle(R.style.MiniKeyboardAnimation); + // Allow popup window to be drawn off the screen. + mMiniKeyboardPopup.setClippingEnabled(false); mPaint = new Paint(); mPaint.setAntiAlias(true); @@ -395,10 +398,12 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { // TODO: Refer frameworks/base/core/res/res/values/config.xml mDisambiguateSwipe = res.getBoolean(R.bool.config_swipeDisambiguation); mMiniKeyboardSlideAllowance = res.getDimension(R.dimen.mini_keyboard_slide_allowance); + mConfigShowMiniKeyboardAtTouchedPoint = res.getBoolean( + R.bool.config_show_mini_keyboard_at_touched_point); GestureDetector.SimpleOnGestureListener listener = new GestureDetector.SimpleOnGestureListener() { - private boolean mProcessingDoubleTapEvent = false; + private boolean mProcessingShiftDoubleTapEvent = false; @Override public boolean onFling(MotionEvent me1, MotionEvent me2, float velocityX, @@ -419,25 +424,39 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { } @Override - public boolean onDoubleTap(MotionEvent e) { + public boolean onDoubleTap(MotionEvent firstDown) { if (ENABLE_CAPSLOCK_BY_DOUBLETAP && mKeyboard instanceof LatinKeyboard && ((LatinKeyboard) mKeyboard).isAlphaKeyboard()) { - final int pointerIndex = e.getActionIndex(); - final int id = e.getPointerId(pointerIndex); + final int pointerIndex = firstDown.getActionIndex(); + final int id = firstDown.getPointerId(pointerIndex); final PointerTracker tracker = getPointerTracker(id); - if (tracker.isOnShiftKey((int)e.getX(), (int)e.getY())) { - onDoubleTapShiftKey(tracker); - mProcessingDoubleTapEvent = true; + // If the first down event is on shift key. + if (tracker.isOnShiftKey((int)firstDown.getX(), (int)firstDown.getY())) { + mProcessingShiftDoubleTapEvent = true; return true; } } - mProcessingDoubleTapEvent = false; + mProcessingShiftDoubleTapEvent = false; return false; } @Override - public boolean onDoubleTapEvent(MotionEvent e) { - return mProcessingDoubleTapEvent; + public boolean onDoubleTapEvent(MotionEvent secondTap) { + if (mProcessingShiftDoubleTapEvent + && secondTap.getAction() == MotionEvent.ACTION_DOWN) { + final MotionEvent secondDown = secondTap; + final int pointerIndex = secondDown.getActionIndex(); + final int id = secondDown.getPointerId(pointerIndex); + final PointerTracker tracker = getPointerTracker(id); + // If the second down event is also on shift key. + if (tracker.isOnShiftKey((int)secondDown.getX(), (int)secondDown.getY())) { + onDoubleTapShiftKey(tracker); + return true; + } + // Otherwise these events should not be handled as double tap. + mProcessingShiftDoubleTapEvent = false; + } + return mProcessingShiftDoubleTapEvent; } }; @@ -487,10 +506,9 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { tracker.setKeyboard(keyboard, mKeys, mKeyHysteresisDistance); } requestLayout(); - // Hint to reallocate the buffer if the size changed mKeyboardChanged = true; invalidateAllKeys(); - computeProximityThreshold(keyboard, mKeys); + mKeyDetector.setProximityThreshold(KeyDetector.getMostCommonKeyWidth(keyboard)); mMiniKeyboardCache.clear(); } @@ -535,10 +553,6 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { return mColorScheme; } - public void setPopupParent(View v) { - mMiniKeyboardParent = v; - } - public void setPopupOffset(int x, int y) { mPopupPreviewOffsetX = x; mPopupPreviewOffsetY = y; @@ -586,37 +600,6 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { } } - /** - * Compute the most common key width and use it as proximity key detection threshold. - * @param keyboard - * @param keys - */ - private void computeProximityThreshold(Keyboard keyboard, Key[] keys) { - if (keyboard == null || keys == null || keys.length == 0) return; - final HashMap<Integer, Integer> histogram = new HashMap<Integer, Integer>(); - int maxCount = 0; - int mostCommonWidth = 0; - for (Key key : keys) { - final Integer width = key.mWidth + key.mGap; - Integer count = histogram.get(width); - if (count == null) - count = 0; - histogram.put(width, ++count); - if (count > maxCount) { - maxCount = count; - mostCommonWidth = width; - } - } - mKeyDetector.setProximityThreshold(mostCommonWidth); - } - - @Override - public void onSizeChanged(int w, int h, int oldw, int oldh) { - super.onSizeChanged(w, h, oldw, oldh); - // Release the buffer, if any and it will be reallocated on the next draw - mBuffer = null; - } - @Override public void onDraw(Canvas canvas) { super.onDraw(canvas); @@ -626,19 +609,18 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { canvas.drawBitmap(mBuffer, 0, 0, null); } - @SuppressWarnings("unused") private void onBufferDraw() { + final int width = getWidth(); + final int height = getHeight(); + if (width == 0 || height == 0) + return; if (mBuffer == null || mKeyboardChanged) { - if (mBuffer == null || mKeyboardChanged && - (mBuffer.getWidth() != getWidth() || mBuffer.getHeight() != getHeight())) { - // Make sure our bitmap is at least 1x1 - final int width = Math.max(1, getWidth()); - final int height = Math.max(1, getHeight()); - mBuffer = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); - mCanvas = new Canvas(mBuffer); - } - invalidateAllKeys(); mKeyboardChanged = false; + mDirtyRect.union(0, 0, width, height); + } + if (mBuffer == null || mBuffer.getWidth() != width || mBuffer.getHeight() != height) { + mBuffer = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); + mCanvas = new Canvas(mBuffer); } final Canvas canvas = mCanvas; canvas.clipRect(mDirtyRect, Op.REPLACE); @@ -647,30 +629,19 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { final Paint paint = mPaint; final Drawable keyBackground = mKeyBackground; - final Rect clipRegion = mClipRegion; final Rect padding = mPadding; final int kbdPaddingLeft = getPaddingLeft(); final int kbdPaddingTop = getPaddingTop(); final Key[] keys = mKeys; - final Key invalidKey = mInvalidatedKey; final boolean isManualTemporaryUpperCase = mKeyboard.isManualTemporaryUpperCase(); + final boolean drawSingleKey = (mInvalidatedKey != null + && mInvalidatedKeyRect.contains(mDirtyRect)); - boolean drawSingleKey = false; - if (invalidKey != null && canvas.getClipBounds(clipRegion)) { - // TODO we should use Rect.inset and Rect.contains here. - // Is clipRegion completely contained within the invalidated key? - if (invalidKey.mX + kbdPaddingLeft - 1 <= clipRegion.left && - invalidKey.mY + kbdPaddingTop - 1 <= clipRegion.top && - invalidKey.mX + invalidKey.mWidth + kbdPaddingLeft + 1 >= clipRegion.right && - invalidKey.mY + invalidKey.mHeight + kbdPaddingTop + 1 >= clipRegion.bottom) { - drawSingleKey = true; - } - } canvas.drawColor(0x00000000, PorterDuff.Mode.CLEAR); final int keyCount = keys.length; for (int i = 0; i < keyCount; i++) { final Key key = keys[i]; - if (drawSingleKey && invalidKey != key) { + if (drawSingleKey && key != mInvalidatedKey) { continue; } int[] drawableState = key.getCurrentDrawableState(); @@ -724,8 +695,10 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { } else { positionX = (key.mWidth + padding.left - padding.right) / 2; paint.setTextAlign(Align.CENTER); - if (DEBUG_SHOW_ALIGN && label.length() > 1) - drawVerticalLine(canvas, positionX, rowHeight, 0xc0008080, new Paint()); + if (DEBUG_SHOW_ALIGN) { + if (label.length() > 1) + drawVerticalLine(canvas, positionX, rowHeight, 0xc0008080, new Paint()); + } } if (key.mManualTemporaryUpperCaseHintIcon != null && isManualTemporaryUpperCase) { paint.setColor(mKeyTextColorDisabled); @@ -796,32 +769,13 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { canvas.drawLine(0, i * ch, cw * mKeyboard.GRID_WIDTH, i * ch, p); } - mInvalidatedKey = null; // Overlay a dark rectangle to dim the keyboard - if (mMiniKeyboard != null) { + if (mMiniKeyboardView != null) { paint.setColor((int) (mBackgroundDimAmount * 0xFF) << 24); - canvas.drawRect(0, 0, getWidth(), getHeight(), paint); - } - - if (DEBUG) { - if (mShowTouchPoints) { - for (PointerTracker tracker : mPointerTrackers) { - int startX = tracker.getStartX(); - int startY = tracker.getStartY(); - int lastX = tracker.getLastX(); - int lastY = tracker.getLastY(); - paint.setAlpha(128); - paint.setColor(0xFFFF0000); - canvas.drawCircle(startX, startY, 3, paint); - canvas.drawLine(startX, startY, lastX, lastY, paint); - paint.setColor(0xFF0000FF); - canvas.drawCircle(lastX, lastY, 3, paint); - paint.setColor(0xFF00FF00); - canvas.drawCircle((startX + lastX) / 2, (startY + lastY) / 2, 2, paint); - } - } + canvas.drawRect(0, 0, width, height, paint); } + mInvalidatedKey = null; mDrawPending = false; mDirtyRect.setEmpty(); } @@ -1035,12 +989,11 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { if (key == null) return; mInvalidatedKey = key; - // TODO we should clean up this and record key's region to use in onBufferDraw. - mDirtyRect.union(key.mX + getPaddingLeft(), key.mY + getPaddingTop(), - key.mX + key.mWidth + getPaddingLeft(), key.mY + key.mHeight + getPaddingTop()); + mInvalidatedKeyRect.set(0, 0, key.mWidth, key.mHeight); + mInvalidatedKeyRect.offset(key.mX + getPaddingLeft(), key.mY + getPaddingTop()); + mDirtyRect.union(mInvalidatedKeyRect); onBufferDraw(); - invalidate(key.mX + getPaddingLeft(), key.mY + getPaddingTop(), - key.mX + key.mWidth + getPaddingLeft(), key.mY + key.mHeight + getPaddingTop()); + invalidate(mInvalidatedKeyRect); } private boolean openPopupIfRequired(int keyIndex, PointerTracker tracker) { @@ -1052,7 +1005,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { Key popupKey = tracker.getKey(keyIndex); if (popupKey == null) return false; - boolean result = onLongPress(popupKey); + boolean result = onLongPress(popupKey, tracker); if (result) { dismissKeyPreview(); mMiniKeyboardTrackerId = tracker.mPointerId; @@ -1077,14 +1030,13 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { } private View inflateMiniKeyboardContainer(Key popupKey) { - int popupKeyboardResId = mKeyboard.getPopupKeyboardResId(); - View container = LayoutInflater.from(getContext()).inflate(mPopupLayout, null); + final View container = LayoutInflater.from(getContext()).inflate(mPopupLayout, null); if (container == null) throw new NullPointerException(); - KeyboardView miniKeyboard = + final KeyboardView miniKeyboardView = (KeyboardView)container.findViewById(R.id.KeyboardView); - miniKeyboard.setOnKeyboardActionListener(new KeyboardActionListener() { + miniKeyboardView.setOnKeyboardActionListener(new KeyboardActionListener() { @Override public void onCodeInput(int primaryCode, int[] keyCodes, int x, int y) { mKeyboardActionListener.onCodeInput(primaryCode, keyCodes, x, y); @@ -1117,14 +1069,14 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { } }); // Override default ProximityKeyDetector. - miniKeyboard.mKeyDetector = new MiniKeyboardKeyDetector(mMiniKeyboardSlideAllowance); + miniKeyboardView.mKeyDetector = new MiniKeyboardKeyDetector(mMiniKeyboardSlideAllowance); // Remove gesture detector on mini-keyboard - miniKeyboard.mGestureDetector = null; + miniKeyboardView.mGestureDetector = null; - Keyboard keyboard = new MiniKeyboardBuilder(this, popupKeyboardResId, popupKey) - .build(); - miniKeyboard.setKeyboard(keyboard); - miniKeyboard.setPopupParent(this); + 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)); @@ -1152,7 +1104,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { * @return true if the long press is handled, false otherwise. Subclasses should call the * method on the base class if the subclass doesn't wish to handle the call. */ - protected boolean onLongPress(Key popupKey) { + protected boolean onLongPress(Key popupKey, PointerTracker tracker) { if (popupKey.mPopupCharacters == null) return false; @@ -1161,93 +1113,51 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { container = inflateMiniKeyboardContainer(popupKey); mMiniKeyboardCache.put(popupKey, container); } - mMiniKeyboard = (KeyboardView)container.findViewById(R.id.KeyboardView); + mMiniKeyboardView = (KeyboardView)container.findViewById(R.id.KeyboardView); + final MiniKeyboard miniKeyboard = (MiniKeyboard)mMiniKeyboardView.getKeyboard(); + if (mWindowOffset == null) { mWindowOffset = new int[2]; getLocationInWindow(mWindowOffset); } - - // Get width of a key in the mini popup keyboard = "miniKeyWidth". - // On the other hand, "popupKey.width" is width of the pressed key on the main keyboard. - // We adjust the position of mini popup keyboard with the edge key in it: - // a) When we have the leftmost key in popup keyboard directly above the pressed key - // Right edges of both keys should be aligned for consistent default selection - // b) When we have the rightmost key in popup keyboard directly above the pressed key - // Left edges of both keys should be aligned for consistent default selection - final List<Key> miniKeys = mMiniKeyboard.getKeyboard().getKeys(); - final int miniKeyWidth = miniKeys.size() > 0 ? miniKeys.get(0).mWidth : 0; - - // HACK: Have the leftmost number in the popup characters right above the key - boolean isNumberAtLeftmost = - hasMultiplePopupChars(popupKey) && isNumberAtLeftmostPopupChar(popupKey); - int popupX = popupKey.mX + mWindowOffset[0]; - popupX += getPaddingLeft(); - if (isNumberAtLeftmost) { - popupX += popupKey.mWidth - miniKeyWidth; // adjustment for a) described above - popupX -= container.getPaddingLeft(); - } else { - popupX += miniKeyWidth; // adjustment for b) described above - popupX -= container.getMeasuredWidth(); - popupX += container.getPaddingRight(); - } - int popupY = popupKey.mY + mWindowOffset[1]; - popupY += getPaddingTop(); - popupY -= container.getMeasuredHeight(); - popupY += container.getPaddingBottom(); + final int pointX = (mConfigShowMiniKeyboardAtTouchedPoint) ? tracker.getLastX() + : popupKey.mX + popupKey.mWidth / 2; + final int popupX = pointX - miniKeyboard.getDefaultCoordX() + - container.getPaddingLeft() + + getPaddingLeft() + mWindowOffset[0]; + final int popupY = popupKey.mY - mKeyboard.getVerticalGap() + - (container.getMeasuredHeight() - container.getPaddingBottom()) + + getPaddingTop() + mWindowOffset[1]; final int x = popupX; - final int y = mShowPreview && isOneRowKeys(miniKeys) ? mPopupPreviewDisplayedY : popupY; + final int y = mShowPreview && isOneRowKeys(miniKeyboard.getKeys()) + ? mPopupPreviewDisplayedY : popupY; - int adjustedX = x; - if (x < 0) { - adjustedX = 0; - } else if (x > (getMeasuredWidth() - container.getMeasuredWidth())) { - adjustedX = getMeasuredWidth() - container.getMeasuredWidth(); - } - mMiniKeyboardOriginX = adjustedX + container.getPaddingLeft() - mWindowOffset[0]; + mMiniKeyboardOriginX = x + container.getPaddingLeft() - mWindowOffset[0]; mMiniKeyboardOriginY = y + container.getPaddingTop() - mWindowOffset[1]; - mMiniKeyboard.setPopupOffset(adjustedX, y); - Keyboard baseMiniKeyboard = mMiniKeyboard.getKeyboard(); - if (baseMiniKeyboard != null && baseMiniKeyboard.setShifted(mKeyboard == null - ? false : mKeyboard.isShiftedOrShiftLocked())) { - mMiniKeyboard.invalidateAllKeys(); + mMiniKeyboardView.setPopupOffset(x, y); + if (miniKeyboard.setShifted( + mKeyboard == null ? false : mKeyboard.isShiftedOrShiftLocked())) { + mMiniKeyboardView.invalidateAllKeys(); } // Mini keyboard needs no pop-up key preview displayed. - mMiniKeyboard.setPreviewEnabled(false); + mMiniKeyboardView.setPreviewEnabled(false); mMiniKeyboardPopup.setContentView(container); mMiniKeyboardPopup.setWidth(container.getMeasuredWidth()); mMiniKeyboardPopup.setHeight(container.getMeasuredHeight()); mMiniKeyboardPopup.showAtLocation(this, Gravity.NO_GRAVITY, x, y); // Inject down event on the key to mini keyboard. - long eventTime = SystemClock.uptimeMillis(); + final long eventTime = SystemClock.uptimeMillis(); mMiniKeyboardPopupTime = eventTime; - MotionEvent downEvent = generateMiniKeyboardMotionEvent(MotionEvent.ACTION_DOWN, popupKey.mX - + popupKey.mWidth / 2, popupKey.mY + popupKey.mHeight / 2, eventTime); - mMiniKeyboard.onTouchEvent(downEvent); + final MotionEvent downEvent = generateMiniKeyboardMotionEvent(MotionEvent.ACTION_DOWN, + pointX, popupKey.mY + popupKey.mHeight / 2, eventTime); + mMiniKeyboardView.onTouchEvent(downEvent); downEvent.recycle(); invalidateAllKeys(); return true; } - private static boolean hasMultiplePopupChars(Key key) { - if (key.mPopupCharacters != null && key.mPopupCharacters.length > 1) { - return true; - } - return false; - } - - private static boolean isNumberAtLeftmostPopupChar(Key key) { - if (key.mPopupCharacters != null && isAsciiDigit(key.mPopupCharacters[0].charAt(0))) { - return true; - } - return false; - } - - private static boolean isAsciiDigit(char c) { - return (c < 0x80) && Character.isDigit(c); - } - private MotionEvent generateMiniKeyboardMotionEvent(int action, int x, int y, long eventTime) { return MotionEvent.obtain(mMiniKeyboardPopupTime, eventTime, action, x - mMiniKeyboardOriginX, y - mMiniKeyboardOriginY, 0); @@ -1273,8 +1183,8 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { } public boolean isInSlidingKeyInput() { - if (mMiniKeyboard != null) { - return mMiniKeyboard.isInSlidingKeyInput(); + if (mMiniKeyboardView != null) { + return mMiniKeyboardView.isInSlidingKeyInput(); } else { return mPointerQueue.isInSlidingKeyInput(); } @@ -1302,7 +1212,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { mSwipeTracker.addMovement(me); // Gesture detector must be enabled only when mini-keyboard is not on the screen. - if (mMiniKeyboard == null + if (mMiniKeyboardView == null && mGestureDetector != null && mGestureDetector.onTouchEvent(me)) { dismissKeyPreview(); mHandler.cancelKeyTimers(); @@ -1317,14 +1227,14 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { // Needs to be called after the gesture detector gets a turn, as it may have // displayed the mini keyboard - if (mMiniKeyboard != null) { + if (mMiniKeyboardView != null) { final int miniKeyboardPointerIndex = me.findPointerIndex(mMiniKeyboardTrackerId); if (miniKeyboardPointerIndex >= 0 && miniKeyboardPointerIndex < pointerCount) { final int miniKeyboardX = (int)me.getX(miniKeyboardPointerIndex); final int miniKeyboardY = (int)me.getY(miniKeyboardPointerIndex); MotionEvent translated = generateMiniKeyboardMotionEvent(action, miniKeyboardX, miniKeyboardY, eventTime); - mMiniKeyboard.onTouchEvent(translated); + mMiniKeyboardView.onTouchEvent(translated); translated.recycle(); } return true; @@ -1402,8 +1312,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { mHandler.cancelAllMessages(); dismissPopupKeyboard(); - mBuffer = null; - mCanvas = null; + mDirtyRect.union(0, 0, getWidth(), getHeight()); mMiniKeyboardCache.clear(); requestLayout(); } @@ -1422,7 +1331,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy { private void dismissPopupKeyboard() { if (mMiniKeyboardPopup.isShowing()) { mMiniKeyboardPopup.dismiss(); - mMiniKeyboard = null; + mMiniKeyboardView = null; mMiniKeyboardOriginX = 0; mMiniKeyboardOriginY = 0; invalidateAllKeys(); diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java index 888375b93..ffb8d6410 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java @@ -45,18 +45,30 @@ public class LatinKeyboard extends Keyboard { public static final int OPACITY_FULLY_OPAQUE = 255; private static final int SPACE_LED_LENGTH_PERCENT = 80; + private final Context mContext; + + /* Space key and its icons, drawables and colors. */ + private final Key mSpaceKey; + private final Drawable mSpaceIcon; + private final Drawable mSpacePreviewIcon; + private final int[] mSpaceKeyIndexArray; private final Drawable mSpaceAutoCorrectionIndicator; private final Drawable mButtonArrowLeftIcon; private final Drawable mButtonArrowRightIcon; private final int mSpacebarTextColor; private final int mSpacebarTextShadowColor; + private final int mSpacebarVerticalCorrection; private float mSpacebarTextFadeFactor = 0.0f; - private final int[] mSpaceKeyIndexArray; private int mSpaceDragStartX; private int mSpaceDragLastDiff; - private final Context mContext; private boolean mCurrentlyInSpace; private SlidingLocaleDrawable mSlidingLocaleIcon; + + /* Shortcut key and its icons if available */ + private final Key mShortcutKey; + private final Drawable mEnabledShortcutIcon; + private final Drawable mDisabledShortcutIcon; + private int[] mPrefLetterFrequencies; private int mPrefLetter; private int mPrefLetterX; @@ -74,8 +86,6 @@ public class LatinKeyboard extends Keyboard { // its short language name will be used instead. private static final float MINIMUM_SCALE_OF_LANGUAGE_NAME = 0.8f; - private static int sSpacebarVerticalCorrection; - private static final String SMALL_TEXT_SIZE_OF_LANGUAGE_ON_SPACEBAR = "small"; private static final String MEDIUM_TEXT_SIZE_OF_LANGUAGE_ON_SPACEBAR = "medium"; @@ -83,21 +93,47 @@ public class LatinKeyboard extends Keyboard { super(context, id.getXmlId(), id); final Resources res = context.getResources(); mContext = context; + + final List<Key> keys = getKeys(); + int spaceKeyIndex = -1; + int shortcutKeyIndex = -1; + final int keyCount = keys.size(); + for (int index = 0; index < keyCount; index++) { + // For now, assuming there are up to one space key and one shortcut key respectively. + switch (keys.get(index).mCode) { + case CODE_SPACE: + spaceKeyIndex = index; + break; + case CODE_VOICE: + shortcutKeyIndex = index; + break; + } + } + + // The index of space key is available only after Keyboard constructor has finished. + mSpaceKey = (spaceKeyIndex >= 0) ? keys.get(spaceKeyIndex) : null; + mSpaceIcon = (mSpaceKey != null) ? mSpaceKey.getIcon() : null; + mSpacePreviewIcon = (mSpaceKey != null) ? mSpaceKey.getPreviewIcon() : null; + mSpaceKeyIndexArray = new int[] { spaceKeyIndex }; + + mShortcutKey = (shortcutKeyIndex >= 0) ? keys.get(shortcutKeyIndex) : null; + mEnabledShortcutIcon = (mShortcutKey != null) ? mShortcutKey.getIcon() : null; + mSpacebarTextColor = res.getColor(R.color.latinkeyboard_bar_language_text); if (id.mColorScheme == KeyboardView.COLOR_SCHEME_BLACK) { mSpacebarTextShadowColor = res.getColor( R.color.latinkeyboard_bar_language_shadow_black); + mDisabledShortcutIcon = res.getDrawable(R.drawable.sym_bkeyboard_voice_off); } else { // default color scheme is KeyboardView.COLOR_SCHEME_WHITE mSpacebarTextShadowColor = res.getColor( R.color.latinkeyboard_bar_language_shadow_white); + mDisabledShortcutIcon = res.getDrawable(R.drawable.sym_keyboard_voice_off_holo); } mSpaceAutoCorrectionIndicator = res.getDrawable(R.drawable.sym_keyboard_space_led); mButtonArrowLeftIcon = res.getDrawable(R.drawable.sym_keyboard_language_arrows_left); mButtonArrowRightIcon = res.getDrawable(R.drawable.sym_keyboard_language_arrows_right); - sSpacebarVerticalCorrection = res.getDimensionPixelOffset( + mSpacebarVerticalCorrection = res.getDimensionPixelOffset( R.dimen.spacebar_vertical_correction); - // The index of space key is available only after Keyboard constructor has finished. - mSpaceKeyIndexArray = new int[] { indexOf(CODE_SPACE) }; } public void setSpacebarTextFadeFactor(float fadeFactor, LatinKeyboardView view) { @@ -113,6 +149,15 @@ public class LatinKeyboard extends Keyboard { return newColor; } + public void updateShortcutKey(boolean available, LatinKeyboardView view) { + if (mShortcutKey == null) + return; + mShortcutKey.mEnabled = available; + mShortcutKey.setIcon(available ? mEnabledShortcutIcon : mDisabledShortcutIcon); + if (view != null) + view.invalidateKey(mShortcutKey); + } + /** * @return a key which should be invalidated. */ @@ -315,12 +360,8 @@ public class LatinKeyboard extends Keyboard { int x = pointX; int y = pointY; final int code = key.mCode; - if (code == CODE_SHIFT || code == CODE_DELETE) { - y -= key.mHeight / 10; - if (code == CODE_SHIFT) x += key.mWidth / 6; - if (code == CODE_DELETE) x -= key.mWidth / 6; - } else if (code == CODE_SPACE) { - y += LatinKeyboard.sSpacebarVerticalCorrection; + if (code == CODE_SPACE) { + y += mSpacebarVerticalCorrection; if (SubtypeSwitcher.getInstance().useSpacebarLanguageSwitcher() && SubtypeSwitcher.getInstance().getEnabledKeyboardLocaleCount() > 1) { if (mCurrentlyInSpace) { @@ -446,15 +487,6 @@ public class LatinKeyboard extends Keyboard { } } - private int indexOf(int code) { - List<Key> keys = getKeys(); - int count = keys.size(); - for (int i = 0; i < count; i++) { - if (keys.get(i).mCode == code) return i; - } - return -1; - } - private int getTextSizeFromTheme(int style, int defValue) { TypedArray array = mContext.getTheme().obtainStyledAttributes( style, new int[] { android.R.attr.textSize }); diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java index e9d5580e8..e7246dd6e 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java @@ -16,6 +16,7 @@ package com.android.inputmethod.keyboard; +import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.Utils; import com.android.inputmethod.voice.VoiceIMEConnector; @@ -23,10 +24,13 @@ import android.content.Context; import android.graphics.Canvas; import android.text.TextUtils; import android.util.AttributeSet; +import android.util.Log; import android.view.MotionEvent; // TODO: We should remove this class public class LatinKeyboardView extends KeyboardView { + private static final String TAG = LatinKeyboardView.class.getSimpleName(); + private static boolean DEBUG_MODE = LatinImeLogger.sDBG; /** Whether we've started dropping move events because we found a big jump */ private boolean mDroppingEvents; @@ -94,7 +98,7 @@ public class LatinKeyboardView extends KeyboardView { } @Override - protected boolean onLongPress(Key key) { + protected boolean onLongPress(Key key, PointerTracker tracker) { int primaryCode = key.mCode; if (primaryCode == Keyboard.CODE_SETTINGS) { return invokeOnKey(Keyboard.CODE_SETTINGS_LONGPRESS); @@ -102,7 +106,7 @@ public class LatinKeyboardView extends KeyboardView { // Long pressing on 0 in phone number keypad gives you a '+'. return invokeOnKey('+'); } else { - return super.onLongPress(key); + return super.onLongPress(key, tracker); } } @@ -137,6 +141,9 @@ public class LatinKeyboardView extends KeyboardView { * KeyboardView. */ private boolean handleSuddenJump(MotionEvent me) { + // If device has distinct multi touch panel, there is no need to check sudden jump. + if (hasDistinctMultitouch()) + return false; final int action = me.getAction(); final int x = (int) me.getX(); final int y = (int) me.getY(); @@ -208,7 +215,11 @@ public class LatinKeyboardView extends KeyboardView { if (keyboard == null) return true; // If there was a sudden jump, return without processing the actual motion event. - if (handleSuddenJump(me)) return true; + if (handleSuddenJump(me)) { + if (DEBUG_MODE) + Log.w(TAG, "onTouchEvent: ignore sudden jump " + me); + return true; + } // Reset any bounding box controls in the keyboard if (me.getAction() == MotionEvent.ACTION_DOWN) { diff --git a/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java b/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java new file mode 100644 index 000000000..3b1408ccf --- /dev/null +++ b/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java @@ -0,0 +1,35 @@ +/* + * 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.keyboard; + +import android.content.Context; + +public class MiniKeyboard extends Keyboard { + private int mDefaultKeyCoordX; + + public MiniKeyboard(Context context, int xmlLayoutResId, KeyboardId id) { + super(context, xmlLayoutResId, id); + } + + public void setDefaultCoordX(int pos) { + mDefaultKeyCoordX = pos; + } + + public int getDefaultCoordX() { + return mDefaultKeyCoordX; + } +} diff --git a/java/src/com/android/inputmethod/keyboard/MiniKeyboardBuilder.java b/java/src/com/android/inputmethod/keyboard/MiniKeyboardBuilder.java index c150baadb..53dab9440 100644 --- a/java/src/com/android/inputmethod/keyboard/MiniKeyboardBuilder.java +++ b/java/src/com/android/inputmethod/keyboard/MiniKeyboardBuilder.java @@ -27,44 +27,141 @@ import java.util.List; public class MiniKeyboardBuilder { private final Resources mRes; - private final Keyboard mKeyboard; + private final MiniKeyboard mKeyboard; private final CharSequence[] mPopupCharacters; - private final int mMiniKeyboardKeyHorizontalPadding; - private final int mKeyWidth; - private final int mMaxColumns; - private final int mNumRows; - private int mColPos; - private int mRowPos; - private int mX; - private int mY; + private final MiniKeyboardLayoutParams mParams; + + /* package */ static class MiniKeyboardLayoutParams { + public final int mKeyWidth; + public final int mRowHeight; + /* package */ final boolean mTopRowNeedsCentering; + public final int mNumRows; + public final int mNumColumns; + public final int mLeftKeys; + public final int mRightKeys; // includes default key. + + /** + * The object holding mini keyboard layout parameters. + * + * @param numKeys number of keys in this mini keyboard. + * @param maxColumns number of maximum columns of this mini keyboard. + * @param keyWidth mini keyboard key width in pixel, including horizontal gap. + * @param rowHeight mini keyboard row height in pixel, including vertical gap. + * @param coordXInParent coordinate x of the popup key in parent keyboard. + * @param parentKeyboardWidth parent keyboard width in pixel. + */ + public MiniKeyboardLayoutParams(int numKeys, int maxColumns, int keyWidth, int rowHeight, + int coordXInParent, int parentKeyboardWidth) { + if (parentKeyboardWidth / keyWidth < maxColumns) + throw new IllegalArgumentException("Keyboard is too small to hold mini keyboard: " + + parentKeyboardWidth + " " + keyWidth + " " + maxColumns); + final int numRows = (numKeys + maxColumns - 1) / maxColumns; + mKeyWidth = keyWidth; + mRowHeight = rowHeight; + mNumRows = numRows; + + final int numColumns = Math.min(numKeys, maxColumns); + final int topRowKeys = numKeys % numColumns; + mNumColumns = numColumns; + mTopRowNeedsCentering = topRowKeys != 0 && (numColumns - topRowKeys) % 2 != 0; + + final int numLeftKeys = (numColumns - 1) / 2; + final int numRightKeys = numColumns - numLeftKeys; // including default key. + final int maxLeftKeys = coordXInParent / keyWidth; + final int maxRightKeys = Math.max(1, (parentKeyboardWidth - coordXInParent) / keyWidth); + if (numLeftKeys > maxLeftKeys) { + mLeftKeys = maxLeftKeys; + mRightKeys = numColumns - maxLeftKeys; + } else if (numRightKeys > maxRightKeys) { + mLeftKeys = numColumns - maxRightKeys; + mRightKeys = maxRightKeys; + } else { + mLeftKeys = numLeftKeys; + mRightKeys = numRightKeys; + } + } + + // Return key position according to column count (0 is default). + /* package */ int getColumnPos(int n) { + final int col = n % mNumColumns; + if (col == 0) { + // default position. + return 0; + } + int pos = 0; + int right = 1; // include default position key. + int left = 0; + int i = 0; + while (true) { + // Assign right key if available. + if (right < mRightKeys) { + pos = right; + right++; + i++; + } + if (i >= col) + break; + // Assign left key if available. + if (left < mLeftKeys) { + left++; + pos = -left; + i++; + } + if (i >= col) + break; + } + return pos; + } + + public int getDefaultKeyCoordX() { + return mLeftKeys * mKeyWidth; + } + + public int getX(int n, int row) { + final int x = getColumnPos(n) * mKeyWidth + getDefaultKeyCoordX(); + if (isLastRow(row) && mTopRowNeedsCentering) + return x - mKeyWidth / 2; + return x; + } + + public int getY(int row) { + return (mNumRows - 1 - row) * mRowHeight; + } + + public int getRowFlags(int row) { + int rowFlags = 0; + if (row == 0) rowFlags |= Keyboard.EDGE_TOP; + if (isLastRow(row)) rowFlags |= Keyboard.EDGE_BOTTOM; + return rowFlags; + } + + private boolean isLastRow(int rowCount) { + return rowCount == mNumRows - 1; + } + } public MiniKeyboardBuilder(KeyboardView view, int layoutTemplateResId, Key popupKey) { final Context context = view.getContext(); mRes = context.getResources(); - final Keyboard keyboard = new Keyboard(context, layoutTemplateResId, null); + final MiniKeyboard keyboard = new MiniKeyboard(context, layoutTemplateResId, null); mKeyboard = keyboard; mPopupCharacters = popupKey.mPopupCharacters; - mMiniKeyboardKeyHorizontalPadding = (int)mRes.getDimension( - R.dimen.mini_keyboard_key_horizontal_padding); - mKeyWidth = getMaxKeyWidth(view, mPopupCharacters, mKeyboard.getKeyWidth()); - final int maxColumns = popupKey.mMaxPopupColumn; - mMaxColumns = maxColumns; - final int numKeys = mPopupCharacters.length; - int numRows = numKeys / maxColumns; - if (numKeys % maxColumns != 0) numRows++; - mNumRows = numRows; - keyboard.setHeight((keyboard.getRowHeight() + keyboard.getVerticalGap()) * numRows - - keyboard.getVerticalGap()); - if (numRows > 1) { - mColPos = numKeys % maxColumns; - if (mColPos > 0) mColPos = maxColumns - mColPos; - // Centering top-row keys. - mX = mColPos * (mKeyWidth + keyboard.getHorizontalGap()) / 2; - } - mKeyboard.setMinWidth(0); + + final int keyWidth = getMaxKeyWidth(view, mPopupCharacters, keyboard.getKeyWidth()); + final MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + mPopupCharacters.length, popupKey.mMaxPopupColumn, + keyWidth, keyboard.getRowHeight(), + popupKey.mX + (popupKey.mWidth + popupKey.mGap) / 2 - keyWidth / 2, + view.getMeasuredWidth()); + mParams = params; + + keyboard.setHeight(params.mNumRows * params.mRowHeight - keyboard.getVerticalGap()); + keyboard.setMinWidth(params.mNumColumns * params.mKeyWidth); + keyboard.setDefaultCoordX(params.getDefaultKeyCoordX() + params.mKeyWidth / 2); } - private int getMaxKeyWidth(KeyboardView view, CharSequence[] popupCharacters, int minKeyWidth) { + private static int getMaxKeyWidth(KeyboardView view, CharSequence[] popupCharacters, + int minKeyWidth) { Paint paint = null; Rect bounds = null; int maxWidth = 0; @@ -84,46 +181,22 @@ public class MiniKeyboardBuilder { maxWidth = bounds.width(); } } - return Math.max(minKeyWidth, maxWidth + mMiniKeyboardKeyHorizontalPadding); + final int horizontalPadding = (int)view.getContext().getResources().getDimension( + R.dimen.mini_keyboard_key_horizontal_padding); + return Math.max(minKeyWidth, maxWidth + horizontalPadding); } - public Keyboard build() { - final Keyboard keyboard = mKeyboard; + public MiniKeyboard build() { + final MiniKeyboard keyboard = mKeyboard; final List<Key> keys = keyboard.getKeys(); - for (CharSequence label : mPopupCharacters) { - refresh(); - final Key key = new Key(mRes, keyboard, label, mX, mY, mKeyWidth, getRowFlags()); + final MiniKeyboardLayoutParams params = mParams; + for (int n = 0; n < mPopupCharacters.length; n++) { + final CharSequence label = mPopupCharacters[n]; + final int row = n / params.mNumColumns; + final Key key = new Key(mRes, keyboard, label, params.getX(n, row), params.getY(row), + params.mKeyWidth, params.getRowFlags(row)); keys.add(key); - advance(); } return keyboard; } - - private int getRowFlags() { - final int rowPos = mRowPos; - int rowFlags = 0; - if (rowPos == 0) rowFlags |= Keyboard.EDGE_TOP; - if (rowPos == mNumRows - 1) rowFlags |= Keyboard.EDGE_BOTTOM; - return rowFlags; - } - - private void refresh() { - if (mColPos >= mMaxColumns) { - final Keyboard keyboard = mKeyboard; - // TODO: Allocate key position depending the precedence of popup characters. - mX = 0; - mY += keyboard.getRowHeight() + keyboard.getVerticalGap(); - mColPos = 0; - mRowPos++; - } - } - - private void advance() { - final Keyboard keyboard = mKeyboard; - // TODO: Allocate key position depending the precedence of popup characters. - mX += mKeyWidth + keyboard.getHorizontalGap(); - if (mX > keyboard.getMinWidth()) - keyboard.setMinWidth(mX); - mColPos++; - } } diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index 49f29f923..4c90e2c3f 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -17,6 +17,7 @@ package com.android.inputmethod.keyboard; import com.android.inputmethod.keyboard.KeyboardView.UIHandler; +import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; import android.content.res.Resources; @@ -31,6 +32,7 @@ public class PointerTracker { private static final boolean DEBUG_EVENT = false; private static final boolean DEBUG_MOVE_EVENT = false; private static final boolean DEBUG_LISTENER = false; + private static boolean DEBUG_MODE = LatinImeLogger.sDBG; public interface UIProxy { public void invalidateKey(Key key); @@ -62,6 +64,7 @@ public class PointerTracker { private Keyboard mKeyboard; private Key[] mKeys; private int mKeyHysteresisDistanceSquared = -1; + private int mKeyQuarterWidthSquared; private final PointerTrackerKeyState mKeyState; @@ -166,6 +169,8 @@ public class PointerTracker { mKeyboard = keyboard; mKeys = keys; mKeyHysteresisDistanceSquared = (int)(keyHysteresisDistance * keyHysteresisDistance); + final int keyQuarterWidth = keyboard.getKeyWidth() / 4; + mKeyQuarterWidthSquared = keyQuarterWidth * keyQuarterWidth; // Mark that keyboard layout has been changed. mKeyboardLayoutHasBeenChanged = true; } @@ -268,10 +273,6 @@ public class PointerTracker { if (DEBUG_EVENT) printTouchEvent("onDownEvent:", x, y, eventTime); - // TODO: up-to-down filter, if (down-up) is less than threshold, removeMessage(UP, this) in - // Handler, and just ignore this down event. - // TODO: down-to-up filter, just record down time. do not enqueue pointer now. - // Naive up-to-down noise filter. final long deltaT = eventTime - mKeyState.getUpTime(); if (deltaT < mTouchNoiseThresholdMillis) { @@ -279,8 +280,9 @@ public class PointerTracker { final int dy = y - mKeyState.getLastY(); final int distanceSquared = (dx * dx + dy * dy); if (distanceSquared < mTouchNoiseThresholdDistanceSquared) { - Log.w(TAG, "onDownEvent: ignore potential noise: time=" + deltaT - + " distance=" + distanceSquared); + if (DEBUG_MODE) + Log.w(TAG, "onDownEvent: ignore potential noise: time=" + deltaT + + " distance=" + distanceSquared); setAlreadyProcessed(); return; } @@ -333,9 +335,8 @@ public class PointerTracker { return; final PointerTrackerKeyState keyState = mKeyState; - // TODO: down-to-up filter, if (eventTime-downTime) is less than threshold, just ignore - // this move event. Otherwise fire {@link onDownEventInternal} and continue. - + final int lastX = keyState.getLastX(); + final int lastY = keyState.getLastY(); int keyIndex = keyState.onMoveKey(x, y); final Key oldKey = getKey(keyState.getKeyIndex()); if (isValidKeyIndex(keyIndex)) { @@ -365,8 +366,22 @@ public class PointerTracker { keyState.onMoveToNewKey(keyIndex, x, y); startLongPressTimer(keyIndex); } else { - setAlreadyProcessed(); - showKeyPreviewAndUpdateKeyGraphics(NOT_A_KEY); + // HACK: On some devices, quick successive touches may be translated to sudden + // move by touch panel firmware. This hack detects the case and translates the + // move event to successive up and down events. + final int dx = x - lastX; + final int dy = y - lastY; + final int lastMoveSquared = dx * dx + dy * dy; + if (lastMoveSquared >= mKeyQuarterWidthSquared) { + if (DEBUG_MODE) + Log.w(TAG, String.format("onMoveEvent: sudden move is translated to " + + "up[%d,%d]/down[%d,%d] events", lastX, lastY, x, y)); + onUpEventInternal(lastX, lastY, eventTime); + onDownEventInternal(x, y, eventTime); + } else { + setAlreadyProcessed(); + showKeyPreviewAndUpdateKeyGraphics(NOT_A_KEY); + } return; } } @@ -389,17 +404,11 @@ public class PointerTracker { showKeyPreviewAndUpdateKeyGraphics(mKeyState.getKeyIndex()); } - // TODO: up-to-down filter, if delayed UP message is fired, invoke {@link onUpEventInternal}. - public void onUpEvent(int x, int y, long eventTime, PointerTrackerQueue queue) { if (ENABLE_ASSERTION) checkAssertion(queue); if (DEBUG_EVENT) printTouchEvent("onUpEvent :", x, y, eventTime); - // TODO: up-to-down filter, just sendDelayedMessage(UP, this) to Handler. - // TODO: down-to-up filter, if (eventTime-downTime) is less than threshold, just ignore - // this up event. Otherwise fire {@link onDownEventInternal} and {@link onUpEventInternal}. - if (queue != null) { if (isModifier()) { // Before processing an up event of modifier key, all pointers already being @@ -481,15 +490,6 @@ public class PointerTracker { return mKeyState.getDownTime(); } - // These package scope methods are only for debugging purpose. - /* package */ int getStartX() { - return mKeyState.getStartX(); - } - - /* package */ int getStartY() { - return mKeyState.getStartY(); - } - private boolean isMinorMoveBounce(int x, int y, int newKey) { if (mKeys == null || mKeyHysteresisDistanceSquared < 0) throw new IllegalStateException("keyboard and/or hysteresis not set"); @@ -561,7 +561,8 @@ public class PointerTracker { codes[1] = codes[0]; codes[0] = code; } - callListenerOnCodeInput(code, codes, x, y); + if (key.mEnabled) + callListenerOnCodeInput(code, codes, x, y); callListenerOnRelease(code); } } diff --git a/java/src/com/android/inputmethod/keyboard/PointerTrackerKeyState.java b/java/src/com/android/inputmethod/keyboard/PointerTrackerKeyState.java index 250bb95eb..a62ed96a3 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTrackerKeyState.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTrackerKeyState.java @@ -23,8 +23,6 @@ package com.android.inputmethod.keyboard; private final KeyDetector mKeyDetector; // The position and time at which first down event occurred. - private int mStartX; - private int mStartY; private long mDownTime; private long mUpTime; @@ -54,14 +52,6 @@ package com.android.inputmethod.keyboard; return mKeyY; } - public int getStartX() { - return mStartX; - } - - public int getStartY() { - return mStartY; - } - public long getDownTime() { return mDownTime; } @@ -79,8 +69,6 @@ package com.android.inputmethod.keyboard; } public int onDownKey(int x, int y, long eventTime) { - mStartX = x; - mStartY = y; mDownTime = eventTime; return onMoveToNewKey(onMoveKeyInternal(x, y), x, y); } diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index b6035e15e..d87672c0e 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -20,6 +20,7 @@ import android.content.Context; import android.content.res.AssetFileDescriptor; import android.util.Log; +import java.io.File; import java.util.Arrays; /** @@ -72,9 +73,40 @@ public class BinaryDictionary extends Dictionary { public static BinaryDictionary initDictionary(Context context, int resId, int dicTypeId) { synchronized (sInstance) { sInstance.closeInternal(); - if (resId != 0) { - sInstance.loadDictionary(context, resId); + try { + final AssetFileDescriptor afd = context.getResources().openRawResourceFd(resId); + if (afd == null) { + Log.e(TAG, "Found the resource but it is compressed. resId=" + resId); + return null; + } + final String sourceDir = context.getApplicationInfo().sourceDir; + final File packagePath = new File(sourceDir); + // TODO: Come up with a way to handle a directory. + if (!packagePath.isFile()) { + Log.e(TAG, "sourceDir is not a file: " + sourceDir); + return null; + } + sInstance.loadDictionary(sourceDir, afd.getStartOffset(), afd.getLength()); sInstance.mDicTypeId = dicTypeId; + } catch (android.content.res.Resources.NotFoundException e) { + Log.e(TAG, "Could not find the resource. resId=" + resId); + return null; + } + } + return sInstance; + } + + // For unit test + /* package */ static BinaryDictionary initDictionary(File dictionary, long startOffset, + long length, int dicTypeId) { + synchronized (sInstance) { + sInstance.closeInternal(); + if (dictionary.isFile()) { + sInstance.loadDictionary(dictionary.getAbsolutePath(), startOffset, length); + sInstance.mDicTypeId = dicTypeId; + } else { + Log.e(TAG, "Could not find the file. path=" + dictionary.getAbsolutePath()); + return null; } } return sInstance; @@ -92,22 +124,11 @@ public class BinaryDictionary extends Dictionary { int[] inputCodes, int inputCodesLength, char[] outputChars, int[] frequencies, int maxWordLength, int maxBigrams, int maxAlternatives); - private final void loadDictionary(Context context, int resId) { - try { - final AssetFileDescriptor afd = context.getResources().openRawResourceFd(resId); - if (afd == null) { - Log.e(TAG, "Found the resource but it is compressed. resId=" + resId); - return; - } - mNativeDict = openNative(context.getApplicationInfo().sourceDir, - afd.getStartOffset(), afd.getLength(), + private final void loadDictionary(String path, long startOffset, long length) { + mNativeDict = openNative(path, startOffset, length, TYPED_LETTER_MULTIPLIER, FULL_WORD_FREQ_MULTIPLIER, MAX_WORD_LENGTH, MAX_WORDS, MAX_ALTERNATIVES); - mDictLength = afd.getLength(); - } catch (android.content.res.Resources.NotFoundException e) { - Log.e(TAG, "Could not find the resource. resId=" + resId); - return; - } + mDictLength = length; } @Override diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java index d2d1f22dd..9699ad136 100644 --- a/java/src/com/android/inputmethod/latin/CandidateView.java +++ b/java/src/com/android/inputmethod/latin/CandidateView.java @@ -16,8 +16,11 @@ package com.android.inputmethod.latin; +import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; + import android.content.Context; import android.content.res.Resources; +import android.graphics.Color; import android.graphics.Typeface; import android.os.Handler; import android.os.Message; @@ -43,6 +46,7 @@ import android.widget.PopupWindow; import android.widget.TextView; import java.util.ArrayList; +import java.util.List; public class CandidateView extends LinearLayout implements OnClickListener, OnLongClickListener { @@ -50,6 +54,8 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo private static final CharacterStyle UNDERLINE_SPAN = new UnderlineSpan(); private static final int MAX_SUGGESTIONS = 16; + private static final boolean DBG = LatinImeLogger.sDBG; + private final ArrayList<View> mWords = new ArrayList<View>(); private final boolean mConfigCandidateHighlightFontColorEnabled; private final CharacterStyle mInvertedForegroundColorSpan; @@ -175,11 +181,12 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo final SuggestedWords suggestions = mSuggestions; clear(); final int count = suggestions.size(); - final Object[] debugInfo = suggestions.mDebugInfo; for (int i = 0; i < count; i++) { CharSequence word = suggestions.getWord(i); if (word == null) continue; final int wordLength = word.length(); + final List<SuggestedWordInfo> suggestedWordInfoList = + suggestions.mSuggestedWordInfoList; final View v = mWords.get(i); final TextView tv = (TextView)v.findViewById(R.id.candidate_word); @@ -209,10 +216,25 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo } tv.setText(word); tv.setClickable(true); - if (debugInfo != null && i < debugInfo.length && debugInfo[i] != null - && !TextUtils.isEmpty(debugInfo[i].toString())) { - dv.setText(debugInfo[i].toString()); - dv.setVisibility(VISIBLE); + + if (suggestedWordInfoList != null && suggestedWordInfoList.get(i) != null) { + final SuggestedWordInfo info = suggestedWordInfoList.get(i); + if (info.isPreviousSuggestedWord()) { + int color = tv.getCurrentTextColor(); + tv.setTextColor(Color.argb((int)(Color.alpha(color) * 0.5f), Color.red(color), + Color.green(color), Color.blue(color))); + } + final String debugString = info.getDebugString(); + if (DBG) { + if (TextUtils.isEmpty(debugString)) { + dv.setVisibility(GONE); + } else { + dv.setText(debugString); + dv.setVisibility(VISIBLE); + } + } else { + dv.setVisibility(GONE); + } } else { dv.setVisibility(GONE); } @@ -231,8 +253,10 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo final TextView tv = (TextView)mWords.get(1).findViewById(R.id.candidate_word); final Spannable word = new SpannableString(autoCorrectedWord); final int wordLength = word.length(); - word.setSpan(mInvertedBackgroundColorSpan, 0, wordLength, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); - word.setSpan(mInvertedForegroundColorSpan, 0, wordLength, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); + word.setSpan(mInvertedBackgroundColorSpan, 0, wordLength, + Spanned.SPAN_INCLUSIVE_EXCLUSIVE); + word.setSpan(mInvertedForegroundColorSpan, 0, wordLength, + Spanned.SPAN_INCLUSIVE_EXCLUSIVE); tv.setText(word); mShowingAutoCorrectionInverted = true; } diff --git a/java/src/com/android/inputmethod/latin/DebugSettings.java b/java/src/com/android/inputmethod/latin/DebugSettings.java index 03211f36b..2f1e7c2b8 100644 --- a/java/src/com/android/inputmethod/latin/DebugSettings.java +++ b/java/src/com/android/inputmethod/latin/DebugSettings.java @@ -20,6 +20,7 @@ import android.content.SharedPreferences; import android.content.pm.PackageInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.os.Bundle; +import android.os.Process; import android.preference.CheckBoxPreference; import android.preference.PreferenceActivity; import android.util.Log; @@ -30,6 +31,7 @@ public class DebugSettings extends PreferenceActivity private static final String TAG = "DebugSettings"; private static final String DEBUG_MODE_KEY = "debug_mode"; + private boolean mServiceNeedsRestart = false; private CheckBoxPreference mDebugMode; @Override @@ -39,16 +41,24 @@ public class DebugSettings extends PreferenceActivity SharedPreferences prefs = getPreferenceManager().getSharedPreferences(); prefs.registerOnSharedPreferenceChangeListener(this); + mServiceNeedsRestart = false; mDebugMode = (CheckBoxPreference) findPreference(DEBUG_MODE_KEY); updateDebugMode(); } @Override + protected void onStop() { + super.onStop(); + if (mServiceNeedsRestart) Process.killProcess(Process.myPid()); + } + + @Override public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { if (key.equals(DEBUG_MODE_KEY)) { if (mDebugMode != null) { mDebugMode.setChecked(prefs.getBoolean(DEBUG_MODE_KEY, false)); updateDebugMode(); + mServiceNeedsRestart = true; } } } diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index b6042c769..a55ee5246 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -38,6 +38,7 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.inputmethodservice.InputMethodService; import android.media.AudioManager; +import android.net.ConnectivityManager; import android.os.Debug; import android.os.Handler; import android.os.Message; @@ -67,6 +68,8 @@ 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; @@ -83,22 +86,19 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen SharedPreferences.OnSharedPreferenceChangeListener { private static final String TAG = "LatinIME"; private static final boolean PERF_DEBUG = false; - private static final boolean DEBUG = false; private static final boolean TRACE = false; + private static boolean DEBUG = LatinImeLogger.sDBG; private static final int DELAY_UPDATE_SUGGESTIONS = 180; private static final int DELAY_UPDATE_OLD_SUGGESTIONS = 300; private static final int DELAY_UPDATE_SHIFT_STATE = 300; + private static final int EXTENDED_TOUCHABLE_REGION_HEIGHT = 100; // How many continuous deletes at which to start deleting at a higher speed. private static final int DELETE_ACCELERATE_AT = 20; // Key events coming any faster than this are long-presses. private static final int QUICK_PRESS = 200; - // Contextual menu positions - private static final int POS_METHOD = 0; - private static final int POS_SETTINGS = 1; - private int mSuggestionVisibility; private static final int SUGGESTION_VISIBILILTY_SHOW_VALUE = R.string.prefs_suggestion_visibility_show_value; @@ -121,6 +121,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private AlertDialog mOptionsDialog; private InputMethodManager mImm; + private Resources mResources; + private SharedPreferences mPrefs; + private String mInputMethodId; private KeyboardSwitcher mKeyboardSwitcher; private SubtypeSwitcher mSubtypeSwitcher; private VoiceIMEConnector mVoiceConnector; @@ -130,9 +133,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private ContactsDictionary mContactsDictionary; private AutoDictionary mAutoDictionary; - private Resources mResources; - private SharedPreferences mPrefs; - // These variables are initialized according to the {@link EditorInfo#inputType}. private boolean mAutoSpace; private boolean mInputTypeNoAutoCorrect; @@ -154,6 +154,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private boolean mPopupOn; private boolean mAutoCap; private boolean mQuickFixes; + private boolean mConfigEnableShowSubtypeSettings; private boolean mConfigSwipeDownDismissKeyboardEnabled; private int mConfigDelayBeforeFadeoutLanguageOnSpacebar; private int mConfigDurationOfFadeoutLanguageOnSpacebar; @@ -348,6 +349,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen super.onCreate(); mImm = ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)); + mInputMethodId = Utils.getInputMethodId(mImm, getApplicationInfo().packageName); mSubtypeSwitcher = SubtypeSwitcher.getInstance(); mKeyboardSwitcher = KeyboardSwitcher.getInstance(); @@ -358,11 +360,13 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // but always use the default setting defined in the resources. if (res.getBoolean(R.bool.config_enable_show_recorrection_option)) { mReCorrectionEnabled = prefs.getBoolean(Settings.PREF_RECORRECTION_ENABLED, - res.getBoolean(R.bool.default_recorrection_enabled)); + res.getBoolean(R.bool.config_default_recorrection_enabled)); } else { - mReCorrectionEnabled = res.getBoolean(R.bool.default_recorrection_enabled); + mReCorrectionEnabled = res.getBoolean(R.bool.config_default_recorrection_enabled); } + mConfigEnableShowSubtypeSettings = res.getBoolean( + R.bool.config_enable_show_subtype_settings); mConfigSwipeDownDismissKeyboardEnabled = res.getBoolean( R.bool.config_swipe_down_dismiss_keyboard_enabled); mConfigDelayBeforeFadeoutLanguageOnSpacebar = res.getInteger( @@ -386,8 +390,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mOrientation = res.getConfiguration().orientation; initSuggestPuncList(); - // register to receive ringer mode changes for silent mode - IntentFilter filter = new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION); + // register to receive ringer mode change and network state change. + 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); prefs.registerOnSharedPreferenceChangeListener(this); @@ -460,6 +466,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen commitTyped(ic); if (ic != null) ic.finishComposingText(); // For voice input mOrientation = conf.orientation; + if (isShowingOptionDialog()) + mOptionsDialog.dismiss(); } mConfigurationChanging = true; @@ -506,6 +514,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final KeyboardSwitcher switcher = mKeyboardSwitcher; LatinKeyboardView inputView = switcher.getInputView(); + if(DEBUG) { + Log.d(TAG, "onStartInputView: " + inputView); + } // In landscape mode, this method gets called without the input view being created. if (inputView == null) { return; @@ -862,6 +873,34 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (!isFullscreenMode()) { outInsets.contentTopInsets = outInsets.visibleTopInsets; } + 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(); + } + } + } + } + if (DEBUG) { + Log.d(TAG, "Touchable region " + x + ", " + y + ", " + width + ", " + height); + } + outInsets.touchableInsets = InputMethodService.Insets.TOUCHABLE_INSETS_REGION; + outInsets.touchableRegion.set(x, y, width, height); + } } @Override @@ -1034,7 +1073,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void onSettingsKeyPressed() { if (!isShowingOptionDialog()) { - if (Utils.hasMultipleEnabledIMEsOrSubtypes(mImm)) { + if (!mConfigEnableShowSubtypeSettings) { + showSubtypeSelectorAndSettings(); + } else if (Utils.hasMultipleEnabledIMEsOrSubtypes(mImm)) { showOptionsMenu(); } else { launchSettings(); @@ -1420,6 +1461,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } private boolean isCandidateStripVisible() { + if (mCandidateView == null) + return false; if (mCandidateView.isShowingAddToDictionaryHint() || TextEntryState.isCorrecting()) return true; if (!isShowingSuggestionsStrip()) @@ -1508,7 +1551,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mKeyboardSwitcher.setPreferredLetters(nextLettersFrequencies); boolean correctionAvailable = !mInputTypeNoAutoCorrect && !mJustReverted - && mSuggest.hasMinimalCorrection(); + && mSuggest.hasAutoCorrection(); final CharSequence typedWord = word.getTypedWord(); // If we're in basic correct final boolean typedWordValid = mSuggest.isValidWord(typedWord) || @@ -1524,10 +1567,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // Basically, we update the suggestion strip only when suggestion count > 1. However, // there is an exception: We update the suggestion strip whenever typed word's length - // is 1, regardless of suggestion count. Actually, in most cases, suggestion count is 1 - // when typed word's length is 1, but we do always need to clear the previous state when - // the user starts typing a word (i.e. typed word's length == 1). - if (typedWord.length() == 1 || builder.size() > 1 + // is 1 or typed word is found in dictionary, regardless of suggestion count. Actually, + // in most cases, suggestion count is 1 when typed word's length is 1, but we do always + // need to clear the previous state when the user starts typing a word (i.e. typed word's + // length == 1). + if (builder.size() > 1 || typedWord.length() == 1 || typedWordValid || mCandidateView.isShowingAddToDictionaryHint()) { builder.setTypedWordValid(typedWordValid).setHasMinimalSuggestion(correctionAvailable); } else { @@ -1542,7 +1586,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void showSuggestions(SuggestedWords suggestedWords, CharSequence typedWord) { setSuggestions(suggestedWords); if (suggestedWords.size() > 0) { - if (Utils.shouldBlockedBySafetyNetForAutoCorrection(suggestedWords)) { + if (Utils.shouldBlockedBySafetyNetForAutoCorrection(suggestedWords, mSuggest)) { mBestWord = typedWord; } else if (suggestedWords.hasAutoCorrectionWord()) { mBestWord = suggestedWords.getWord(1); @@ -1912,7 +1956,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } else if (Settings.PREF_RECORRECTION_ENABLED.equals(key)) { mReCorrectionEnabled = sharedPreferences.getBoolean( Settings.PREF_RECORRECTION_ENABLED, - mResources.getBoolean(R.bool.default_recorrection_enabled)); + mResources.getBoolean(R.bool.config_default_recorrection_enabled)); } } @@ -1953,11 +1997,16 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } - // receive ringer mode changes to detect silent mode + // receive ringer mode change and network state change. private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { - updateRingerMode(); + final String action = intent.getAction(); + if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION)) { + updateRingerMode(); + } else if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION)) { + mSubtypeSwitcher.onNetworkStateChanged(intent); + } } }; @@ -2039,7 +2088,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void updateAutoTextEnabled() { if (mSuggest == null) return; - mSuggest.setAutoTextEnabled(mQuickFixes + mSuggest.setQuickFixesEnabled(mQuickFixes && SubtypeSwitcher.getInstance().isSystemLanguageSameAsInputLanguage()); } @@ -2079,9 +2128,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // @@@ mVibrateOn = vibrator != null && vibrator.hasVibrator() mVibrateOn = vibrator != null && prefs.getBoolean(Settings.PREF_VIBRATE_ON, false); - mSoundOn = prefs.getBoolean(Settings.PREF_SOUND_ON, false); - mPopupOn = prefs.getBoolean(Settings.PREF_POPUP_ON, - mResources.getBoolean(R.bool.config_default_popup_preview)); + mSoundOn = prefs.getBoolean(Settings.PREF_SOUND_ON, + mResources.getBoolean(R.bool.config_default_sound_enabled)); + + mPopupOn = isPopupEnabled(prefs); mAutoCap = prefs.getBoolean(Settings.PREF_AUTO_CAP, true); mQuickFixes = isQuickFixesEnabled(prefs); @@ -2132,6 +2182,14 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen mSuggest.setAutoCorrectionThreshold(autoCorrectionThreshold); } + private boolean isPopupEnabled(SharedPreferences sp) { + final boolean showPopupOption = getResources().getBoolean( + R.bool.config_enable_show_popup_on_keypress_option); + if (!showPopupOption) return mResources.getBoolean(R.bool.config_default_popup_preview); + return sp.getBoolean(Settings.PREF_POPUP_ON, + mResources.getBoolean(R.bool.config_default_popup_preview)); + } + private boolean isQuickFixesEnabled(SharedPreferences sp) { final boolean showQuickFixesOption = mResources.getBoolean( R.bool.config_enable_quick_fixes_option); @@ -2179,32 +2237,70 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen return mSuggestPuncs.contains(String.valueOf((char)code)); } - private void showOptionsMenu() { - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setCancelable(true); - builder.setIcon(R.drawable.ic_dialog_keyboard); - builder.setNegativeButton(android.R.string.cancel, null); - CharSequence itemSettings = getString(R.string.english_ime_settings); - CharSequence itemInputMethod = getString(R.string.selectInputMethod); - builder.setItems(new CharSequence[] { - itemInputMethod, itemSettings}, - new DialogInterface.OnClickListener() { + private void showSubtypeSelectorAndSettings() { + final CharSequence title = getString(R.string.english_ime_input_options); + final CharSequence[] items = new CharSequence[] { + // TODO: Should use new string "Select active input modes". + getString(R.string.language_selection_title), + getString(R.string.english_ime_settings), + }; + final DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface di, int position) { + 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.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: + launchSettings(); + break; + } + } + }; + showOptionsMenuInternal(title, items, listener); + } + private void showOptionsMenu() { + final CharSequence title = getString(R.string.english_ime_input_options); + final CharSequence[] items = new CharSequence[] { + getString(R.string.selectInputMethod), + getString(R.string.english_ime_settings), + }; + final DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface di, int position) { di.dismiss(); switch (position) { - case POS_SETTINGS: - launchSettings(); - break; - case POS_METHOD: - mImm.showInputMethodPicker(); - break; + case 0: + mImm.showInputMethodPicker(); + break; + case 1: + launchSettings(); + break; } } - }); - builder.setTitle(mResources.getString(R.string.english_ime_input_options)); + }; + showOptionsMenuInternal(title, items, listener); + } + + private void showOptionsMenuInternal(CharSequence title, CharSequence[] items, + DialogInterface.OnClickListener listener) { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setCancelable(true); + builder.setIcon(R.drawable.ic_dialog_keyboard); + builder.setNegativeButton(android.R.string.cancel, null); + builder.setItems(items, listener); + builder.setTitle(title); mOptionsDialog = builder.create(); + mOptionsDialog.setCanceledOnTouchOutside(true); Window window = mOptionsDialog.getWindow(); WindowManager.LayoutParams lp = window.getAttributes(); lp.token = mKeyboardSwitcher.getInputView().getWindowToken(); diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index c78e6dd07..59c68f208 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -75,6 +75,7 @@ public class Settings extends PreferenceActivity private CheckBoxPreference mQuickFixes; private ListPreference mVoicePreference; private ListPreference mSettingsKeyPreference; + private ListPreference mShowCorrectionSuggestionsPreference; private ListPreference mAutoCorrectionThreshold; private CheckBoxPreference mBigramSuggestion; private boolean mVoiceOn; @@ -102,6 +103,8 @@ public class Settings extends PreferenceActivity mQuickFixes = (CheckBoxPreference) findPreference(PREF_QUICK_FIXES); mVoicePreference = (ListPreference) findPreference(PREF_VOICE_SETTINGS_KEY); mSettingsKeyPreference = (ListPreference) findPreference(PREF_SETTINGS_KEY); + mShowCorrectionSuggestionsPreference = + (ListPreference) findPreference(PREF_SHOW_SUGGESTIONS_SETTING); SharedPreferences prefs = getPreferenceManager().getSharedPreferences(); prefs.registerOnSharedPreferenceChangeListener(this); @@ -190,6 +193,7 @@ public class Settings extends PreferenceActivity updateVoiceModeSummary(); } updateSettingsKeySummary(); + updateShowCorrectionSuggestionsSummary(); } @Override @@ -214,6 +218,7 @@ public class Settings extends PreferenceActivity .equals(mVoiceModeOff)); updateVoiceModeSummary(); updateSettingsKeySummary(); + updateShowCorrectionSuggestionsSummary(); } @Override @@ -222,7 +227,9 @@ public class Settings extends PreferenceActivity final String action; if (android.os.Build.VERSION.SDK_INT >= /* android.os.Build.VERSION_CODES.HONEYCOMB */ 11) { - action = "android.settings.INPUT_METHOD_AND_SUBTYPE_ENABLER"; + // 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"; } @@ -232,6 +239,13 @@ public class Settings extends PreferenceActivity return false; } + private void updateShowCorrectionSuggestionsSummary() { + mShowCorrectionSuggestionsPreference.setSummary( + getResources().getStringArray(R.array.prefs_suggestion_visibilities) + [mShowCorrectionSuggestionsPreference.findIndexOfValue( + mShowCorrectionSuggestionsPreference.getValue())]); + } + private void updateSettingsKeySummary() { mSettingsKeyPreference.setSummary( getResources().getStringArray(R.array.settings_key_modes) diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java index 6666c8e15..f45c2b7f8 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java @@ -18,16 +18,21 @@ package com.android.inputmethod.latin; import com.android.inputmethod.compat.InputMethodSubtype; import com.android.inputmethod.keyboard.KeyboardSwitcher; +import com.android.inputmethod.keyboard.LatinKeyboard; +import com.android.inputmethod.keyboard.LatinKeyboardView; 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; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.drawable.Drawable; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; import android.os.IBinder; import android.text.TextUtils; import android.util.Log; @@ -41,12 +46,14 @@ import java.util.Locale; import java.util.Map; public class SubtypeSwitcher { - private static final boolean DBG = false; + private static boolean DBG = LatinImeLogger.sDBG; private static final String TAG = "SubtypeSwitcher"; private static final char LOCALE_SEPARATER = '_'; private static final String KEYBOARD_MODE = "keyboard"; private static final String VOICE_MODE = "voice"; + private static final String SUBTYPE_EXTRAVALUE_REQUIRE_NETWORK_CONNECTIVITY = + "requireNetworkConnectivity"; private final TextUtils.SimpleStringSplitter mLocaleSplitter = new TextUtils.SimpleStringSplitter(LOCALE_SEPARATER); @@ -55,17 +62,17 @@ public class SubtypeSwitcher { private /* final */ SharedPreferences mPrefs; private /* final */ InputMethodManager mImm; private /* final */ Resources mResources; + private /* final */ ConnectivityManager mConnectivityManager; + private /* final */ boolean mConfigUseSpacebarLanguageSwitcher; private final ArrayList<InputMethodSubtype> mEnabledKeyboardSubtypesOfCurrentInputMethod = new ArrayList<InputMethodSubtype>(); private final ArrayList<String> mEnabledLanguagesOfCurrentInputMethod = new ArrayList<String>(); - private boolean mConfigUseSpacebarLanguageSwitcher; - /*-----------------------------------------------------------*/ // Variants which should be changed only by reload functions. private boolean mNeedsToDisplayLanguage; private boolean mIsSystemLanguageSameAsInputLanguage; - private InputMethodInfo mShortcutInfo; + private InputMethodInfo mShortcutInputMethodInfo; private InputMethodSubtype mShortcutSubtype; private List<InputMethodSubtype> mAllEnabledSubtypesOfCurrentInputMethod; private Locale mSystemLocale; @@ -75,13 +82,14 @@ public class SubtypeSwitcher { private VoiceInput mVoiceInput; /*-----------------------------------------------------------*/ + private boolean mIsNetworkConnected; + public static SubtypeSwitcher getInstance() { return sInstance; } public static void init(LatinIME service, SharedPreferences prefs) { - sInstance.mPrefs = prefs; - sInstance.resetParams(service); + sInstance.initialize(service, prefs); sInstance.updateAllParameters(); SubtypeLocale.init(service); @@ -91,10 +99,13 @@ public class SubtypeSwitcher { // Intentional empty constructor for singleton. } - private void resetParams(LatinIME service) { + private void initialize(LatinIME service, SharedPreferences prefs) { mService = service; + mPrefs = prefs; mResources = service.getResources(); mImm = (InputMethodManager) service.getSystemService(Context.INPUT_METHOD_SERVICE); + mConnectivityManager = (ConnectivityManager) service.getSystemService( + Context.CONNECTIVITY_SERVICE); mEnabledKeyboardSubtypesOfCurrentInputMethod.clear(); mEnabledLanguagesOfCurrentInputMethod.clear(); mSystemLocale = null; @@ -109,6 +120,9 @@ public class SubtypeSwitcher { R.bool.config_use_spacebar_language_switcher); if (mConfigUseSpacebarLanguageSwitcher) initLanguageSwitcher(service); + + final NetworkInfo info = mConnectivityManager.getActiveNetworkInfo(); + mIsNetworkConnected = (info != null && info.isConnected()); } // Update all parameters stored in SubtypeSwitcher. @@ -163,6 +177,13 @@ public class SubtypeSwitcher { } private void updateShortcutIME() { + if (DBG) { + Log.d(TAG, "Update shortcut IME from : " + + (mShortcutInputMethodInfo == null + ? "<null>" : mShortcutInputMethodInfo.getId()) + ", " + + (mShortcutSubtype == null ? "<null>" : (mShortcutSubtype.getLocale() + + ", " + mShortcutSubtype.getMode()))); + } // TODO: Update an icon for shortcut IME /* Map<InputMethodInfo, List<InputMethodSubtype>> shortcuts = @@ -171,7 +192,7 @@ public class SubtypeSwitcher { List<InputMethodSubtype> subtypes = shortcuts.get(imi); // TODO: Returns the first found IMI for now. Should handle all shortcuts as // appropriate. - mShortcutInfo = imi; + mShortcutInputMethodInfo = imi; // TODO: Pick up the first found subtype for now. Should handle all subtypes // as appropriate. mShortcutSubtype = subtypes.size() > 0 ? subtypes.get(0) : null; @@ -213,6 +234,9 @@ public class SubtypeSwitcher { } mMode = newMode; } + + // If the old mode is voice input, we need to reset or cancel its status. + // We cancel its status when we change mode, while we reset otherwise. if (isKeyboardMode()) { if (modeChanged) { if (VOICE_MODE.equals(oldMode) && mVoiceInput != null) { @@ -220,19 +244,26 @@ public class SubtypeSwitcher { } } if (modeChanged || languageChanged) { + updateShortcutIME(); mService.onRefreshKeyboard(); } - } else if (isVoiceMode()) { + } else if (isVoiceMode() && mVoiceInput != null) { + if (VOICE_MODE.equals(oldMode)) { + mVoiceInput.reset(); + } // If needsToShowWarningDialog is true, voice input need to show warning before // show recognition view. if (languageChanged || modeChanged || VoiceIMEConnector.getInstance().needsToShowWarningDialog()) { - if (mVoiceInput != null) { - triggerVoiceIME(); - } + triggerVoiceIME(); } } else { Log.w(TAG, "Unknown subtype mode: " + mMode); + if (VOICE_MODE.equals(oldMode) && mVoiceInput != 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(); + } } } @@ -268,15 +299,15 @@ public class SubtypeSwitcher { //////////////////////////// public void switchToShortcutIME() { - IBinder token = mService.getWindow().getWindow().getAttributes().token; - if (token == null || mShortcutInfo == null) { + final IBinder token = mService.getWindow().getWindow().getAttributes().token; + if (token == null || mShortcutInputMethodInfo == null) { return; } // @@@ mImm.setInputMethodAndSubtype(token, mShortcutInfo.getId(), mShortcutSubtype); } public Drawable getShortcutIcon() { - return getSubtypeIcon(mShortcutInfo, mShortcutSubtype); + return getSubtypeIcon(mShortcutInputMethodInfo, mShortcutSubtype); } private Drawable getSubtypeIcon(InputMethodInfo imi, InputMethodSubtype subtype) { @@ -291,9 +322,9 @@ public class SubtypeSwitcher { if (subtype != null) { return pm.getDrawable(imiPackageName, subtype.getIconResId(), imi.getServiceInfo().applicationInfo); - } else if (imi.getSubtypes().size() > 0 && imi.getSubtypes().get(0) != null) { + } else if (imi.getSubtypeCount() > 0 && imi.getSubtypeAt(0) != null) { return pm.getDrawable(imiPackageName, - imi.getSubtypes().get(0).getIconResId(), + imi.getSubtypeAt(0).getIconResId(), imi.getServiceInfo().applicationInfo); } else { try { @@ -307,6 +338,38 @@ public class SubtypeSwitcher { return null; } + private static boolean contains(String[] hay, String needle) { + for (String element : hay) { + if (element.equals(needle)) + return true; + } + return false; + } + + public boolean isShortcutAvailable() { + if (mShortcutInputMethodInfo == null) + return false; + if (mShortcutSubtype != null && contains(mShortcutSubtype.getExtraValue().split(","), + SUBTYPE_EXTRAVALUE_REQUIRE_NETWORK_CONNECTIVITY)) { + return mIsNetworkConnected; + } + return true; + } + + public void onNetworkStateChanged(Intent intent) { + final boolean noConnection = intent.getBooleanExtra( + ConnectivityManager.EXTRA_NO_CONNECTIVITY, false); + mIsNetworkConnected = !noConnection; + + final LatinKeyboardView inputView = KeyboardSwitcher.getInstance().getInputView(); + if (inputView != null) { + final LatinKeyboard keyboard = inputView.getLatinKeyboard(); + if (keyboard != null) { + keyboard.updateShortcutKey(isShortcutAvailable(), inputView); + } + } + } + ////////////////////////////////// // Language Switching functions // ////////////////////////////////// @@ -353,8 +416,15 @@ public class SubtypeSwitcher { 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[mEnabledLanguagesOfCurrentInputMethod.size()]); + new String[enabledLanguageCount]); } } @@ -427,7 +497,7 @@ public class SubtypeSwitcher { mVoiceInput = vi; if (isVoiceMode()) { if (DBG) { - Log.d(TAG, "Set and call voice input."); + Log.d(TAG, "Set and call voice input.: " + getInputLocaleStr()); } triggerVoiceIME(); return true; diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 24c73e8ea..c9e57d0a5 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -22,6 +22,7 @@ import android.text.TextUtils; import android.util.Log; import android.view.View; +import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -64,7 +65,7 @@ public class Suggest implements Dictionary.WordCallback { static final int LARGE_DICTIONARY_THRESHOLD = 200 * 1000; - private static boolean DBG = LatinImeLogger.sDBG; + private static final boolean DBG = LatinImeLogger.sDBG; private BinaryDictionary mMainDict; @@ -80,7 +81,7 @@ public class Suggest implements Dictionary.WordCallback { private static final int PREF_MAX_BIGRAMS = 60; - private boolean mAutoTextEnabled; + private boolean mQuickFixesEnabled; private double mAutoCorrectionThreshold; private int[] mPriorities = new int[mPrefMaxSuggestions]; @@ -95,7 +96,7 @@ public class Suggest implements Dictionary.WordCallback { private ArrayList<CharSequence> mSuggestions = new ArrayList<CharSequence>(); ArrayList<CharSequence> mBigramSuggestions = new ArrayList<CharSequence>(); private ArrayList<CharSequence> mStringPool = new ArrayList<CharSequence>(); - private boolean mHaveAutoCorrection; + private boolean mHasAutoCorrection; private String mLowerOriginalWord; // TODO: Remove these member variables by passing more context to addWord() callback method @@ -109,6 +110,12 @@ public class Suggest implements Dictionary.WordCallback { initPool(); } + // For unit test + /* package */ Suggest(File dictionary, long startOffset, long length) { + mMainDict = BinaryDictionary.initDictionary(dictionary, startOffset, length, DIC_MAIN); + initPool(); + } + private void initPool() { for (int i = 0; i < mPrefMaxSuggestions; i++) { StringBuilder sb = new StringBuilder(getApproxMaxWordLength()); @@ -116,8 +123,8 @@ public class Suggest implements Dictionary.WordCallback { } } - public void setAutoTextEnabled(boolean enabled) { - mAutoTextEnabled = enabled; + public void setQuickFixesEnabled(boolean enabled) { + mQuickFixesEnabled = enabled; } public int getCorrectionMode() { @@ -163,6 +170,10 @@ public class Suggest implements Dictionary.WordCallback { mAutoCorrectionThreshold = threshold; } + public boolean isAggressiveAutoCorrectionMode() { + return (mAutoCorrectionThreshold == 0); + } + /** * Number of suggestions to generate from the input key sequence. This has * to be a number between 1 and 100 (inclusive). @@ -200,7 +211,7 @@ public class Suggest implements Dictionary.WordCallback { public SuggestedWords.Builder getSuggestedWordBuilder(View view, WordComposer wordComposer, CharSequence prevWordForBigram) { LatinImeLogger.onStartSuggestion(prevWordForBigram); - mHaveAutoCorrection = false; + mHasAutoCorrection = false; mIsFirstCharCapitalized = wordComposer.isFirstCharCapitalized(); mIsAllUpperCase = wordComposer.isAllUpperCase(); collectGarbage(mSuggestions, mPrefMaxSuggestions); @@ -220,6 +231,7 @@ public class Suggest implements Dictionary.WordCallback { mLowerOriginalWord = ""; } + double normalizedScore = Integer.MIN_VALUE; if (wordComposer.size() == 1 && (mCorrectionMode == CORRECTION_FULL_BIGRAM || mCorrectionMode == CORRECTION_BASIC)) { // At first character typed, search only the bigrams @@ -278,7 +290,7 @@ public class Suggest implements Dictionary.WordCallback { if (DBG) { Log.d(TAG, "Auto corrected by CORRECTION_FULL."); } - mHaveAutoCorrection = true; + mHasAutoCorrection = true; } } if (mMainDict != null) mMainDict.getWords(wordComposer, this, mNextLettersFrequencies); @@ -286,25 +298,25 @@ public class Suggest implements Dictionary.WordCallback { && mSuggestions.size() > 0 && mPriorities.length > 0) { // TODO: when the normalized score of the first suggestion is nearly equals to // the normalized score of the second suggestion, behave less aggressive. - final double normalizedScore = Utils.calcNormalizedScore( + normalizedScore = Utils.calcNormalizedScore( typedWord, mSuggestions.get(0), mPriorities[0]); - if (LatinImeLogger.sDBG) { + if (DBG) { Log.d(TAG, "Normalized " + typedWord + "," + mSuggestions.get(0) + "," - + mPriorities[0] + normalizedScore + + mPriorities[0] + ", " + normalizedScore + "(" + mAutoCorrectionThreshold + ")"); } if (normalizedScore >= mAutoCorrectionThreshold) { if (DBG) { Log.d(TAG, "Auto corrected by S-threthhold."); } - mHaveAutoCorrection = true; + mHasAutoCorrection = true; } } } if (typedWord != null) { mSuggestions.add(0, typedWord.toString()); } - if (mAutoTextEnabled) { + if (mQuickFixesEnabled) { int i = 0; int max = 6; // Don't autotext the suggestions from the dictionaries @@ -342,7 +354,7 @@ public class Suggest implements Dictionary.WordCallback { if (DBG) { Log.d(TAG, "Auto corrected by AUTOTEXT."); } - mHaveAutoCorrection = true; + mHasAutoCorrection = true; mSuggestions.add(i + 1, autoText); i++; } @@ -350,7 +362,30 @@ public class Suggest implements Dictionary.WordCallback { } } removeDupes(); - return new SuggestedWords.Builder().addWords(mSuggestions); + if (DBG) { + ArrayList<SuggestedWords.SuggestedWordInfo> frequencyInfoList = + new ArrayList<SuggestedWords.SuggestedWordInfo>(); + frequencyInfoList.add(new SuggestedWords.SuggestedWordInfo("+", false)); + final int priorityLength = mPriorities.length; + for (int i = 0; i < priorityLength; ++i) { + if (normalizedScore > 0) { + final String priorityThreshold = Integer.toString(mPriorities[i]) + " (" + + normalizedScore + ")"; + frequencyInfoList.add( + new SuggestedWords.SuggestedWordInfo(priorityThreshold, false)); + normalizedScore = 0.0; + } else { + final String priority = Integer.toString(mPriorities[i]); + frequencyInfoList.add(new SuggestedWords.SuggestedWordInfo(priority, false)); + } + } + for (int i = priorityLength; i < mSuggestions.size(); ++i) { + frequencyInfoList.add(new SuggestedWords.SuggestedWordInfo("--", false)); + } + return new SuggestedWords.Builder().addWords(mSuggestions, frequencyInfoList); + } else { + return new SuggestedWords.Builder().addWords(mSuggestions, null); + } } public int[] getNextLettersFrequencies() { @@ -384,16 +419,16 @@ public class Suggest implements Dictionary.WordCallback { } } - public boolean hasMinimalCorrection() { - return mHaveAutoCorrection; + public boolean hasAutoCorrection() { + return mHasAutoCorrection; } - private boolean compareCaseInsensitive(final String mLowerOriginalWord, + private static boolean compareCaseInsensitive(final String lowerOriginalWord, final char[] word, final int offset, final int length) { - final int originalLength = mLowerOriginalWord.length(); + final int originalLength = lowerOriginalWord.length(); if (originalLength == length && Character.isUpperCase(word[offset])) { for (int i = 0; i < originalLength; i++) { - if (mLowerOriginalWord.charAt(i) != Character.toLowerCase(word[offset+i])) { + if (lowerOriginalWord.charAt(i) != Character.toLowerCase(word[offset+i])) { return false; } } diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java index 0fbbcdd91..f774ce3a5 100644 --- a/java/src/com/android/inputmethod/latin/SuggestedWords.java +++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java @@ -20,6 +20,7 @@ import android.view.inputmethod.CompletionInfo; import java.util.ArrayList; import java.util.Collections; +import java.util.HashSet; import java.util.List; public class SuggestedWords { @@ -29,10 +30,11 @@ public class SuggestedWords { public final boolean mIsApplicationSpecifiedCompletions; public final boolean mTypedWordValid; public final boolean mHasMinimalSuggestion; - public final Object[] mDebugInfo; + public final List<SuggestedWordInfo> mSuggestedWordInfoList; private SuggestedWords(List<CharSequence> words, boolean isApplicationSpecifiedCompletions, - boolean typedWordValid, boolean hasMinamlSuggestion, Object[] debugInfo) { + boolean typedWordValid, boolean hasMinamlSuggestion, + List<SuggestedWordInfo> suggestedWordInfoList) { if (words != null) { mWords = words; } else { @@ -41,7 +43,7 @@ public class SuggestedWords { mIsApplicationSpecifiedCompletions = isApplicationSpecifiedCompletions; mTypedWordValid = typedWordValid; mHasMinimalSuggestion = hasMinamlSuggestion; - mDebugInfo = debugInfo; + mSuggestedWordInfoList = suggestedWordInfoList; } public int size() { @@ -61,38 +63,46 @@ public class SuggestedWords { } public static class Builder { - private List<CharSequence> mWords; + private List<CharSequence> mWords = new ArrayList<CharSequence>(); private boolean mIsCompletions; private boolean mTypedWordValid; private boolean mHasMinimalSuggestion; - private Object[] mDebugInfo; + private List<SuggestedWordInfo> mSuggestedWordInfoList = + new ArrayList<SuggestedWordInfo>(); public Builder() { // Nothing to do here. } - public Builder addWords(List<CharSequence> words) { - for (final CharSequence word : words) - addWord(word); + public Builder addWords(List<CharSequence> words, + List<SuggestedWordInfo> suggestedWordInfoList) { + final int N = words.size(); + for (int i = 0; i < N; ++i) { + SuggestedWordInfo suggestedWordInfo = null; + if (suggestedWordInfoList != null) { + suggestedWordInfo = suggestedWordInfoList.get(i); + } + if (suggestedWordInfo == null) { + suggestedWordInfo = new SuggestedWordInfo(); + } + addWord(words.get(i), suggestedWordInfo); + } return this; } - public Builder setDebugInfo(Object[] debuginfo) { - mDebugInfo = debuginfo; - return this; + public Builder addWord(CharSequence word) { + return addWord(word, null, false); } - public Builder addWord(int pos, CharSequence word) { - if (mWords == null) - mWords = new ArrayList<CharSequence>(); - mWords.add(pos, word); - return this; + public Builder addWord(CharSequence word, CharSequence debugString, + boolean isPreviousSuggestedWord) { + SuggestedWordInfo info = new SuggestedWordInfo(debugString, isPreviousSuggestedWord); + return addWord(word, info); } - public Builder addWord(CharSequence word) { - if (mWords == null) - mWords = new ArrayList<CharSequence>(); + private Builder addWord(CharSequence word, SuggestedWordInfo suggestedWordInfo) { mWords.add(word); + mSuggestedWordInfoList.add(suggestedWordInfo); return this; } @@ -117,11 +127,20 @@ public class SuggestedWords { // and replace it with what the user currently typed. public Builder addTypedWordAndPreviousSuggestions(CharSequence typedWord, SuggestedWords previousSuggestions) { - if (mWords != null) mWords.clear(); - addWord(typedWord); + mWords.clear(); + mSuggestedWordInfoList.clear(); + final HashSet<String> alreadySeen = new HashSet<String>(); + addWord(typedWord, null, false); + alreadySeen.add(typedWord.toString()); final int previousSize = previousSuggestions.size(); - for (int pos = 1; pos < previousSize; pos++) - addWord(previousSuggestions.getWord(pos)); + for (int pos = 1; pos < previousSize; pos++) { + final String prevWord = previousSuggestions.getWord(pos).toString(); + // Filter out duplicate suggestion. + if (!alreadySeen.contains(prevWord)) { + addWord(prevWord, null, true); + alreadySeen.add(prevWord); + } + } mIsCompletions = false; mTypedWordValid = false; mHasMinimalSuggestion = false; @@ -130,15 +149,42 @@ public class SuggestedWords { public SuggestedWords build() { return new SuggestedWords(mWords, mIsCompletions, mTypedWordValid, - mHasMinimalSuggestion, mDebugInfo); + mHasMinimalSuggestion, mSuggestedWordInfoList); } public int size() { - return mWords == null ? 0 : mWords.size(); + return mWords.size(); } public CharSequence getWord(int pos) { return mWords.get(pos); } } + + public static class SuggestedWordInfo { + private final CharSequence mDebugString; + private final boolean mPreviousSuggestedWord; + + public SuggestedWordInfo() { + mDebugString = ""; + mPreviousSuggestedWord = false; + } + + public SuggestedWordInfo(CharSequence debugString, boolean previousSuggestedWord) { + mDebugString = debugString; + mPreviousSuggestedWord = previousSuggestedWord; + } + + public String getDebugString() { + if (mDebugString == null) { + return ""; + } else { + return mDebugString.toString(); + } + } + + public boolean isPreviousSuggestedWord () { + return mPreviousSuggestedWord; + } + } } diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/Utils.java index 160948507..d33d962c0 100644 --- a/java/src/com/android/inputmethod/latin/Utils.java +++ b/java/src/com/android/inputmethod/latin/Utils.java @@ -23,6 +23,7 @@ import android.os.HandlerThread; import android.os.Process; import android.text.format.DateUtils; import android.util.Log; +import android.view.inputmethod.InputMethodInfo; import android.view.inputmethod.InputMethodManager; import java.io.BufferedReader; @@ -37,6 +38,7 @@ import java.util.Date; public class Utils { private static final String TAG = Utils.class.getSimpleName(); + private static final int MINIMUM_SAFETY_NET_CHAR_LENGTH = 4; private static boolean DBG = LatinImeLogger.sDBG; /** @@ -98,12 +100,26 @@ public class Utils { // || imm.getEnabledInputMethodSubtypeList(null, false).size() > 1; } + public static String getInputMethodId(InputMethodManager imm, String packageName) { + for (final InputMethodInfo imi : imm.getEnabledInputMethodList()) { + if (imi.getPackageName().equals(packageName)) + return imi.getId(); + } + throw new RuntimeException("Can not find input method id for " + packageName); + } - public static boolean shouldBlockedBySafetyNetForAutoCorrection(SuggestedWords suggestions) { + public static boolean shouldBlockedBySafetyNetForAutoCorrection(SuggestedWords suggestions, + Suggest suggest) { // Safety net for auto correction. // Actually if we hit this safety net, it's actually a bug. if (suggestions.size() <= 1 || suggestions.mTypedWordValid) return false; + // If user selected aggressive auto correction mode, there is no need to use the safety + // net. + if (suggest.isAggressiveAutoCorrectionMode()) return false; CharSequence typedWord = suggestions.getWord(0); + // If the length of typed word is less than MINIMUM_SAFETY_NET_CHAR_LENGTH, + // we should not use net because relatively edit distance can be big. + if (typedWord.length() < MINIMUM_SAFETY_NET_CHAR_LENGTH) return false; CharSequence candidateWord = suggestions.getWord(1); final int typedWordLength = typedWord.length(); final int maxEditDistanceOfNativeDictionary = typedWordLength < 5 ? 2 : typedWordLength / 2; @@ -113,8 +129,11 @@ public class Utils { + ", " + maxEditDistanceOfNativeDictionary); } if (distance > maxEditDistanceOfNativeDictionary) { - Log.w(TAG, "(Error) The edit distance of this correction exceeds limit. " - + "Turning off auto-correction."); + if (DBG) { + Log.d(TAG, "Safety net: before = " + typedWord + ", after = " + candidateWord); + Log.w(TAG, "(Error) The edit distance of this correction exceeds limit. " + + "Turning off auto-correction."); + } return true; } else { return false; @@ -260,9 +279,12 @@ public class Utils { public static double calcNormalizedScore(CharSequence before, CharSequence after, int score) { final int beforeLength = before.length(); final int afterLength = after.length(); + if (beforeLength == 0 || afterLength == 0) return 0; final int distance = editDistance(before, after); + // If afterLength < beforeLength, the algorithm is suggesting a word by excessive character + // correction. final double maximumScore = MAX_INITIAL_SCORE - * Math.pow(TYPED_LETTER_MULTIPLIER, beforeLength) + * Math.pow(TYPED_LETTER_MULTIPLIER, Math.min(beforeLength, afterLength)) * FULL_WORD_MULTIPLYER; // add a weight based on edit distance. // distance <= max(afterLength, beforeLength) == afterLength, diff --git a/java/src/com/android/inputmethod/voice/RecognitionView.java b/java/src/com/android/inputmethod/voice/RecognitionView.java index 98db9365f..95a79f463 100644 --- a/java/src/com/android/inputmethod/voice/RecognitionView.java +++ b/java/src/com/android/inputmethod/voice/RecognitionView.java @@ -16,6 +16,9 @@ package com.android.inputmethod.voice; +import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.SubtypeSwitcher; + import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; @@ -35,13 +38,11 @@ import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; -import com.android.inputmethod.latin.R; - import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.ShortBuffer; -import java.util.List; +import java.util.Locale; /** * The user interface for the "Speak now" and "working" states. @@ -60,6 +61,7 @@ public class RecognitionView { private ImageView mImage; private View mProgress; private SoundIndicator mSoundIndicator; + private TextView mLanguage; private Button mButton; private Drawable mInitializing; @@ -105,6 +107,7 @@ public class RecognitionView { mButton = (Button) mView.findViewById(R.id.button); mButton.setOnClickListener(clickListener); mText = (TextView) mView.findViewById(R.id.text); + mLanguage = (TextView) mView.findViewById(R.id.language); mContext = context; } @@ -184,9 +187,14 @@ public class RecognitionView { private void prepareDialog(CharSequence text, Drawable image, CharSequence btnTxt) { + + /* + * The mic of INIT and of LISTENING has to be displayed in the same position. To accomplish + * that, some text visibility are not set as GONE but as INVISIBLE. + */ switch (mState) { case INIT: - mText.setVisibility(View.GONE); + mText.setVisibility(View.INVISIBLE); mProgress.setVisibility(View.GONE); @@ -196,6 +204,8 @@ public class RecognitionView { mSoundIndicator.setVisibility(View.GONE); mSoundIndicator.stop(); + mLanguage.setVisibility(View.INVISIBLE); + mPopupLayout.setBackgroundDrawable(mListeningBorder); break; case LISTENING: @@ -209,6 +219,11 @@ public class RecognitionView { mSoundIndicator.setVisibility(View.VISIBLE); mSoundIndicator.start(); + Locale locale = SubtypeSwitcher.getInstance().getInputLocale(); + + mLanguage.setVisibility(View.VISIBLE); + mLanguage.setText(SubtypeSwitcher.getFullDisplayName(locale, true)); + mPopupLayout.setBackgroundDrawable(mListeningBorder); break; case WORKING: @@ -223,6 +238,8 @@ public class RecognitionView { mSoundIndicator.setVisibility(View.GONE); mSoundIndicator.stop(); + mLanguage.setVisibility(View.GONE); + mPopupLayout.setBackgroundDrawable(mWorkingBorder); break; case READY: @@ -237,6 +254,8 @@ public class RecognitionView { mSoundIndicator.setVisibility(View.GONE); mSoundIndicator.stop(); + mLanguage.setVisibility(View.GONE); + mPopupLayout.setBackgroundDrawable(mErrorBorder); break; default: diff --git a/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java b/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java index fe6e318c9..267bef21d 100644 --- a/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java +++ b/java/src/com/android/inputmethod/voice/VoiceIMEConnector.java @@ -20,6 +20,7 @@ import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.latin.EditingUtils; import com.android.inputmethod.latin.LatinIME; import com.android.inputmethod.latin.LatinIME.UIHandler; +import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.SharedPreferencesCompat; import com.android.inputmethod.latin.SubtypeSwitcher; @@ -32,19 +33,18 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Configuration; import android.net.Uri; +import android.os.AsyncTask; import android.os.IBinder; import android.preference.PreferenceManager; import android.provider.Browser; import android.speech.SpeechRecognizer; -import android.text.Layout; -import android.text.Selection; -import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.Spanned; import android.text.TextUtils; import android.text.method.LinkMovementMethod; -import android.text.style.ClickableSpan; import android.text.style.URLSpan; +import android.util.Log; import android.view.LayoutInflater; -import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.ViewParent; @@ -78,9 +78,10 @@ public class VoiceIMEConnector implements VoiceInput.UiListener { // given text field. For instance this is specified by the search dialog when the // dialog is already showing a voice search button. private static final String IME_OPTION_NO_MICROPHONE = "nm"; + private static final int RECOGNITIONVIEW_HEIGHT_THRESHOLD_RATIO = 6; - @SuppressWarnings("unused") - private static final String TAG = "VoiceIMEConnector"; + private static final String TAG = VoiceIMEConnector.class.getSimpleName(); + private static final boolean DEBUG = LatinImeLogger.sDBG; private boolean mAfterVoiceInput; private boolean mHasUsedVoiceInput; @@ -172,7 +173,7 @@ public class VoiceIMEConnector implements VoiceInput.UiListener { if (mVoiceWarningDialog != null && mVoiceWarningDialog.isShowing()) { return; } - AlertDialog.Builder builder = new AlertDialog.Builder(mService); + AlertDialog.Builder builder = new UrlLinkAlertDialogBuilder(mService); builder.setCancelable(true); builder.setIcon(R.drawable.ic_mic_dialog); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @@ -210,90 +211,80 @@ public class VoiceIMEConnector implements VoiceInput.UiListener { mService.getText(R.string.voice_warning_how_to_turn_off)); } builder.setMessage(message); - builder.setTitle(R.string.voice_warning_title); mVoiceWarningDialog = builder.create(); - Window window = mVoiceWarningDialog.getWindow(); - WindowManager.LayoutParams lp = window.getAttributes(); + final Window window = mVoiceWarningDialog.getWindow(); + final WindowManager.LayoutParams lp = window.getAttributes(); lp.token = token; lp.type = WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG; window.setAttributes(lp); window.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM); mVoiceInput.logKeyboardWarningDialogShown(); mVoiceWarningDialog.show(); - // Make URL in the dialog message clickable - TextView textView = (TextView) mVoiceWarningDialog.findViewById(android.R.id.message); - if (textView != null) { - final CustomLinkMovementMethod method = CustomLinkMovementMethod.getInstance(); - method.setVoiceWarningDialog(mVoiceWarningDialog); - textView.setMovementMethod(method); - } } - private static class CustomLinkMovementMethod extends LinkMovementMethod { - private static CustomLinkMovementMethod sLinkMovementMethodInstance = - new CustomLinkMovementMethod(); + private static class UrlLinkAlertDialogBuilder extends AlertDialog.Builder { private AlertDialog mAlertDialog; - public void setVoiceWarningDialog(AlertDialog alertDialog) { - mAlertDialog = alertDialog; + public UrlLinkAlertDialogBuilder(Context context) { + super(context); } - public static CustomLinkMovementMethod getInstance() { - return sLinkMovementMethodInstance; + @Override + public AlertDialog.Builder setMessage(CharSequence message) { + return super.setMessage(replaceURLSpan(message)); + } + + private Spanned replaceURLSpan(CharSequence message) { + // Replace all spans with the custom span + final SpannableStringBuilder ssb = new SpannableStringBuilder(message); + for (URLSpan span : ssb.getSpans(0, ssb.length(), URLSpan.class)) { + int spanStart = ssb.getSpanStart(span); + int spanEnd = ssb.getSpanEnd(span); + int spanFlags = ssb.getSpanFlags(span); + ssb.removeSpan(span); + ssb.setSpan(new ClickableSpan(span.getURL()), spanStart, spanEnd, spanFlags); + } + return ssb; } - // Almost the same as LinkMovementMethod.onTouchEvent(), but overrides it for - // FLAG_ACTIVITY_NEW_TASK and mAlertDialog.cancel(). @Override - public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) { - int action = event.getAction(); - - if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_DOWN) { - int x = (int) event.getX(); - int y = (int) event.getY(); - - x -= widget.getTotalPaddingLeft(); - y -= widget.getTotalPaddingTop(); - - x += widget.getScrollX(); - y += widget.getScrollY(); - - Layout layout = widget.getLayout(); - int line = layout.getLineForVertical(y); - int off = layout.getOffsetForHorizontal(line, x); - - ClickableSpan[] link = buffer.getSpans(off, off, ClickableSpan.class); - - if (link.length != 0) { - if (action == MotionEvent.ACTION_UP) { - if (link[0] instanceof URLSpan) { - URLSpan urlSpan = (URLSpan) link[0]; - Uri uri = Uri.parse(urlSpan.getURL()); - Context context = widget.getContext(); - Intent intent = new Intent(Intent.ACTION_VIEW, uri); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName()); - if (mAlertDialog != null) { - // Go back to the previous IME for now. - // TODO: If we can find a way to bring the new activity to front - // while keeping the warning dialog, we don't need to cancel here. - mAlertDialog.cancel(); - } - context.startActivity(intent); - } else { - link[0].onClick(widget); - } - } else if (action == MotionEvent.ACTION_DOWN) { - Selection.setSelection(buffer, buffer.getSpanStart(link[0]), - buffer.getSpanEnd(link[0])); + public AlertDialog create() { + final AlertDialog dialog = super.create(); + + dialog.setOnShowListener(new DialogInterface.OnShowListener() { + @Override + public void onShow(DialogInterface dialogInterface) { + // Make URL in the dialog message click-able. + TextView textView = (TextView) mAlertDialog.findViewById(android.R.id.message); + if (textView != null) { + textView.setMovementMethod(LinkMovementMethod.getInstance()); } - return true; - } else { - Selection.removeSelection(buffer); } + }); + mAlertDialog = dialog; + return dialog; + } + + class ClickableSpan extends URLSpan { + public ClickableSpan(String url) { + super(url); + } + + @Override + public void onClick(View widget) { + Uri uri = Uri.parse(getURL()); + Context context = widget.getContext(); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + // Add this flag to start an activity from service + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName()); + // Dismiss the warning dialog and go back to the previous IME. + // TODO: If we can find a way to bring the new activity to front while keeping + // the warning dialog, we don't need to dismiss it here. + mAlertDialog.cancel(); + context.startActivity(intent); } - return super.onTouchEvent(widget, buffer, event); } } @@ -437,7 +428,7 @@ public class VoiceIMEConnector implements VoiceInput.UiListener { builder.addWord(word); } } else { - builder.addWords(suggestions); + builder.addWords(suggestions, null); } builder.setTypedWordValid(true).setHasMinimalSuggestion(true); mService.setSuggestions(builder.build()); @@ -543,10 +534,14 @@ public class VoiceIMEConnector implements VoiceInput.UiListener { // As we add mm, we don't know how the rounding is going to work // thus we may end up with few pixels extra (or less). if (keyboardView != null) { - int h = keyboardView.getHeight(); - if (h > 0) { - View popupLayout = v.findViewById(R.id.popup_layout); - popupLayout.getLayoutParams().height = h; + View popupLayout = v.findViewById(R.id.popup_layout); + final int displayHeight = + mService.getResources().getDisplayMetrics().heightPixels; + final int currentHeight = popupLayout.getLayoutParams().height; + final int keyboardHeight = keyboardView.getHeight(); + if (keyboardHeight > currentHeight || keyboardHeight + > (displayHeight / RECOGNITIONVIEW_HEIGHT_THRESHOLD_RATIO)) { + popupLayout.getLayoutParams().height = keyboardHeight; } } mService.setInputView(v); @@ -645,14 +640,17 @@ public class VoiceIMEConnector implements VoiceInput.UiListener { } } - public void onStartInputView(IBinder token) { + public void onStartInputView(IBinder keyboardViewToken) { + // If keyboardViewToken is null, keyboardView is not attached but voiceView is attached. + IBinder windowToken = keyboardViewToken != null ? keyboardViewToken + : mVoiceInput.getView().getWindowToken(); // If IME is in voice mode, but still needs to show the voice warning dialog, // keep showing the warning. - if (mSubtypeSwitcher.isVoiceMode() && token != null) { + if (mSubtypeSwitcher.isVoiceMode() && windowToken != null) { // Close keyboard view if it is been shown. if (KeyboardSwitcher.getInstance().isInputViewShown()) KeyboardSwitcher.getInstance().getInputView().purgeKeyboardAndClosing(); - startListening(false, token); + startListening(false, windowToken); } // If we have no token, onAttachedToWindow will take care of showing dialog and start // listening. @@ -701,7 +699,7 @@ public class VoiceIMEConnector implements VoiceInput.UiListener { mHandler.updateVoiceResults(); } - public FieldContext makeFieldContext() { + private FieldContext makeFieldContext() { SubtypeSwitcher switcher = SubtypeSwitcher.getInstance(); return new FieldContext(mService.getCurrentInputConnection(), mService.getCurrentInputEditorInfo(), switcher.getInputLocaleStr(), diff --git a/java/src/com/android/inputmethod/voice/VoiceInput.java b/java/src/com/android/inputmethod/voice/VoiceInput.java index ffa349fde..2df9e8588 100644 --- a/java/src/com/android/inputmethod/voice/VoiceInput.java +++ b/java/src/com/android/inputmethod/voice/VoiceInput.java @@ -17,6 +17,7 @@ package com.android.inputmethod.voice; import com.android.inputmethod.latin.EditingUtils; +import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; import android.content.ContentResolver; @@ -58,6 +59,7 @@ public class VoiceInput implements OnClickListener { private static final String EXTRA_CALLING_PACKAGE = "calling_package"; private static final String EXTRA_ALTERNATES = "android.speech.extra.ALTERNATES"; private static final int MAX_ALT_LIST_LENGTH = 6; + private static boolean DBG = LatinImeLogger.sDBG; private static final String DEFAULT_RECOMMENDED_PACKAGES = "com.android.mms " + @@ -128,19 +130,14 @@ public class VoiceInput implements OnClickListener { private int mState = DEFAULT; - private final static int MSG_CLOSE_ERROR_DIALOG = 1; - - private final static int MSG_RESET = 2; + private final static int MSG_RESET = 1; private final Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { - if (msg.what == MSG_RESET || msg.what == MSG_CLOSE_ERROR_DIALOG) { + if (msg.what == MSG_RESET) { mState = DEFAULT; mRecognitionView.finish(); - } - - if (msg.what == MSG_CLOSE_ERROR_DIALOG) { mUiListener.onCancelVoice(); } } @@ -313,8 +310,18 @@ public class VoiceInput implements OnClickListener { * @param swipe whether this voice input was started by swipe, for logging purposes */ public void startListening(FieldContext context, boolean swipe) { - mState = DEFAULT; - + if (DBG) { + Log.d(TAG, "startListening: " + context); + } + + if (mState != DEFAULT) { + Log.w(TAG, "startListening in the wrong status " + mState); + } + + // If everything works ok, the voice input should be already in the correct state. As this + // class can be called by third-party, we call reset just to be on the safe side. + reset(); + Locale locale = Locale.getDefault(); String localeString = locale.getLanguage() + "-" + locale.getCountry(); @@ -499,6 +506,21 @@ public class VoiceInput implements OnClickListener { } /** + * Reset the current voice recognition. + */ + public void reset() { + if (mState != DEFAULT) { + mState = DEFAULT; + + // Remove all pending tasks (e.g., timers to cancel voice input) + mHandler.removeMessages(MSG_RESET); + + mSpeechRecognizer.cancel(); + mRecognitionView.finish(); + } + } + + /** * Cancel in-progress speech recognition. */ public void cancel() { @@ -513,14 +535,9 @@ public class VoiceInput implements OnClickListener { mLogger.cancelDuringError(); break; } - mState = DEFAULT; - - // Remove all pending tasks (e.g., timers to cancel voice input) - mHandler.removeMessages(MSG_RESET); - mSpeechRecognizer.cancel(); + reset(); mUiListener.onCancelVoice(); - mRecognitionView.finish(); } private int getErrorStringId(int errorType, boolean endpointed) { @@ -555,7 +572,7 @@ public class VoiceInput implements OnClickListener { mState = ERROR; mRecognitionView.showError(error); // Wait a couple seconds and then automatically dismiss message. - mHandler.sendMessageDelayed(Message.obtain(mHandler, MSG_CLOSE_ERROR_DIALOG), 2000); + mHandler.sendMessageDelayed(Message.obtain(mHandler, MSG_RESET), 2000); } private class ImeRecognitionListener implements RecognitionListener { diff --git a/native/src/defines.h b/native/src/defines.h index 71aaf28ae..c1eaf0df2 100644 --- a/native/src/defines.h +++ b/native/src/defines.h @@ -129,11 +129,16 @@ static void prof_out(void) { #define SUGGEST_WORDS_WITH_EXCESSIVE_CHARACTER true #define SUGGEST_WORDS_WITH_TRANSPOSED_CHARACTERS true +// The following "rate"s are used as a multiplier before dividing by 100, so they are in percent. #define WORDS_WITH_MISSING_CHARACTER_DEMOTION_RATE 75 #define WORDS_WITH_MISSING_SPACE_CHARACTER_DEMOTION_RATE 80 #define WORDS_WITH_EXCESSIVE_CHARACTER_DEMOTION_RATE 75 #define WORDS_WITH_EXCESSIVE_CHARACTER_OUT_OF_PROXIMITY_DEMOTION_RATE 75 #define WORDS_WITH_TRANSPOSED_CHARACTERS_DEMOTION_RATE 60 +#define FULL_MATCHED_WORDS_PROMOTION_RATE 120 + +// This is used as a bare multiplier (not subject to /100) +#define FULL_MATCH_ACCENTS_OR_CAPITALIZATION_DIFFER_MULTIPLIER 2 // This should be greater than or equal to MAX_WORD_LENGTH defined in BinaryDictionary.java // This is only used for the size of array. Not to be used in c functions. diff --git a/native/src/unigram_dictionary.cpp b/native/src/unigram_dictionary.cpp index 3f9bcd758..dfbe8228e 100644 --- a/native/src/unigram_dictionary.cpp +++ b/native/src/unigram_dictionary.cpp @@ -347,9 +347,9 @@ void UnigramDictionary::getWordsRec(const int childrenCount, const int pos, cons } } -inline int UnigramDictionary::calculateFinalFreq(const int inputIndex, const int snr, - const int skipPos, const int excessivePos, const int transposedPos, const int freq, - const bool sameLength) { +inline int UnigramDictionary::calculateFinalFreq(const int inputIndex, const int depth, + const int snr, const int skipPos, const int excessivePos, const int transposedPos, + const int freq, const bool sameLength) { // TODO: Demote by edit distance int finalFreq = freq * snr; if (skipPos >= 0) multiplyRate(WORDS_WITH_MISSING_CHARACTER_DEMOTION_RATE, &finalFreq); @@ -361,6 +361,17 @@ inline int UnigramDictionary::calculateFinalFreq(const int inputIndex, const int multiplyRate(WORDS_WITH_EXCESSIVE_CHARACTER_OUT_OF_PROXIMITY_DEMOTION_RATE, &finalFreq); } } + int lengthFreq = TYPED_LETTER_MULTIPLIER; + for (int i = 0; i < depth; ++i) lengthFreq *= TYPED_LETTER_MULTIPLIER; + if (lengthFreq == snr) { + if (depth > 1) { + if (DEBUG_DICT) LOGI("Found full matched word."); + multiplyRate(FULL_MATCHED_WORDS_PROMOTION_RATE, &finalFreq); + } + if (sameLength && transposedPos < 0 && skipPos < 0 && excessivePos < 0) { + finalFreq *= FULL_MATCH_ACCENTS_OR_CAPITALIZATION_DIFFER_MULTIPLIER; + } + } if (sameLength && skipPos < 0) finalFreq *= FULL_WORD_MULTIPLIER; return finalFreq; } @@ -369,8 +380,8 @@ inline void UnigramDictionary::onTerminalWhenUserTypedLengthIsGreaterThanInputLe unsigned short *word, const int inputIndex, const int depth, const int snr, int *nextLetters, const int nextLettersSize, const int skipPos, const int excessivePos, const int transposedPos, const int freq) { - const int finalFreq = calculateFinalFreq(inputIndex, snr, skipPos, excessivePos, transposedPos, - freq, false); + const int finalFreq = calculateFinalFreq(inputIndex, depth, snr, skipPos, excessivePos, + transposedPos, freq, false); if (depth >= MIN_SUGGEST_DEPTH) addWord(word, depth + 1, finalFreq); if (depth >= mInputLength && skipPos < 0) { registerNextLetter(mWord[mInputLength], nextLetters, nextLettersSize); @@ -379,10 +390,9 @@ inline void UnigramDictionary::onTerminalWhenUserTypedLengthIsGreaterThanInputLe inline void UnigramDictionary::onTerminalWhenUserTypedLengthIsSameAsInputLength( unsigned short *word, const int inputIndex, const int depth, const int snr, - const int skipPos, const int excessivePos, const int transposedPos, const int freq, - const int addedWeight) { + const int skipPos, const int excessivePos, const int transposedPos, const int freq) { if (sameAsTyped(word, depth + 1)) return; - const int finalFreq = calculateFinalFreq(inputIndex, snr * addedWeight, skipPos, + const int finalFreq = calculateFinalFreq(inputIndex, depth, snr, skipPos, excessivePos, transposedPos, freq, true); // Proximity collection will promote a word of the same length as what user typed. if (depth >= MIN_SUGGEST_DEPTH) addWord(word, depth + 1, finalFreq); @@ -418,9 +428,9 @@ inline bool UnigramDictionary::existsAdjacentProximityChars(const int inputIndex return false; } -inline int UnigramDictionary::getMatchedProximityId(const int *currentChars, - const unsigned short c, const int skipPos, const int excessivePos, - const int transposedPos) { +inline UnigramDictionary::ProximityType UnigramDictionary::getMatchedProximityId( + const int *currentChars, const unsigned short c, const int skipPos, + const int excessivePos, const int transposedPos) { const unsigned short lowerC = toLowerCase(c); int j = 0; while (currentChars[j] > 0 && j < MAX_PROXIMITY_CHARS) { @@ -428,18 +438,19 @@ inline int UnigramDictionary::getMatchedProximityId(const int *currentChars, // If skipPos is defined, not to search proximity collections. // First char is what user typed. if (matched) { - return j; + if (j > 0) return NEAR_PROXIMITY_CHAR; + return SAME_OR_ACCENTED_OR_CAPITALIZED_CHAR; } else if (skipPos >= 0 || excessivePos >= 0 || transposedPos >= 0) { // Not to check proximity characters - return -1; + return UNRELATED_CHAR; } ++j; } - return -1; + return UNRELATED_CHAR; } inline bool UnigramDictionary::processCurrentNode(const int pos, const int depth, - const int maxDepth, const bool traverseAllNodes, const int snr, int inputIndex, + const int maxDepth, const bool traverseAllNodes, int snr, int inputIndex, const int diffs, const int skipPos, const int excessivePos, const int transposedPos, int *nextLetters, const int nextLettersSize, int *newCount, int *newChildPosition, bool *newTraverseAllNodes, int *newSnr, int*newInputIndex, int *newDiffs, @@ -455,8 +466,9 @@ inline bool UnigramDictionary::processCurrentNode(const int pos, const int depth int childPosition; bool terminal; int freq; + bool isSameAsUserTypedLength = false; - if (excessivePos == depth) ++inputIndex; + if (excessivePos == depth && inputIndex < mInputLength - 1) ++inputIndex; *nextSiblingPosition = Dictionary::setDictionaryValues(DICT, IS_LATEST_DICT_VERSION, pos, &c, &childPosition, &terminal, &freq); @@ -485,21 +497,24 @@ inline bool UnigramDictionary::processCurrentNode(const int pos, const int depth int matchedProximityCharId = getMatchedProximityId(currentChars, c, skipPos, excessivePos, transposedPos); - if (matchedProximityCharId < 0) return false; + if (UNRELATED_CHAR == matchedProximityCharId) return false; mWord[depth] = c; // If inputIndex is greater than mInputLength, that means there is no // proximity chars. So, we don't need to check proximity. - const int addedWeight = matchedProximityCharId == 0 ? TYPED_LETTER_MULTIPLIER : 1; - const bool isSameAsUserTypedLength = mInputLength == inputIndex + 1; + if (SAME_OR_ACCENTED_OR_CAPITALIZED_CHAR == matchedProximityCharId) { + snr = snr * TYPED_LETTER_MULTIPLIER; + } + bool isSameAsUserTypedLength = mInputLength == inputIndex + 1 + || (excessivePos == mInputLength - 1 && inputIndex == mInputLength - 2); if (isSameAsUserTypedLength && terminal) { onTerminalWhenUserTypedLengthIsSameAsInputLength(mWord, inputIndex, depth, snr, - skipPos, excessivePos, transposedPos, freq, addedWeight); + skipPos, excessivePos, transposedPos, freq); } if (!needsToTraverseChildrenNodes) return false; // Start traversing all nodes after the index exceeds the user typed length *newTraverseAllNodes = isSameAsUserTypedLength; - *newSnr = snr * addedWeight; - *newDiffs = diffs + ((matchedProximityCharId > 0) ? 1 : 0); + *newSnr = snr; + *newDiffs = diffs + ((NEAR_PROXIMITY_CHAR == matchedProximityCharId) ? 1 : 0); *newInputIndex = inputIndex + 1; } // Optimization: Prune out words that are too long compared to how much was typed. @@ -508,7 +523,8 @@ inline bool UnigramDictionary::processCurrentNode(const int pos, const int depth } // If inputIndex is greater than mInputLength, that means there are no proximity chars. - if (mInputLength <= *newInputIndex) { + // TODO: Check if this can be isSameAsUserTypedLength only. + if (isSameAsUserTypedLength || mInputLength <= *newInputIndex) { *newTraverseAllNodes = true; } // get the count of nodes and increment childAddress. diff --git a/native/src/unigram_dictionary.h b/native/src/unigram_dictionary.h index 7f7b7bd21..90c98149b 100644 --- a/native/src/unigram_dictionary.h +++ b/native/src/unigram_dictionary.h @@ -22,6 +22,13 @@ namespace latinime { class UnigramDictionary { + + typedef enum { // Used as a return value for character comparison + SAME_OR_ACCENTED_OR_CAPITALIZED_CHAR, // Same char, possibly with different case or accent + NEAR_PROXIMITY_CHAR, // It is a char located nearby on the keyboard + UNRELATED_CHAR // It is an unrelated char + } ProximityType; + public: UnigramDictionary(const unsigned char *dict, int typedLetterMultipler, int fullWordMultiplier, int maxWordLength, int maxWords, int maxProximityChars, const bool isLatestDictVersion); @@ -52,7 +59,7 @@ private: const int excessivePos, const int transposedPos, int *nextLetters, const int nextLettersSize); void registerNextLetter(unsigned short c, int *nextLetters, int nextLettersSize); - int calculateFinalFreq(const int inputIndex, const int snr, const int skipPos, + int calculateFinalFreq(const int inputIndex, const int depth, const int snr, const int skipPos, const int excessivePos, const int transposedPos, const int freq, const bool sameLength); void onTerminalWhenUserTypedLengthIsGreaterThanInputLength(unsigned short *word, const int inputIndex, const int depth, const int snr, int *nextLetters, @@ -60,11 +67,11 @@ private: const int transposedPos, const int freq); void onTerminalWhenUserTypedLengthIsSameAsInputLength(unsigned short *word, const int inputIndex, const int depth, const int snr, const int skipPos, - const int excessivePos, const int transposedPos, const int freq, const int addedWeight); + const int excessivePos, const int transposedPos, const int freq); bool needsToSkipCurrentNode(const unsigned short c, const int inputIndex, const int skipPos, const int depth); - int getMatchedProximityId(const int *currentChars, const unsigned short c, const int skipPos, - const int excessivePos, const int transposedPos); + ProximityType getMatchedProximityId(const int *currentChars, const unsigned short c, + const int skipPos, const int excessivePos, const int transposedPos); // Process a node by considering proximity, missing and excessive character bool processCurrentNode(const int pos, const int depth, const int maxDepth, const bool traverseAllNodes, const int snr, int inputIndex, diff --git a/tests/src/com/android/inputmethod/keyboard/MiniKeyboardBuilderTests.java b/tests/src/com/android/inputmethod/keyboard/MiniKeyboardBuilderTests.java new file mode 100644 index 000000000..7e3106d7f --- /dev/null +++ b/tests/src/com/android/inputmethod/keyboard/MiniKeyboardBuilderTests.java @@ -0,0 +1,312 @@ +/* + * 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.keyboard; + +import com.android.inputmethod.keyboard.MiniKeyboardBuilder.MiniKeyboardLayoutParams; + +import android.test.AndroidTestCase; + +public class MiniKeyboardBuilderTests extends AndroidTestCase { + private static final int MAX_COLUMNS = 5; + private static final int WIDTH = 10; + private static final int HEIGHT = 10; + + @Override + protected void setUp() throws Exception { + super.setUp(); + } + + public void testLayoutError() { + MiniKeyboardLayoutParams params = null; + try { + params = new MiniKeyboardLayoutParams( + 10, MAX_COLUMNS + 1, WIDTH, HEIGHT, + WIDTH * 2, WIDTH * MAX_COLUMNS); + fail("Should throw IllegalArgumentException"); + } catch (IllegalArgumentException e) { + // Too small keyboard to hold mini keyboard. + } + assertNull("Too small keyboard to hold mini keyboard", params); + } + + // Mini keyboard layout test. + // "[n]" represents n-th key position in mini keyboard. + // "[1]" is the default key. + + // [1] + public void testLayout1Key() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 1, MAX_COLUMNS, WIDTH, HEIGHT, + WIDTH * 5, WIDTH * 10); + assertEquals("1 key columns", 1, params.mNumColumns); + assertEquals("1 key rows", 1, params.mNumRows); + assertEquals("1 key left", 0, params.mLeftKeys); + assertEquals("1 key right", 1, params.mRightKeys); + assertEquals("1 key [1]", 0, params.getColumnPos(0)); + assertEquals("1 key centering", false, params.mTopRowNeedsCentering); + assertEquals("1 key default", 0, params.getDefaultKeyCoordX()); + } + + // [1] [2] + public void testLayout2Key() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 2, MAX_COLUMNS, WIDTH, HEIGHT, + WIDTH * 5, WIDTH * 10); + assertEquals("2 key columns", 2, params.mNumColumns); + assertEquals("2 key rows", 1, params.mNumRows); + assertEquals("2 key left", 0, params.mLeftKeys); + assertEquals("2 key right", 2, params.mRightKeys); + assertEquals("2 key [1]", 0, params.getColumnPos(0)); + assertEquals("2 key [2]", 1, params.getColumnPos(1)); + assertEquals("2 key centering", false, params.mTopRowNeedsCentering); + assertEquals("2 key default", 0, params.getDefaultKeyCoordX()); + } + + // [3] [1] [2] + public void testLayout3Key() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 3, MAX_COLUMNS, WIDTH, HEIGHT, + WIDTH * 5, WIDTH * 10); + assertEquals("3 key columns", 3, params.mNumColumns); + assertEquals("3 key rows", 1, params.mNumRows); + assertEquals("3 key left", 1, params.mLeftKeys); + assertEquals("3 key right", 2, params.mRightKeys); + assertEquals("3 key [1]", 0, params.getColumnPos(0)); + assertEquals("3 key [2]", 1, params.getColumnPos(1)); + assertEquals("3 key [3]", -1, params.getColumnPos(2)); + assertEquals("3 key centering", false, params.mTopRowNeedsCentering); + assertEquals("3 key default", WIDTH, params.getDefaultKeyCoordX()); + } + + // [3] [1] [2] [4] + public void testLayout4Key() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 4, MAX_COLUMNS, WIDTH, HEIGHT, + WIDTH * 5, WIDTH * 10); + assertEquals("4 key columns", 4, params.mNumColumns); + assertEquals("4 key rows", 1, params.mNumRows); + assertEquals("4 key left", 1, params.mLeftKeys); + assertEquals("4 key right", 3, params.mRightKeys); + assertEquals("4 key [1]", 0, params.getColumnPos(0)); + assertEquals("4 key [2]", 1, params.getColumnPos(1)); + assertEquals("4 key [3]", -1, params.getColumnPos(2)); + assertEquals("4 key [4]", 2, params.getColumnPos(3)); + assertEquals("4 key centering", false, params.mTopRowNeedsCentering); + assertEquals("4 key default", WIDTH, params.getDefaultKeyCoordX()); + } + + // [5] [3] [1] [2] [4] + public void testLayout5Key() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 5, MAX_COLUMNS, WIDTH, HEIGHT, + WIDTH * 5, WIDTH * 10); + assertEquals("5 key columns", 5, params.mNumColumns); + assertEquals("5 key rows", 1, params.mNumRows); + assertEquals("5 key left", 2, params.mLeftKeys); + assertEquals("5 key right", 3, params.mRightKeys); + assertEquals("5 key [1]", 0, params.getColumnPos(0)); + assertEquals("5 key [2]", 1, params.getColumnPos(1)); + assertEquals("5 key [3]", -1, params.getColumnPos(2)); + assertEquals("5 key [4]", 2, params.getColumnPos(3)); + assertEquals("5 key [5]", -2, params.getColumnPos(4)); + assertEquals("5 key centering", false, params.mTopRowNeedsCentering); + assertEquals("5 key default", WIDTH * 2, params.getDefaultKeyCoordX()); + } + + // [6] + // [5] [3] [1] [2] [4] + public void testLayout6Key() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 6, MAX_COLUMNS, WIDTH, HEIGHT, + WIDTH * 5, WIDTH * 10); + assertEquals("6 key columns", 5, params.mNumColumns); + assertEquals("6 key rows", 2, params.mNumRows); + assertEquals("6 key left", 2, params.mLeftKeys); + assertEquals("6 key right", 3, params.mRightKeys); + assertEquals("6 key [1]", 0, params.getColumnPos(0)); + assertEquals("6 key [2]", 1, params.getColumnPos(1)); + assertEquals("6 key [3]", -1, params.getColumnPos(2)); + assertEquals("6 key [4]", 2, params.getColumnPos(3)); + assertEquals("6 key [5]", -2, params.getColumnPos(4)); + assertEquals("6 key [6]", 0, params.getColumnPos(5)); + assertEquals("6 key centering", false, params.mTopRowNeedsCentering); + assertEquals("6 key default", WIDTH * 2, params.getDefaultKeyCoordX()); + } + + // [6] [7] + // [5] [3] [1] [2] [4] + public void testLayout7Key() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 7, MAX_COLUMNS, WIDTH, HEIGHT, + WIDTH * 5, WIDTH * 10); + assertEquals("7 key columns", 5, params.mNumColumns); + assertEquals("7 key rows", 2, params.mNumRows); + assertEquals("7 key left", 2, params.mLeftKeys); + assertEquals("7 key right", 3, params.mRightKeys); + assertEquals("7 key [1]", 0, params.getColumnPos(0)); + assertEquals("7 key [2]", 1, params.getColumnPos(1)); + assertEquals("7 key [3]", -1, params.getColumnPos(2)); + assertEquals("7 key [4]", 2, params.getColumnPos(3)); + assertEquals("7 key [5]", -2, params.getColumnPos(4)); + assertEquals("7 key [6]", 0, params.getColumnPos(5)); + assertEquals("7 key [7]", 1, params.getColumnPos(6)); + assertEquals("7 key centering", true, params.mTopRowNeedsCentering); + assertEquals("7 key default", WIDTH * 2, params.getDefaultKeyCoordX()); + } + + // [8] [6] [7] + // [5] [3] [1] [2] [4] + public void testLayout8Key() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 8, MAX_COLUMNS, WIDTH, HEIGHT, + WIDTH * 5, WIDTH * 10); + assertEquals("8 key columns", 5, params.mNumColumns); + assertEquals("8 key rows", 2, params.mNumRows); + assertEquals("8 key left", 2, params.mLeftKeys); + assertEquals("8 key right", 3, params.mRightKeys); + assertEquals("8 key [1]", 0, params.getColumnPos(0)); + assertEquals("8 key [2]", 1, params.getColumnPos(1)); + assertEquals("8 key [3]", -1, params.getColumnPos(2)); + assertEquals("8 key [4]", 2, params.getColumnPos(3)); + assertEquals("8 key [5]", -2, params.getColumnPos(4)); + assertEquals("8 key [6]", 0, params.getColumnPos(5)); + assertEquals("8 key [7]", 1, params.getColumnPos(6)); + assertEquals("8 key [8]", -1, params.getColumnPos(7)); + assertEquals("8 key centering", false, params.mTopRowNeedsCentering); + assertEquals("8 key default", WIDTH * 2, params.getDefaultKeyCoordX()); + } + + // [8] [6] [7] [9] + // [5] [3] [1] [2] [4] + public void testLayout9Key() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 9, MAX_COLUMNS, WIDTH, HEIGHT, + WIDTH * 5, WIDTH * 10); + assertEquals("9 key columns", 5, params.mNumColumns); + assertEquals("9 key rows", 2, params.mNumRows); + assertEquals("9 key left", 2, params.mLeftKeys); + assertEquals("9 key right", 3, params.mRightKeys); + assertEquals("9 key [1]", 0, params.getColumnPos(0)); + assertEquals("9 key [2]", 1, params.getColumnPos(1)); + assertEquals("9 key [3]", -1, params.getColumnPos(2)); + assertEquals("9 key [4]", 2, params.getColumnPos(3)); + assertEquals("9 key [5]", -2, params.getColumnPos(4)); + assertEquals("9 key [6]", 0, params.getColumnPos(5)); + assertEquals("9 key [7]", 1, params.getColumnPos(6)); + assertEquals("9 key [8]", -1, params.getColumnPos(7)); + assertEquals("9 key [9]", 2, params.getColumnPos(8)); + assertEquals("9 key centering", true, params.mTopRowNeedsCentering); + assertEquals("9 key default", WIDTH * 2, params.getDefaultKeyCoordX()); + } + + // Nine keys test. There is no key space for mini keyboard at left of the parent key. + // [6] [7] [8] [9] + // [1] [2] [3] [4] [5] + public void testLayout9KeyLeft() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 9, MAX_COLUMNS, WIDTH, HEIGHT, + 0, WIDTH * 10); + assertEquals("9 key left columns", 5, params.mNumColumns); + assertEquals("9 key left rows", 2, params.mNumRows); + assertEquals("9 key left left", 0, params.mLeftKeys); + assertEquals("9 key left right", 5, params.mRightKeys); + assertEquals("9 key left [1]", 0, params.getColumnPos(0)); + assertEquals("9 key left [2]", 1, params.getColumnPos(1)); + assertEquals("9 key left [3]", 2, params.getColumnPos(2)); + assertEquals("9 key left [4]", 3, params.getColumnPos(3)); + assertEquals("9 key left [5]", 4, params.getColumnPos(4)); + assertEquals("9 key left [6]", 0, params.getColumnPos(5)); + assertEquals("9 key left [7]", 1, params.getColumnPos(6)); + assertEquals("9 key left [8]", 2, params.getColumnPos(7)); + assertEquals("9 key left [9]", 3, params.getColumnPos(8)); + assertEquals("9 key left centering", true, params.mTopRowNeedsCentering); + assertEquals("9 key left default", 0, params.getDefaultKeyCoordX()); + } + + // Nine keys test. There is only one key space for mini keyboard at left of the parent key. + // [8] [6] [7] [9] + // [3] [1] [2] [4] [5] + public void testLayout9KeyNearLeft() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 9, MAX_COLUMNS, WIDTH, HEIGHT, + WIDTH, WIDTH * 10); + assertEquals("9 key near left columns", 5, params.mNumColumns); + assertEquals("9 key near left rows", 2, params.mNumRows); + assertEquals("9 key near left left", 1, params.mLeftKeys); + assertEquals("9 key near left right", 4, params.mRightKeys); + assertEquals("9 key near left [1]", 0, params.getColumnPos(0)); + assertEquals("9 key near left [2]", 1, params.getColumnPos(1)); + assertEquals("9 key near left [3]", -1, params.getColumnPos(2)); + assertEquals("9 key near left [4]", 2, params.getColumnPos(3)); + assertEquals("9 key near left [5]", 3, params.getColumnPos(4)); + assertEquals("9 key near left [6]", 0, params.getColumnPos(5)); + assertEquals("9 key near left [7]", 1, params.getColumnPos(6)); + assertEquals("9 key near left [8]", -1, params.getColumnPos(7)); + assertEquals("9 key near left [9]", 2, params.getColumnPos(8)); + assertEquals("9 key near left centering", true, params.mTopRowNeedsCentering); + assertEquals("9 key near left default", WIDTH, params.getDefaultKeyCoordX()); + } + + + // Nine keys test. There is no key space for mini keyboard at right of the parent key. + // [9] [8] [7] [6] + // [5] [4] [3] [2] [1] + public void testLayout9KeyRight() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 9, MAX_COLUMNS, WIDTH, HEIGHT, + WIDTH * 9, WIDTH * 10); + assertEquals("9 key right columns", 5, params.mNumColumns); + assertEquals("9 key right rows", 2, params.mNumRows); + assertEquals("9 key right left", 4, params.mLeftKeys); + assertEquals("9 key right right", 1, params.mRightKeys); + assertEquals("9 key right [1]", 0, params.getColumnPos(0)); + assertEquals("9 key right [2]", -1, params.getColumnPos(1)); + assertEquals("9 key right [3]", -2, params.getColumnPos(2)); + assertEquals("9 key right [4]", -3, params.getColumnPos(3)); + assertEquals("9 key right [5]", -4, params.getColumnPos(4)); + assertEquals("9 key right [6]", 0, params.getColumnPos(5)); + assertEquals("9 key right [7]", -1, params.getColumnPos(6)); + assertEquals("9 key right [8]", -2, params.getColumnPos(7)); + assertEquals("9 key right [9]", -3, params.getColumnPos(8)); + assertEquals("9 key right centering", true, params.mTopRowNeedsCentering); + assertEquals("9 key right default", WIDTH * 4, params.getDefaultKeyCoordX()); + } + + // Nine keys test. There is only one key space for mini keyboard at right of the parent key. + // [9] [8] [6] [7] + // [5] [4] [3] [1] [2] + public void testLayout9KeyNearRight() { + MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams( + 9, MAX_COLUMNS, WIDTH, HEIGHT, + WIDTH * 8, WIDTH * 10); + assertEquals("9 key near right columns", 5, params.mNumColumns); + assertEquals("9 key near right rows", 2, params.mNumRows); + assertEquals("9 key near right left", 3, params.mLeftKeys); + assertEquals("9 key near right right", 2, params.mRightKeys); + assertEquals("9 key near right [1]", 0, params.getColumnPos(0)); + assertEquals("9 key near right [2]", 1, params.getColumnPos(1)); + assertEquals("9 key near right [3]", -1, params.getColumnPos(2)); + assertEquals("9 key near right [4]", -2, params.getColumnPos(3)); + assertEquals("9 key near right [5]", -3, params.getColumnPos(4)); + assertEquals("9 key near right [6]", 0, params.getColumnPos(5)); + assertEquals("9 key near right [7]", 1, params.getColumnPos(6)); + assertEquals("9 key near right [8]", -1, params.getColumnPos(7)); + assertEquals("9 key near right [9]", -2, params.getColumnPos(8)); + assertEquals("9 key near right centering", true, params.mTopRowNeedsCentering); + assertEquals("9 key near right default", WIDTH * 3, params.getDefaultKeyCoordX()); + } +} diff --git a/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java b/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java index 004ddb61a..e1c3678fd 100644 --- a/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java +++ b/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java @@ -33,19 +33,6 @@ public class SubtypeLocaleTests extends AndroidTestCase { private Resources mRes; private List<InputMethodSubtype> mKeyboardSubtypes; - public interface Predicator<T> { - public boolean evaluate(T object); - } - - private static <T> List<T> filter(List<T> source, Predicator<? super T> predicator) { - final ArrayList<T> filtered = new ArrayList<T>(); - for (final T element : source) { - if (predicator.evaluate(element)) - filtered.add(element); - } - return filtered; - } - @Override protected void setUp() throws Exception { super.setUp(); @@ -59,13 +46,13 @@ public class SubtypeLocaleTests extends AndroidTestCase { Context.INPUT_METHOD_SERVICE); for (final InputMethodInfo imi : imm.getInputMethodList()) { if (imi.getPackageName().equals(PACKAGE)) { - mKeyboardSubtypes = filter(imi.getSubtypes(), - new Predicator<InputMethodSubtype>() { - @Override - public boolean evaluate(InputMethodSubtype ims) { - return ims.getMode().equals("keyboard"); - } - }); + final int subtypeCount = imi.getSubtypeCount(); + for (int i = 0; i < subtypeCount; ++i) { + InputMethodSubtype subtype = imi.getSubtypeAt(i); + if (subtype.getMode().equals("keyboard")) { + mKeyboardSubtypes.add(subtype); + } + } break; } } diff --git a/tests/src/com/android/inputmethod/latin/SuggestHelper.java b/tests/src/com/android/inputmethod/latin/SuggestHelper.java index de898c3ea..bcc0d6cde 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestHelper.java +++ b/tests/src/com/android/inputmethod/latin/SuggestHelper.java @@ -41,7 +41,7 @@ public class SuggestHelper { public SuggestHelper(String tag, Context context, int resId) { TAG = tag; mSuggest = new Suggest(context, resId); - mSuggest.setAutoTextEnabled(false); + mSuggest.setQuickFixesEnabled(false); mSuggest.setCorrectionMode(Suggest.CORRECTION_FULL_BIGRAM); } @@ -98,7 +98,7 @@ public class SuggestHelper { boolean isDefaultCorrection(CharSequence typed, CharSequence expected) { WordComposer word = createWordComposer(typed); SuggestedWords suggestions = mSuggest.getSuggestions(null, word, null); - return isDefaultSuggestion(suggestions, expected) && mSuggest.hasMinimalCorrection(); + return isDefaultSuggestion(suggestions, expected) && mSuggest.hasAutoCorrection(); } boolean isASuggestion(CharSequence typed, CharSequence expected) { @@ -130,7 +130,7 @@ public class SuggestHelper { WordComposer word = createWordComposer(typed); getBigramSuggestions(previous, typed); SuggestedWords suggestions = mSuggest.getSuggestions(null, word, previous); - return isDefaultSuggestion(suggestions, expected) && mSuggest.hasMinimalCorrection(); + return isDefaultSuggestion(suggestions, expected) && mSuggest.hasAutoCorrection(); } boolean isASuggestion(CharSequence previous, CharSequence typed, |