diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-29 21:52:42 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-29 21:52:42 -0700 |
commit | d33f2e4bf1660146f1d9610f48975d66f638126c (patch) | |
tree | fb2ac65c09f25b378e006c891113a3fefe149142 | |
parent | 7898d76cc005bbe1c5893a9f57439561e0771cc8 (diff) | |
download | PinyinIME-d33f2e4bf1660146f1d9610f48975d66f638126c.tar.gz |
reconciled
-rw-r--r-- | Android.mk | 26 | ||||
-rw-r--r-- | AndroidManifest.xml (renamed from PinyinIME/AndroidManifest.xml) | 0 | ||||
-rw-r--r-- | PinyinIME/Android.mk | 25 | ||||
-rw-r--r-- | jni/Android.mk (renamed from PinyinIME/jni/Android.mk) | 0 | ||||
-rw-r--r-- | jni/android/com_android_inputmethod_pinyin_PinyinDecoderService.cpp (renamed from PinyinIME/jni/android/com_android_inputmethod_pinyin_PinyinDecoderService.cpp) | 46 | ||||
-rw-r--r-- | jni/command/Makefile (renamed from PinyinIME/jni/command/Makefile) | 0 | ||||
-rw-r--r-- | jni/command/pinyinime_dictbuilder.cpp (renamed from PinyinIME/jni/command/pinyinime_dictbuilder.cpp) | 0 | ||||
-rw-r--r-- | jni/data/rawdict_utf16_65105_freq.txt (renamed from PinyinIME/jni/data/rawdict_utf16_65105_freq.txt) | bin | 3570346 -> 3570346 bytes | |||
-rw-r--r-- | jni/data/valid_utf16.txt (renamed from PinyinIME/jni/data/valid_utf16.txt) | bin | 32934 -> 32934 bytes | |||
-rw-r--r-- | jni/include/atomdictbase.h (renamed from PinyinIME/jni/include/atomdictbase.h) | 0 | ||||
-rw-r--r-- | jni/include/dictbuilder.h (renamed from PinyinIME/jni/include/dictbuilder.h) | 0 | ||||
-rw-r--r-- | jni/include/dictdef.h (renamed from PinyinIME/jni/include/dictdef.h) | 0 | ||||
-rw-r--r-- | jni/include/dictlist.h (renamed from PinyinIME/jni/include/dictlist.h) | 0 | ||||
-rw-r--r-- | jni/include/dicttrie.h (renamed from PinyinIME/jni/include/dicttrie.h) | 0 | ||||
-rw-r--r-- | jni/include/lpicache.h (renamed from PinyinIME/jni/include/lpicache.h) | 0 | ||||
-rw-r--r-- | jni/include/matrixsearch.h (renamed from PinyinIME/jni/include/matrixsearch.h) | 3 | ||||
-rw-r--r-- | jni/include/mystdlib.h (renamed from PinyinIME/jni/include/mystdlib.h) | 0 | ||||
-rw-r--r-- | jni/include/ngram.h (renamed from PinyinIME/jni/include/ngram.h) | 0 | ||||
-rw-r--r-- | jni/include/pinyinime.h (renamed from PinyinIME/jni/include/pinyinime.h) | 0 | ||||
-rw-r--r-- | jni/include/searchutility.h (renamed from PinyinIME/jni/include/searchutility.h) | 0 | ||||
-rw-r--r-- | jni/include/spellingtable.h (renamed from PinyinIME/jni/include/spellingtable.h) | 0 | ||||
-rw-r--r-- | jni/include/spellingtrie.h (renamed from PinyinIME/jni/include/spellingtrie.h) | 0 | ||||
-rw-r--r-- | jni/include/splparser.h (renamed from PinyinIME/jni/include/splparser.h) | 0 | ||||
-rw-r--r-- | jni/include/sync.h (renamed from PinyinIME/jni/include/sync.h) | 0 | ||||
-rw-r--r-- | jni/include/userdict.h (renamed from PinyinIME/jni/include/userdict.h) | 0 | ||||
-rw-r--r-- | jni/include/utf16char.h (renamed from PinyinIME/jni/include/utf16char.h) | 0 | ||||
-rw-r--r-- | jni/include/utf16reader.h (renamed from PinyinIME/jni/include/utf16reader.h) | 0 | ||||
-rw-r--r-- | jni/share/dictbuilder.cpp (renamed from PinyinIME/jni/share/dictbuilder.cpp) | 10 | ||||
-rw-r--r-- | jni/share/dictlist.cpp (renamed from PinyinIME/jni/share/dictlist.cpp) | 0 | ||||
-rw-r--r-- | jni/share/dicttrie.cpp (renamed from PinyinIME/jni/share/dicttrie.cpp) | 0 | ||||
-rw-r--r-- | jni/share/lpicache.cpp (renamed from PinyinIME/jni/share/lpicache.cpp) | 0 | ||||
-rw-r--r-- | jni/share/matrixsearch.cpp (renamed from PinyinIME/jni/share/matrixsearch.cpp) | 101 | ||||
-rw-r--r-- | jni/share/mystdlib.cpp (renamed from PinyinIME/jni/share/mystdlib.cpp) | 0 | ||||
-rw-r--r-- | jni/share/ngram.cpp (renamed from PinyinIME/jni/share/ngram.cpp) | 0 | ||||
-rw-r--r-- | jni/share/pinyinime.cpp (renamed from PinyinIME/jni/share/pinyinime.cpp) | 0 | ||||
-rw-r--r-- | jni/share/searchutility.cpp (renamed from PinyinIME/jni/share/searchutility.cpp) | 0 | ||||
-rw-r--r-- | jni/share/spellingtable.cpp (renamed from PinyinIME/jni/share/spellingtable.cpp) | 0 | ||||
-rw-r--r-- | jni/share/spellingtrie.cpp (renamed from PinyinIME/jni/share/spellingtrie.cpp) | 0 | ||||
-rw-r--r-- | jni/share/splparser.cpp (renamed from PinyinIME/jni/share/splparser.cpp) | 0 | ||||
-rw-r--r-- | jni/share/sync.cpp (renamed from PinyinIME/jni/share/sync.cpp) | 0 | ||||
-rw-r--r-- | jni/share/userdict.cpp (renamed from PinyinIME/jni/share/userdict.cpp) | 0 | ||||
-rw-r--r-- | jni/share/utf16char.cpp (renamed from PinyinIME/jni/share/utf16char.cpp) | 0 | ||||
-rw-r--r-- | jni/share/utf16reader.cpp (renamed from PinyinIME/jni/share/utf16reader.cpp) | 0 | ||||
-rw-r--r-- | lib/Android.mk (renamed from PinyinIME/lib/Android.mk) | 0 | ||||
-rw-r--r-- | lib/com/android/inputmethod/pinyin/IPinyinDecoderService.aidl (renamed from PinyinIME/lib/com/android/inputmethod/pinyin/IPinyinDecoderService.aidl) | 0 | ||||
-rw-r--r-- | res/drawable/app_icon.png (renamed from PinyinIME/res/drawable/app_icon.png) | bin | 4707 -> 4707 bytes | |||
-rw-r--r-- | res/drawable/arrow_bg.xml (renamed from PinyinIME/res/drawable/arrow_bg.xml) | 0 | ||||
-rw-r--r-- | res/drawable/arrow_left.png (renamed from PinyinIME/res/drawable/arrow_left.png) | bin | 362 -> 362 bytes | |||
-rw-r--r-- | res/drawable/arrow_right.png (renamed from PinyinIME/res/drawable/arrow_right.png) | bin | 365 -> 365 bytes | |||
-rw-r--r-- | res/drawable/candidate_balloon_bg.9.png (renamed from PinyinIME/res/drawable/candidate_balloon_bg.9.png) | bin | 593 -> 593 bytes | |||
-rw-r--r-- | res/drawable/candidate_hl_bg.9.png (renamed from PinyinIME/res/drawable/candidate_hl_bg.9.png) | bin | 784 -> 784 bytes | |||
-rw-r--r-- | res/drawable/candidates_area_bg.9.png (renamed from PinyinIME/res/drawable/candidates_area_bg.9.png) | bin | 198 -> 198 bytes | |||
-rw-r--r-- | res/drawable/candidates_vertical_line.png (renamed from PinyinIME/res/drawable/candidates_vertical_line.png) | bin | 130 -> 130 bytes | |||
-rw-r--r-- | res/drawable/cands_container_bg.9.png (renamed from PinyinIME/res/drawable/cands_container_bg.9.png) | bin | 151 -> 151 bytes | |||
-rw-r--r-- | res/drawable/comma_full_icon.png (renamed from PinyinIME/res/drawable/comma_full_icon.png) | bin | 170 -> 170 bytes | |||
-rw-r--r-- | res/drawable/comma_full_popup_icon.png (renamed from PinyinIME/res/drawable/comma_full_popup_icon.png) | bin | 226 -> 226 bytes | |||
-rw-r--r-- | res/drawable/composing_area_bg.9.png (renamed from PinyinIME/res/drawable/composing_area_bg.9.png) | bin | 353 -> 353 bytes | |||
-rw-r--r-- | res/drawable/composing_area_cursor.png (renamed from PinyinIME/res/drawable/composing_area_cursor.png) | bin | 140 -> 140 bytes | |||
-rw-r--r-- | res/drawable/composing_hl_bg.9.png (renamed from PinyinIME/res/drawable/composing_hl_bg.9.png) | bin | 711 -> 711 bytes | |||
-rw-r--r-- | res/drawable/delete_icon.png (renamed from PinyinIME/res/drawable/delete_icon.png) | bin | 1366 -> 1366 bytes | |||
-rw-r--r-- | res/drawable/delete_popup_icon.png (renamed from PinyinIME/res/drawable/delete_popup_icon.png) | bin | 524 -> 524 bytes | |||
-rw-r--r-- | res/drawable/dun_icon.png (renamed from PinyinIME/res/drawable/dun_icon.png) | bin | 175 -> 175 bytes | |||
-rw-r--r-- | res/drawable/dun_popup_icon.png (renamed from PinyinIME/res/drawable/dun_popup_icon.png) | bin | 252 -> 252 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_00.png (renamed from PinyinIME/res/drawable/emotion_icon_00.png) | bin | 322 -> 322 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_00_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_00_popup.png) | bin | 477 -> 477 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_01.png (renamed from PinyinIME/res/drawable/emotion_icon_01.png) | bin | 342 -> 342 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_01_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_01_popup.png) | bin | 531 -> 531 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_02.png (renamed from PinyinIME/res/drawable/emotion_icon_02.png) | bin | 336 -> 336 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_02_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_02_popup.png) | bin | 486 -> 486 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_03.png (renamed from PinyinIME/res/drawable/emotion_icon_03.png) | bin | 384 -> 384 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_03_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_03_popup.png) | bin | 494 -> 494 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_04.png (renamed from PinyinIME/res/drawable/emotion_icon_04.png) | bin | 344 -> 344 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_04_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_04_popup.png) | bin | 444 -> 444 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_05.png (renamed from PinyinIME/res/drawable/emotion_icon_05.png) | bin | 499 -> 499 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_05_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_05_popup.png) | bin | 657 -> 657 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_06.png (renamed from PinyinIME/res/drawable/emotion_icon_06.png) | bin | 333 -> 333 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_06_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_06_popup.png) | bin | 492 -> 492 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_10.png (renamed from PinyinIME/res/drawable/emotion_icon_10.png) | bin | 342 -> 342 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_10_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_10_popup.png) | bin | 481 -> 481 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_11.png (renamed from PinyinIME/res/drawable/emotion_icon_11.png) | bin | 374 -> 374 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_11_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_11_popup.png) | bin | 557 -> 557 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_12.png (renamed from PinyinIME/res/drawable/emotion_icon_12.png) | bin | 365 -> 365 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_12_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_12_popup.png) | bin | 534 -> 534 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_13.png (renamed from PinyinIME/res/drawable/emotion_icon_13.png) | bin | 371 -> 371 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_13_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_13_popup.png) | bin | 583 -> 583 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_14.png (renamed from PinyinIME/res/drawable/emotion_icon_14.png) | bin | 195 -> 195 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_14_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_14_popup.png) | bin | 229 -> 229 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_15.png (renamed from PinyinIME/res/drawable/emotion_icon_15.png) | bin | 260 -> 260 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_15_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_15_popup.png) | bin | 291 -> 291 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_16.png (renamed from PinyinIME/res/drawable/emotion_icon_16.png) | bin | 230 -> 230 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_16_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_16_popup.png) | bin | 295 -> 295 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_20.png (renamed from PinyinIME/res/drawable/emotion_icon_20.png) | bin | 199 -> 199 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_20_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_20_popup.png) | bin | 251 -> 251 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_21.png (renamed from PinyinIME/res/drawable/emotion_icon_21.png) | bin | 468 -> 468 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_21_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_21_popup.png) | bin | 731 -> 731 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_22.png (renamed from PinyinIME/res/drawable/emotion_icon_22.png) | bin | 328 -> 328 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_22_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_22_popup.png) | bin | 421 -> 421 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_23.png (renamed from PinyinIME/res/drawable/emotion_icon_23.png) | bin | 225 -> 225 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_23_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_23_popup.png) | bin | 257 -> 257 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_24.png (renamed from PinyinIME/res/drawable/emotion_icon_24.png) | bin | 428 -> 428 bytes | |||
-rw-r--r-- | res/drawable/emotion_icon_24_popup.png (renamed from PinyinIME/res/drawable/emotion_icon_24_popup.png) | bin | 540 -> 540 bytes | |||
-rw-r--r-- | res/drawable/enter_icon.png (renamed from PinyinIME/res/drawable/enter_icon.png) | bin | 866 -> 866 bytes | |||
-rw-r--r-- | res/drawable/enter_popup_icon.png (renamed from PinyinIME/res/drawable/enter_popup_icon.png) | bin | 381 -> 381 bytes | |||
-rw-r--r-- | res/drawable/ime_en.png (renamed from PinyinIME/res/drawable/ime_en.png) | bin | 908 -> 908 bytes | |||
-rw-r--r-- | res/drawable/ime_pinyin.png (renamed from PinyinIME/res/drawable/ime_pinyin.png) | bin | 969 -> 969 bytes | |||
-rw-r--r-- | res/drawable/key_balloon_bg.9.png (renamed from PinyinIME/res/drawable/key_balloon_bg.9.png) | bin | 737 -> 737 bytes | |||
-rw-r--r-- | res/drawable/light_key_bg.9.png (renamed from PinyinIME/res/drawable/light_key_bg.9.png) | bin | 860 -> 860 bytes | |||
-rw-r--r-- | res/drawable/light_key_hl_bg.9.png (renamed from PinyinIME/res/drawable/light_key_hl_bg.9.png) | bin | 836 -> 836 bytes | |||
-rw-r--r-- | res/drawable/light_key_up_bg.9.png (renamed from PinyinIME/res/drawable/light_key_up_bg.9.png) | bin | 926 -> 926 bytes | |||
-rw-r--r-- | res/drawable/light_key_up_hl_bg.9.png (renamed from PinyinIME/res/drawable/light_key_up_hl_bg.9.png) | bin | 886 -> 886 bytes | |||
-rw-r--r-- | res/drawable/miniskb_bg.9.png (renamed from PinyinIME/res/drawable/miniskb_bg.9.png) | bin | 516 -> 516 bytes | |||
-rw-r--r-- | res/drawable/normal_key_bg.9.png (renamed from PinyinIME/res/drawable/normal_key_bg.9.png) | bin | 726 -> 726 bytes | |||
-rw-r--r-- | res/drawable/normal_key_hl_bg.9.png (renamed from PinyinIME/res/drawable/normal_key_hl_bg.9.png) | bin | 664 -> 664 bytes | |||
-rw-r--r-- | res/drawable/num0.png (renamed from PinyinIME/res/drawable/num0.png) | bin | 1160 -> 1160 bytes | |||
-rw-r--r-- | res/drawable/num1.png (renamed from PinyinIME/res/drawable/num1.png) | bin | 506 -> 506 bytes | |||
-rw-r--r-- | res/drawable/num2.png (renamed from PinyinIME/res/drawable/num2.png) | bin | 1778 -> 1778 bytes | |||
-rw-r--r-- | res/drawable/num3.png (renamed from PinyinIME/res/drawable/num3.png) | bin | 1676 -> 1676 bytes | |||
-rw-r--r-- | res/drawable/num4.png (renamed from PinyinIME/res/drawable/num4.png) | bin | 1540 -> 1540 bytes | |||
-rw-r--r-- | res/drawable/num5.png (renamed from PinyinIME/res/drawable/num5.png) | bin | 1417 -> 1417 bytes | |||
-rw-r--r-- | res/drawable/num6.png (renamed from PinyinIME/res/drawable/num6.png) | bin | 1952 -> 1952 bytes | |||
-rw-r--r-- | res/drawable/num7.png (renamed from PinyinIME/res/drawable/num7.png) | bin | 1997 -> 1997 bytes | |||
-rw-r--r-- | res/drawable/num8.png (renamed from PinyinIME/res/drawable/num8.png) | bin | 1605 -> 1605 bytes | |||
-rw-r--r-- | res/drawable/num9.png (renamed from PinyinIME/res/drawable/num9.png) | bin | 2173 -> 2173 bytes | |||
-rw-r--r-- | res/drawable/numalt.png (renamed from PinyinIME/res/drawable/numalt.png) | bin | 1673 -> 1673 bytes | |||
-rw-r--r-- | res/drawable/numpound.png (renamed from PinyinIME/res/drawable/numpound.png) | bin | 963 -> 963 bytes | |||
-rw-r--r-- | res/drawable/numstar.png (renamed from PinyinIME/res/drawable/numstar.png) | bin | 954 -> 954 bytes | |||
-rw-r--r-- | res/drawable/period_full_icon.png (renamed from PinyinIME/res/drawable/period_full_icon.png) | bin | 182 -> 182 bytes | |||
-rw-r--r-- | res/drawable/period_full_popup_icon.png (renamed from PinyinIME/res/drawable/period_full_popup_icon.png) | bin | 233 -> 233 bytes | |||
-rw-r--r-- | res/drawable/period_icon.png (renamed from PinyinIME/res/drawable/period_icon.png) | bin | 154 -> 154 bytes | |||
-rw-r--r-- | res/drawable/period_popup_icon.png (renamed from PinyinIME/res/drawable/period_popup_icon.png) | bin | 183 -> 183 bytes | |||
-rw-r--r-- | res/drawable/search_icon.png (renamed from PinyinIME/res/drawable/search_icon.png) | bin | 1029 -> 1029 bytes | |||
-rw-r--r-- | res/drawable/search_popup_icon.png (renamed from PinyinIME/res/drawable/search_popup_icon.png) | bin | 501 -> 501 bytes | |||
-rw-r--r-- | res/drawable/shift_off_icon.png (renamed from PinyinIME/res/drawable/shift_off_icon.png) | bin | 1017 -> 1017 bytes | |||
-rw-r--r-- | res/drawable/shift_off_popup_icon.png (renamed from PinyinIME/res/drawable/shift_off_popup_icon.png) | bin | 437 -> 437 bytes | |||
-rw-r--r-- | res/drawable/shift_on_icon.png (renamed from PinyinIME/res/drawable/shift_on_icon.png) | bin | 799 -> 799 bytes | |||
-rw-r--r-- | res/drawable/shift_on_popup_icon.png (renamed from PinyinIME/res/drawable/shift_on_popup_icon.png) | bin | 333 -> 333 bytes | |||
-rw-r--r-- | res/drawable/skb_bg.png (renamed from PinyinIME/res/drawable/skb_bg.png) | bin | 128 -> 128 bytes | |||
-rw-r--r-- | res/drawable/skb_container_bg.9.png (renamed from PinyinIME/res/drawable/skb_container_bg.9.png) | bin | 156 -> 156 bytes | |||
-rw-r--r-- | res/drawable/smiley_icon.png (renamed from PinyinIME/res/drawable/smiley_icon.png) | bin | 668 -> 668 bytes | |||
-rw-r--r-- | res/drawable/smiley_popup_icon.png (renamed from PinyinIME/res/drawable/smiley_popup_icon.png) | bin | 981 -> 981 bytes | |||
-rw-r--r-- | res/drawable/space_icon.png (renamed from PinyinIME/res/drawable/space_icon.png) | bin | 424 -> 424 bytes | |||
-rw-r--r-- | res/drawable/space_popup_icon.png (renamed from PinyinIME/res/drawable/space_popup_icon.png) | bin | 223 -> 223 bytes | |||
-rw-r--r-- | res/layout/candidates_container.xml (renamed from PinyinIME/res/layout/candidates_container.xml) | 0 | ||||
-rw-r--r-- | res/layout/floating_container.xml (renamed from PinyinIME/res/layout/floating_container.xml) | 0 | ||||
-rw-r--r-- | res/layout/skb_container.xml (renamed from PinyinIME/res/layout/skb_container.xml) | 0 | ||||
-rw-r--r-- | res/raw/dict_pinyin.dat (renamed from PinyinIME/res/raw/dict_pinyin.dat) | bin | 1068442 -> 1068442 bytes | |||
-rw-r--r-- | res/values-land/dimens.xml (renamed from PinyinIME/res/values-land/dimens.xml) | 0 | ||||
-rw-r--r-- | res/values-port/dimens.xml (renamed from PinyinIME/res/values-port/dimens.xml) | 0 | ||||
-rw-r--r-- | res/values-zh/bools.xml (renamed from PinyinIME/res/values-zh/bools.xml) | 0 | ||||
-rw-r--r-- | res/values/colors.xml (renamed from PinyinIME/res/values/colors.xml) | 0 | ||||
-rw-r--r-- | res/values/dimens.xml (renamed from PinyinIME/res/values/dimens.xml) | 0 | ||||
-rw-r--r-- | res/values/strings.xml (renamed from PinyinIME/res/values/strings.xml) | 0 | ||||
-rw-r--r-- | res/xml/method.xml (renamed from PinyinIME/res/xml/method.xml) | 0 | ||||
-rw-r--r-- | res/xml/settings.xml (renamed from PinyinIME/res/xml/settings.xml) | 0 | ||||
-rw-r--r-- | res/xml/skb_phone.xml (renamed from PinyinIME/res/xml/skb_phone.xml) | 0 | ||||
-rw-r--r-- | res/xml/skb_qwerty.xml (renamed from PinyinIME/res/xml/skb_qwerty.xml) | 0 | ||||
-rw-r--r-- | res/xml/skb_smiley.xml (renamed from PinyinIME/res/xml/skb_smiley.xml) | 0 | ||||
-rw-r--r-- | res/xml/skb_sym1.xml (renamed from PinyinIME/res/xml/skb_sym1.xml) | 0 | ||||
-rw-r--r-- | res/xml/skb_sym2.xml (renamed from PinyinIME/res/xml/skb_sym2.xml) | 0 | ||||
-rw-r--r-- | res/xml/skb_template1.xml (renamed from PinyinIME/res/xml/skb_template1.xml) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/BalloonHint.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/BalloonHint.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/CandidateView.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/CandidateView.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/CandidateViewListener.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/CandidateViewListener.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/CandidatesContainer.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/CandidatesContainer.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/ComposingView.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/ComposingView.java) | 1 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/EnglishInputProcessor.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/EnglishInputProcessor.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/Environment.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/Environment.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/InputModeSwitcher.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/InputModeSwitcher.java) | 26 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/KeyMapDream.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/KeyMapDream.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/PinyinDecoderService.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/PinyinDecoderService.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/PinyinIME.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/PinyinIME.java) | 103 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/Settings.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/Settings.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/SettingsActivity.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/SettingsActivity.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/SkbContainer.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/SkbContainer.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/SkbPool.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/SkbPool.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/SkbTemplate.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/SkbTemplate.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/SoftKey.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/SoftKey.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/SoftKeyToggle.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/SoftKeyToggle.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/SoftKeyboard.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/SoftKeyboard.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/SoftKeyboardView.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/SoftKeyboardView.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/SoundManager.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/SoundManager.java) | 0 | ||||
-rw-r--r-- | src/com/android/inputmethod/pinyin/XmlKeyboardLoader.java (renamed from PinyinIME/src/com/android/inputmethod/pinyin/XmlKeyboardLoader.java) | 0 |
182 files changed, 238 insertions, 103 deletions
@@ -1 +1,25 @@ -include $(call all-subdir-makefiles) +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(call all-subdir-java-files) + +LOCAL_PACKAGE_NAME := PinyinIME + +LOCAL_JNI_SHARED_LIBRARIES := libjni_pinyinime + +LOCAL_STATIC_JAVA_LIBRARIES := com.android.inputmethod.pinyin.lib + +LOCAL_CERTIFICATE := shared + +# Make sure our dictionary file is not compressed, so we can read it with +# a raw file descriptor. +LOCAL_AAPT_FLAGS := -0 .dat + +include $(BUILD_PACKAGE) + +MY_PATH := $(LOCAL_PATH) + +include $(MY_PATH)/jni/Android.mk +include $(MY_PATH)/lib/Android.mk diff --git a/PinyinIME/AndroidManifest.xml b/AndroidManifest.xml index e1ca30d..e1ca30d 100644 --- a/PinyinIME/AndroidManifest.xml +++ b/AndroidManifest.xml diff --git a/PinyinIME/Android.mk b/PinyinIME/Android.mk deleted file mode 100644 index 64224ae..0000000 --- a/PinyinIME/Android.mk +++ /dev/null @@ -1,25 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - $(call all-subdir-java-files) - -LOCAL_PACKAGE_NAME := PinyinIME - -LOCAL_JNI_SHARED_LIBRARIES := libjni_pinyinime - -LOCAL_STATIC_JAVA_LIBRARIES := com.android.inputmethod.pinyin.lib - -LOCAL_CERTIFICATE := shared - -# Make sure our dictionary file is not compressed, so we can read it with -# a raw file descriptor. -LOCAL_AAPT_FLAGS := -0 .dat - -include $(BUILD_PACKAGE) - -MY_PATH := $(LOCAL_PATH) - -include $(MY_PATH)/jni/Android.mk -include $(MY_PATH)/lib/Android.mk diff --git a/PinyinIME/jni/Android.mk b/jni/Android.mk index 141a0b7..141a0b7 100644 --- a/PinyinIME/jni/Android.mk +++ b/jni/Android.mk diff --git a/PinyinIME/jni/android/com_android_inputmethod_pinyin_PinyinDecoderService.cpp b/jni/android/com_android_inputmethod_pinyin_PinyinDecoderService.cpp index 4362c30..dcb63a1 100644 --- a/PinyinIME/jni/android/com_android_inputmethod_pinyin_PinyinDecoderService.cpp +++ b/jni/android/com_android_inputmethod_pinyin_PinyinDecoderService.cpp @@ -51,10 +51,15 @@ JNIEXPORT jboolean JNICALL nativeImOpenDecoder(JNIEnv* env, jclass jclazz, jbyte *fsd = (*env).GetByteArrayElements(fn_sys_dict, 0); jbyte *fud = (*env).GetByteArrayElements(fn_usr_dict, 0); + jboolean jret = JNI_FALSE; + if (im_open_decoder((const char*)fsd, (const char*)fud)) - return JNI_TRUE; + jret = JNI_TRUE; - return JNI_FALSE; + (*env).ReleaseByteArrayElements(fn_sys_dict, fsd, 0); + (*env).ReleaseByteArrayElements(fn_usr_dict, fud, 0); + + return jret; } JNIEXPORT jboolean JNICALL nativeImOpenDecoderFd(JNIEnv* env, jclass jclazz, @@ -65,14 +70,17 @@ JNIEXPORT jboolean JNICALL nativeImOpenDecoderFd(JNIEnv* env, jclass jclazz, jint fd = env->GetIntField(fd_sys_dict, gFileDescriptorOffsets.mDescriptor); jbyte *fud = (*env).GetByteArrayElements(fn_usr_dict, 0); + jboolean jret = JNI_FALSE; + int newfd = dup(fd); - if (im_open_decoder_fd(newfd, startoffset, length, (const char*)fud)) { - close(newfd); - return JNI_TRUE; - } + if (im_open_decoder_fd(newfd, startoffset, length, (const char*)fud)) + jret = JNI_TRUE; close(newfd); - return JNI_FALSE; + + (*env).ReleaseByteArrayElements(fn_usr_dict, fud, 0); + + return jret; } JNIEXPORT void JNICALL nativeImSetMaxLens(JNIEnv* env, jclass jclazz, @@ -92,10 +100,14 @@ JNIEXPORT jint JNICALL nativeImSearch(JNIEnv* env, jclass jclazz, jbyteArray pybuf, jint pylen) { jbyte *array_body = (*env).GetByteArrayElements(pybuf, 0); - if (NULL == array_body) - return 0; + jint jret = 0; + if (NULL != array_body) { + jret = im_search((const char*)array_body, pylen); + } + + (*env).ReleaseByteArrayElements(pybuf, array_body, 0); - return im_search((const char*)array_body, pylen); + return jret; } JNIEXPORT jint JNICALL nativeImDelSearch(JNIEnv* env, jclass jclazz, jint pos, @@ -157,6 +169,9 @@ JNIEXPORT jintArray JNICALL nativeImGetSplStart(JNIEnv* env, jclass jclazz) { arr_body[0] = len; // element 0 is used to store the length of buffer. for (size_t i = 0; i <= len; i++) arr_body[i + 1] = spl_start[i]; + + (*env).ReleaseIntArrayElements(arr, arr_body, 0); + return arr; } @@ -213,6 +228,8 @@ JNIEXPORT jint JNICALL nativeImGetPredictsNum(JNIEnv *env, jclass clazz, predict_len = im_get_predicts(fixed_buf, predict_buf); + (*env).ReleaseStringChars(fixed_str, fixed_ptr); + return predict_len; } @@ -232,9 +249,14 @@ JNIEXPORT jstring JNICALL nativeImGetPredictItem(JNIEnv *env, jclass clazz, JNIEXPORT jboolean JNICALL nativeSyncBegin(JNIEnv *env, jclass clazz, jbyteArray dict_file) { jbyte *file_name = (*env).GetByteArrayElements(dict_file, 0); + + jboolean jret = JNI_FALSE; if (true == sync_worker.begin((const char *)file_name)) - return JNI_TRUE; - return JNI_FALSE; + jret = JNI_TRUE; + + (*env).ReleaseByteArrayElements(dict_file, file_name, 0); + + return jret; } JNIEXPORT jboolean JNICALL nativeSyncFinish(JNIEnv *env, jclass clazz) { diff --git a/PinyinIME/jni/command/Makefile b/jni/command/Makefile index 0722932..0722932 100644 --- a/PinyinIME/jni/command/Makefile +++ b/jni/command/Makefile diff --git a/PinyinIME/jni/command/pinyinime_dictbuilder.cpp b/jni/command/pinyinime_dictbuilder.cpp index b7f9606..b7f9606 100644 --- a/PinyinIME/jni/command/pinyinime_dictbuilder.cpp +++ b/jni/command/pinyinime_dictbuilder.cpp diff --git a/PinyinIME/jni/data/rawdict_utf16_65105_freq.txt b/jni/data/rawdict_utf16_65105_freq.txt Binary files differindex 28805ba..28805ba 100644 --- a/PinyinIME/jni/data/rawdict_utf16_65105_freq.txt +++ b/jni/data/rawdict_utf16_65105_freq.txt diff --git a/PinyinIME/jni/data/valid_utf16.txt b/jni/data/valid_utf16.txt Binary files differindex fecc67e..fecc67e 100644 --- a/PinyinIME/jni/data/valid_utf16.txt +++ b/jni/data/valid_utf16.txt diff --git a/PinyinIME/jni/include/atomdictbase.h b/jni/include/atomdictbase.h index 0a70a51..0a70a51 100644 --- a/PinyinIME/jni/include/atomdictbase.h +++ b/jni/include/atomdictbase.h diff --git a/PinyinIME/jni/include/dictbuilder.h b/jni/include/dictbuilder.h index da0d6cd..da0d6cd 100644 --- a/PinyinIME/jni/include/dictbuilder.h +++ b/jni/include/dictbuilder.h diff --git a/PinyinIME/jni/include/dictdef.h b/jni/include/dictdef.h index 3e79d98..3e79d98 100644 --- a/PinyinIME/jni/include/dictdef.h +++ b/jni/include/dictdef.h diff --git a/PinyinIME/jni/include/dictlist.h b/jni/include/dictlist.h index 5fcc12f..5fcc12f 100644 --- a/PinyinIME/jni/include/dictlist.h +++ b/jni/include/dictlist.h diff --git a/PinyinIME/jni/include/dicttrie.h b/jni/include/dicttrie.h index 268624f..268624f 100644 --- a/PinyinIME/jni/include/dicttrie.h +++ b/jni/include/dicttrie.h diff --git a/PinyinIME/jni/include/lpicache.h b/jni/include/lpicache.h index 6073597..6073597 100644 --- a/PinyinIME/jni/include/lpicache.h +++ b/jni/include/lpicache.h diff --git a/PinyinIME/jni/include/matrixsearch.h b/jni/include/matrixsearch.h index b9cf061..f581d30 100644 --- a/PinyinIME/jni/include/matrixsearch.h +++ b/jni/include/matrixsearch.h @@ -250,6 +250,9 @@ class MatrixSearch { void free_resource(); + // Reset the search space totally. + bool reset_search0(); + // Reset the search space from ch_pos step. For example, if the original // input Pinyin is "an", reset_search(1) will reset the search space to the // result of "a". If the given position is out of range, return false. diff --git a/PinyinIME/jni/include/mystdlib.h b/jni/include/mystdlib.h index dfcf980..dfcf980 100644 --- a/PinyinIME/jni/include/mystdlib.h +++ b/jni/include/mystdlib.h diff --git a/PinyinIME/jni/include/ngram.h b/jni/include/ngram.h index ad6c304..ad6c304 100644 --- a/PinyinIME/jni/include/ngram.h +++ b/jni/include/ngram.h diff --git a/PinyinIME/jni/include/pinyinime.h b/jni/include/pinyinime.h index 0744ec7..0744ec7 100644 --- a/PinyinIME/jni/include/pinyinime.h +++ b/jni/include/pinyinime.h diff --git a/PinyinIME/jni/include/searchutility.h b/jni/include/searchutility.h index f135710..f135710 100644 --- a/PinyinIME/jni/include/searchutility.h +++ b/jni/include/searchutility.h diff --git a/PinyinIME/jni/include/spellingtable.h b/jni/include/spellingtable.h index fd79c6e..fd79c6e 100644 --- a/PinyinIME/jni/include/spellingtable.h +++ b/jni/include/spellingtable.h diff --git a/PinyinIME/jni/include/spellingtrie.h b/jni/include/spellingtrie.h index 4438757..4438757 100644 --- a/PinyinIME/jni/include/spellingtrie.h +++ b/jni/include/spellingtrie.h diff --git a/PinyinIME/jni/include/splparser.h b/jni/include/splparser.h index d783bd7..d783bd7 100644 --- a/PinyinIME/jni/include/splparser.h +++ b/jni/include/splparser.h diff --git a/PinyinIME/jni/include/sync.h b/jni/include/sync.h index bf42d1f..bf42d1f 100644 --- a/PinyinIME/jni/include/sync.h +++ b/jni/include/sync.h diff --git a/PinyinIME/jni/include/userdict.h b/jni/include/userdict.h index 02da218..02da218 100644 --- a/PinyinIME/jni/include/userdict.h +++ b/jni/include/userdict.h diff --git a/PinyinIME/jni/include/utf16char.h b/jni/include/utf16char.h index 7e957db..7e957db 100644 --- a/PinyinIME/jni/include/utf16char.h +++ b/jni/include/utf16char.h diff --git a/PinyinIME/jni/include/utf16reader.h b/jni/include/utf16reader.h index b6d6719..b6d6719 100644 --- a/PinyinIME/jni/include/utf16reader.h +++ b/jni/include/utf16reader.h diff --git a/PinyinIME/jni/share/dictbuilder.cpp b/jni/share/dictbuilder.cpp index b2e989c..6f0bd4f 100644 --- a/PinyinIME/jni/share/dictbuilder.cpp +++ b/jni/share/dictbuilder.cpp @@ -491,7 +491,6 @@ size_t DictBuilder::read_raw_dict(const char* fn_raw, i--; continue; } - // printf("i: %d\n", i); } delete [] valid_hzs; @@ -579,7 +578,6 @@ bool DictBuilder::build_dict(const char *fn_raw, get_top_lemmas(); - // printf("Now begin construct tree\n"); #ifdef ___DO_STATISTICS___ stat_init(); #endif @@ -775,8 +773,6 @@ bool DictBuilder::construct_subset(void* parent, LemmaEntry* lemma_arr, if (level >= kMaxLemmaSize || item_end <= item_start) return false; - // printf("++ enter recursive\n"); - // 1. Scan for how many sons size_t parent_son_num = 0; // LemmaNode *son_1st = NULL; @@ -853,8 +849,6 @@ bool DictBuilder::construct_subset(void* parent, LemmaEntry* lemma_arr, lma_last_start = lemma_arr_ + item_start; spl_idx_node = lma_last_start->spl_idx_arr[level]; - // printf("++ spl_idx_node: %d\n", spl_idx_node); - size_t homo_num = 0; if (lma_last_start->spl_idx_arr[level + 1] == 0) homo_num = 1; @@ -888,8 +882,6 @@ bool DictBuilder::construct_subset(void* parent, LemmaEntry* lemma_arr, homo_idx_num_gt1_ += homo_num; } - // printf("++ homo_num: %d\n++ lmaids: ", homo_num); - if (homo_num > 0) { LemmaIdType* idx_buf = homo_idx_buf_ + homo_idx_num_eq1_ + homo_idx_num_gt1_ - homo_num; @@ -903,10 +895,8 @@ bool DictBuilder::construct_subset(void* parent, LemmaEntry* lemma_arr, for (size_t homo_pos = 0; homo_pos < homo_num; homo_pos++) { idx_buf[homo_pos] = lemma_arr_[item_start_next + homo_pos].idx_by_hz; - // printf("[%d] %d ", item_start_next + homo_pos, idx_buf[homo_pos]); } - // printf("\n"); #ifdef ___DO_STATISTICS___ if (homo_num > max_homobuf_len_[level]) max_homobuf_len_[level] = homo_num; diff --git a/PinyinIME/jni/share/dictlist.cpp b/jni/share/dictlist.cpp index aa7905c..aa7905c 100644 --- a/PinyinIME/jni/share/dictlist.cpp +++ b/jni/share/dictlist.cpp diff --git a/PinyinIME/jni/share/dicttrie.cpp b/jni/share/dicttrie.cpp index 88b819d..88b819d 100644 --- a/PinyinIME/jni/share/dicttrie.cpp +++ b/jni/share/dicttrie.cpp diff --git a/PinyinIME/jni/share/lpicache.cpp b/jni/share/lpicache.cpp index 4bb4ca2..4bb4ca2 100644 --- a/PinyinIME/jni/share/lpicache.cpp +++ b/jni/share/lpicache.cpp diff --git a/PinyinIME/jni/share/matrixsearch.cpp b/jni/share/matrixsearch.cpp index d13a4c4..dd19f59 100644 --- a/PinyinIME/jni/share/matrixsearch.cpp +++ b/jni/share/matrixsearch.cpp @@ -139,7 +139,7 @@ bool MatrixSearch::init(const char *fn_sys_dict, const char *fn_usr_dict) { user_dict_->set_total_lemma_count_of_others(NGram::kSysDictTotalFreq); } - reset_search(0, true, true, true); + reset_search0(); inited_ = true; return true; @@ -163,7 +163,7 @@ bool MatrixSearch::init_fd(int sys_fd, long start_offset, long length, user_dict_->set_total_lemma_count_of_others(NGram::kSysDictTotalFreq); } - reset_search(0, true, true, true); + reset_search0(); inited_ = true; return true; @@ -198,16 +198,13 @@ bool MatrixSearch::get_xi_an_switch() { bool MatrixSearch::reset_search() { if (!inited_) return false; - return reset_search(0, true, true, true); + return reset_search0(); } -bool MatrixSearch::reset_search(size_t ch_pos, bool clear_fixed_this_step, - bool clear_dmi_this_step, - bool clear_mtrx_this_step) { - if (!inited_ || ch_pos > pys_decoded_len_ || ch_pos >= kMaxRowNum) - return false; +bool MatrixSearch::reset_search0() { + if (!inited_) + return false; - if (0 == ch_pos) { pys_decoded_len_ = 0; mtrx_nd_pool_used_ = 0; dmi_pool_used_ = 0; @@ -238,6 +235,18 @@ bool MatrixSearch::reset_search(size_t ch_pos, bool clear_fixed_this_step, dict_trie_->reset_milestones(0, 0); if (NULL != user_dict_) user_dict_->reset_milestones(0, 0); + + return true; +} + +bool MatrixSearch::reset_search(size_t ch_pos, bool clear_fixed_this_step, + bool clear_dmi_this_step, + bool clear_mtrx_this_step) { + if (!inited_ || ch_pos > pys_decoded_len_ || ch_pos >= kMaxRowNum) + return false; + + if (0 == ch_pos) { + reset_search0(); } else { // Prepare mile stones of this step to clear. MileStoneHandle *dict_handles_to_clear = NULL; @@ -281,7 +290,10 @@ bool MatrixSearch::reset_search(size_t ch_pos, bool clear_fixed_this_step, } // Modify fixed_hzs_ - if (fixed_hzs_ > 0 && kLemmaIdComposing != lma_id_[0]) { + if (fixed_hzs_ > 0 && + ((kLemmaIdComposing != lma_id_[0]) || + (kLemmaIdComposing == lma_id_[0] && + spl_start_[c_phrase_.length] <= ch_pos))) { size_t fixed_ch_pos = ch_pos; if (clear_fixed_this_step) fixed_ch_pos = fixed_ch_pos > 0 ? fixed_ch_pos - 1 : 0; @@ -350,8 +362,47 @@ bool MatrixSearch::reset_search(size_t ch_pos, bool clear_fixed_this_step, for (uint16 re_pos = fixed_ch_pos; re_pos < ch_pos; re_pos++) { add_char(pys_[re_pos]); } - } else if (kLemmaIdComposing == lma_id_[0]) { - // Do nothing for the composing phrase. + } else if (fixed_hzs_ > 0 && kLemmaIdComposing == lma_id_[0]) { + for (uint16 subpos = 0; subpos < c_phrase_.sublma_num; subpos++) { + uint16 splpos_begin = c_phrase_.sublma_start[subpos]; + uint16 splpos_end = c_phrase_.sublma_start[subpos + 1]; + for (uint16 splpos = splpos_begin; splpos < splpos_end; splpos++) { + // If ch_pos is in this spelling + uint16 spl_start = c_phrase_.spl_start[splpos]; + uint16 spl_end = c_phrase_.spl_start[splpos + 1]; + if (ch_pos >= spl_start && ch_pos < spl_end) { + // Clear everything after this position + c_phrase_.chn_str[splpos] = static_cast<char16>('\0'); + c_phrase_.sublma_start[subpos + 1] = splpos; + c_phrase_.sublma_num = subpos + 1; + c_phrase_.length = splpos; + + if (splpos == splpos_begin) { + c_phrase_.sublma_num = subpos; + } + } + } + } + + // Extend the composing phrase. + reset_search0(); + dmi_c_phrase_ = true; + uint16 c_py_pos = 0; + while (c_py_pos < spl_start_[c_phrase_.length]) { + bool b_ac_tmp = add_char(pys_[c_py_pos]); + assert(b_ac_tmp); + c_py_pos++; + } + dmi_c_phrase_ = false; + + lma_id_num_ = 1; + fixed_lmas_ = 1; + fixed_lmas_no1_[0] = 0; // A composing string is always modified. + fixed_hzs_ = c_phrase_.length; + lma_start_[1] = fixed_hzs_; + lma_id_[0] = kLemmaIdComposing; + matrix_[spl_start_[fixed_hzs_]].mtrx_nd_fixed = mtrx_nd_pool_ + + matrix_[spl_start_[fixed_hzs_]].mtrx_nd_pos; } } @@ -431,9 +482,23 @@ size_t MatrixSearch::delsearch(size_t pos, bool is_pos_in_splid, if (!inited_) return 0; + size_t reset_pos = pos; + // Out of range for both Pinyin mode and Spelling id mode. if (pys_decoded_len_ <= pos) { del_in_pys(pos, 1); + + reset_pos = pys_decoded_len_; + // Decode the string after the un-decoded position + while ('\0' != pys_[reset_pos]) { + if (!add_char(pys_[reset_pos])) { + pys_decoded_len_ = reset_pos; + break; + } + reset_pos++; + } + get_spl_start_id(); + prepare_candidates(); return pys_decoded_len_; } @@ -444,9 +509,7 @@ size_t MatrixSearch::delsearch(size_t pos, bool is_pos_in_splid, // Begin to handle two modes respectively. // Pinyin mode by default size_t c_py_len = 0; // The length of composing phrase's Pinyin - size_t reset_pos = pos; size_t del_py_len = 1; - size_t stop_pos = pys_decoded_len_; if (!is_pos_in_splid) { // Pinyin mode is only allowed to delete beyond the fixed lemmas. if (fixed_lmas_ > 0 && pos < spl_start_[lma_start_[fixed_lmas_]]) @@ -490,7 +553,7 @@ size_t MatrixSearch::delsearch(size_t pos, bool is_pos_in_splid, // The composing phrase is valid, reset all search space, // and begin a new search which will only extend the composing // phrase. - reset_search(0, true, true, true); + reset_search0(); dmi_c_phrase_ = true; // Extend the composing phrase. @@ -517,8 +580,7 @@ size_t MatrixSearch::delsearch(size_t pos, bool is_pos_in_splid, } // Decode the string after the delete position. - stop_pos -= del_py_len; - while (reset_pos < stop_pos) { + while ('\0' != pys_[reset_pos]) { if (!add_char(pys_[reset_pos])) { pys_decoded_len_ = reset_pos; break; @@ -528,7 +590,7 @@ size_t MatrixSearch::delsearch(size_t pos, bool is_pos_in_splid, get_spl_start_id(); prepare_candidates(); - return c_py_len; + return pys_decoded_len_; } size_t MatrixSearch::get_candidate_num() { @@ -1591,7 +1653,8 @@ char16* MatrixSearch::get_candidate0(char16 *cand_str, size_t max_len, char16 str[kMaxLemmaSize + 1]; uint16 str_len = get_lemma_str(idxs[id_num], str, kMaxLemmaSize + 1); - if (str_len > 0 && max_len - ret_pos > str_len) { + if (str_len > 0 && ((!only_unfixed && max_len - ret_pos > str_len) || + (only_unfixed && max_len - ret_pos + fixed_hzs_ > str_len))) { if (!only_unfixed) utf16_strncpy(cand_str + ret_pos, str, str_len); else if (ret_pos >= fixed_hzs_) diff --git a/PinyinIME/jni/share/mystdlib.cpp b/jni/share/mystdlib.cpp index 93bbcc9..93bbcc9 100644 --- a/PinyinIME/jni/share/mystdlib.cpp +++ b/jni/share/mystdlib.cpp diff --git a/PinyinIME/jni/share/ngram.cpp b/jni/share/ngram.cpp index d95477a..d95477a 100644 --- a/PinyinIME/jni/share/ngram.cpp +++ b/jni/share/ngram.cpp diff --git a/PinyinIME/jni/share/pinyinime.cpp b/jni/share/pinyinime.cpp index 550da7b..550da7b 100644 --- a/PinyinIME/jni/share/pinyinime.cpp +++ b/jni/share/pinyinime.cpp diff --git a/PinyinIME/jni/share/searchutility.cpp b/jni/share/searchutility.cpp index 281da38..281da38 100644 --- a/PinyinIME/jni/share/searchutility.cpp +++ b/jni/share/searchutility.cpp diff --git a/PinyinIME/jni/share/spellingtable.cpp b/jni/share/spellingtable.cpp index 6005e20..6005e20 100644 --- a/PinyinIME/jni/share/spellingtable.cpp +++ b/jni/share/spellingtable.cpp diff --git a/PinyinIME/jni/share/spellingtrie.cpp b/jni/share/spellingtrie.cpp index 85be46b..85be46b 100644 --- a/PinyinIME/jni/share/spellingtrie.cpp +++ b/jni/share/spellingtrie.cpp diff --git a/PinyinIME/jni/share/splparser.cpp b/jni/share/splparser.cpp index d75aec6..d75aec6 100644 --- a/PinyinIME/jni/share/splparser.cpp +++ b/jni/share/splparser.cpp diff --git a/PinyinIME/jni/share/sync.cpp b/jni/share/sync.cpp index 91e27b8..91e27b8 100644 --- a/PinyinIME/jni/share/sync.cpp +++ b/jni/share/sync.cpp diff --git a/PinyinIME/jni/share/userdict.cpp b/jni/share/userdict.cpp index 5064296..5064296 100644 --- a/PinyinIME/jni/share/userdict.cpp +++ b/jni/share/userdict.cpp diff --git a/PinyinIME/jni/share/utf16char.cpp b/jni/share/utf16char.cpp index fadb6cf..fadb6cf 100644 --- a/PinyinIME/jni/share/utf16char.cpp +++ b/jni/share/utf16char.cpp diff --git a/PinyinIME/jni/share/utf16reader.cpp b/jni/share/utf16reader.cpp index d8e5de5..d8e5de5 100644 --- a/PinyinIME/jni/share/utf16reader.cpp +++ b/jni/share/utf16reader.cpp diff --git a/PinyinIME/lib/Android.mk b/lib/Android.mk index f41193e..f41193e 100644 --- a/PinyinIME/lib/Android.mk +++ b/lib/Android.mk diff --git a/PinyinIME/lib/com/android/inputmethod/pinyin/IPinyinDecoderService.aidl b/lib/com/android/inputmethod/pinyin/IPinyinDecoderService.aidl index 59dd6cc..59dd6cc 100644 --- a/PinyinIME/lib/com/android/inputmethod/pinyin/IPinyinDecoderService.aidl +++ b/lib/com/android/inputmethod/pinyin/IPinyinDecoderService.aidl diff --git a/PinyinIME/res/drawable/app_icon.png b/res/drawable/app_icon.png Binary files differindex 0c6eff3..0c6eff3 100644 --- a/PinyinIME/res/drawable/app_icon.png +++ b/res/drawable/app_icon.png diff --git a/PinyinIME/res/drawable/arrow_bg.xml b/res/drawable/arrow_bg.xml index 9125232..9125232 100644 --- a/PinyinIME/res/drawable/arrow_bg.xml +++ b/res/drawable/arrow_bg.xml diff --git a/PinyinIME/res/drawable/arrow_left.png b/res/drawable/arrow_left.png Binary files differindex 75b8daa..75b8daa 100644 --- a/PinyinIME/res/drawable/arrow_left.png +++ b/res/drawable/arrow_left.png diff --git a/PinyinIME/res/drawable/arrow_right.png b/res/drawable/arrow_right.png Binary files differindex e4e6cd7..e4e6cd7 100644 --- a/PinyinIME/res/drawable/arrow_right.png +++ b/res/drawable/arrow_right.png diff --git a/PinyinIME/res/drawable/candidate_balloon_bg.9.png b/res/drawable/candidate_balloon_bg.9.png Binary files differindex ddc26f6..ddc26f6 100644 --- a/PinyinIME/res/drawable/candidate_balloon_bg.9.png +++ b/res/drawable/candidate_balloon_bg.9.png diff --git a/PinyinIME/res/drawable/candidate_hl_bg.9.png b/res/drawable/candidate_hl_bg.9.png Binary files differindex 83d40a0..83d40a0 100644 --- a/PinyinIME/res/drawable/candidate_hl_bg.9.png +++ b/res/drawable/candidate_hl_bg.9.png diff --git a/PinyinIME/res/drawable/candidates_area_bg.9.png b/res/drawable/candidates_area_bg.9.png Binary files differindex 3ff63f4..3ff63f4 100644 --- a/PinyinIME/res/drawable/candidates_area_bg.9.png +++ b/res/drawable/candidates_area_bg.9.png diff --git a/PinyinIME/res/drawable/candidates_vertical_line.png b/res/drawable/candidates_vertical_line.png Binary files differindex 1edd335..1edd335 100644 --- a/PinyinIME/res/drawable/candidates_vertical_line.png +++ b/res/drawable/candidates_vertical_line.png diff --git a/PinyinIME/res/drawable/cands_container_bg.9.png b/res/drawable/cands_container_bg.9.png Binary files differindex 837ba9b..837ba9b 100644 --- a/PinyinIME/res/drawable/cands_container_bg.9.png +++ b/res/drawable/cands_container_bg.9.png diff --git a/PinyinIME/res/drawable/comma_full_icon.png b/res/drawable/comma_full_icon.png Binary files differindex 142fe1e..142fe1e 100644 --- a/PinyinIME/res/drawable/comma_full_icon.png +++ b/res/drawable/comma_full_icon.png diff --git a/PinyinIME/res/drawable/comma_full_popup_icon.png b/res/drawable/comma_full_popup_icon.png Binary files differindex f63a5b5..f63a5b5 100644 --- a/PinyinIME/res/drawable/comma_full_popup_icon.png +++ b/res/drawable/comma_full_popup_icon.png diff --git a/PinyinIME/res/drawable/composing_area_bg.9.png b/res/drawable/composing_area_bg.9.png Binary files differindex 31f6580..31f6580 100644 --- a/PinyinIME/res/drawable/composing_area_bg.9.png +++ b/res/drawable/composing_area_bg.9.png diff --git a/PinyinIME/res/drawable/composing_area_cursor.png b/res/drawable/composing_area_cursor.png Binary files differindex ea3bbca..ea3bbca 100644 --- a/PinyinIME/res/drawable/composing_area_cursor.png +++ b/res/drawable/composing_area_cursor.png diff --git a/PinyinIME/res/drawable/composing_hl_bg.9.png b/res/drawable/composing_hl_bg.9.png Binary files differindex b84719e..b84719e 100644 --- a/PinyinIME/res/drawable/composing_hl_bg.9.png +++ b/res/drawable/composing_hl_bg.9.png diff --git a/PinyinIME/res/drawable/delete_icon.png b/res/drawable/delete_icon.png Binary files differindex f1f7c58..f1f7c58 100644 --- a/PinyinIME/res/drawable/delete_icon.png +++ b/res/drawable/delete_icon.png diff --git a/PinyinIME/res/drawable/delete_popup_icon.png b/res/drawable/delete_popup_icon.png Binary files differindex 3c90839..3c90839 100644 --- a/PinyinIME/res/drawable/delete_popup_icon.png +++ b/res/drawable/delete_popup_icon.png diff --git a/PinyinIME/res/drawable/dun_icon.png b/res/drawable/dun_icon.png Binary files differindex eaa6aa1..eaa6aa1 100644 --- a/PinyinIME/res/drawable/dun_icon.png +++ b/res/drawable/dun_icon.png diff --git a/PinyinIME/res/drawable/dun_popup_icon.png b/res/drawable/dun_popup_icon.png Binary files differindex 5b7eb6a..5b7eb6a 100644 --- a/PinyinIME/res/drawable/dun_popup_icon.png +++ b/res/drawable/dun_popup_icon.png diff --git a/PinyinIME/res/drawable/emotion_icon_00.png b/res/drawable/emotion_icon_00.png Binary files differindex 33f2945..33f2945 100644 --- a/PinyinIME/res/drawable/emotion_icon_00.png +++ b/res/drawable/emotion_icon_00.png diff --git a/PinyinIME/res/drawable/emotion_icon_00_popup.png b/res/drawable/emotion_icon_00_popup.png Binary files differindex 1aaebdd..1aaebdd 100644 --- a/PinyinIME/res/drawable/emotion_icon_00_popup.png +++ b/res/drawable/emotion_icon_00_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_01.png b/res/drawable/emotion_icon_01.png Binary files differindex 9165e2a..9165e2a 100644 --- a/PinyinIME/res/drawable/emotion_icon_01.png +++ b/res/drawable/emotion_icon_01.png diff --git a/PinyinIME/res/drawable/emotion_icon_01_popup.png b/res/drawable/emotion_icon_01_popup.png Binary files differindex baeebdc..baeebdc 100644 --- a/PinyinIME/res/drawable/emotion_icon_01_popup.png +++ b/res/drawable/emotion_icon_01_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_02.png b/res/drawable/emotion_icon_02.png Binary files differindex e967603..e967603 100644 --- a/PinyinIME/res/drawable/emotion_icon_02.png +++ b/res/drawable/emotion_icon_02.png diff --git a/PinyinIME/res/drawable/emotion_icon_02_popup.png b/res/drawable/emotion_icon_02_popup.png Binary files differindex 3a27346..3a27346 100644 --- a/PinyinIME/res/drawable/emotion_icon_02_popup.png +++ b/res/drawable/emotion_icon_02_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_03.png b/res/drawable/emotion_icon_03.png Binary files differindex 3fc2585..3fc2585 100644 --- a/PinyinIME/res/drawable/emotion_icon_03.png +++ b/res/drawable/emotion_icon_03.png diff --git a/PinyinIME/res/drawable/emotion_icon_03_popup.png b/res/drawable/emotion_icon_03_popup.png Binary files differindex 2567632..2567632 100644 --- a/PinyinIME/res/drawable/emotion_icon_03_popup.png +++ b/res/drawable/emotion_icon_03_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_04.png b/res/drawable/emotion_icon_04.png Binary files differindex 0e2d459..0e2d459 100644 --- a/PinyinIME/res/drawable/emotion_icon_04.png +++ b/res/drawable/emotion_icon_04.png diff --git a/PinyinIME/res/drawable/emotion_icon_04_popup.png b/res/drawable/emotion_icon_04_popup.png Binary files differindex 61f2d21..61f2d21 100644 --- a/PinyinIME/res/drawable/emotion_icon_04_popup.png +++ b/res/drawable/emotion_icon_04_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_05.png b/res/drawable/emotion_icon_05.png Binary files differindex 29ac101..29ac101 100644 --- a/PinyinIME/res/drawable/emotion_icon_05.png +++ b/res/drawable/emotion_icon_05.png diff --git a/PinyinIME/res/drawable/emotion_icon_05_popup.png b/res/drawable/emotion_icon_05_popup.png Binary files differindex 48fd0bc..48fd0bc 100644 --- a/PinyinIME/res/drawable/emotion_icon_05_popup.png +++ b/res/drawable/emotion_icon_05_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_06.png b/res/drawable/emotion_icon_06.png Binary files differindex 02f47c6..02f47c6 100644 --- a/PinyinIME/res/drawable/emotion_icon_06.png +++ b/res/drawable/emotion_icon_06.png diff --git a/PinyinIME/res/drawable/emotion_icon_06_popup.png b/res/drawable/emotion_icon_06_popup.png Binary files differindex 5508cd2..5508cd2 100644 --- a/PinyinIME/res/drawable/emotion_icon_06_popup.png +++ b/res/drawable/emotion_icon_06_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_10.png b/res/drawable/emotion_icon_10.png Binary files differindex d9a0582..d9a0582 100644 --- a/PinyinIME/res/drawable/emotion_icon_10.png +++ b/res/drawable/emotion_icon_10.png diff --git a/PinyinIME/res/drawable/emotion_icon_10_popup.png b/res/drawable/emotion_icon_10_popup.png Binary files differindex 32dd180..32dd180 100644 --- a/PinyinIME/res/drawable/emotion_icon_10_popup.png +++ b/res/drawable/emotion_icon_10_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_11.png b/res/drawable/emotion_icon_11.png Binary files differindex d1ca0a8..d1ca0a8 100644 --- a/PinyinIME/res/drawable/emotion_icon_11.png +++ b/res/drawable/emotion_icon_11.png diff --git a/PinyinIME/res/drawable/emotion_icon_11_popup.png b/res/drawable/emotion_icon_11_popup.png Binary files differindex 5e42d97..5e42d97 100644 --- a/PinyinIME/res/drawable/emotion_icon_11_popup.png +++ b/res/drawable/emotion_icon_11_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_12.png b/res/drawable/emotion_icon_12.png Binary files differindex ee88ef8..ee88ef8 100644 --- a/PinyinIME/res/drawable/emotion_icon_12.png +++ b/res/drawable/emotion_icon_12.png diff --git a/PinyinIME/res/drawable/emotion_icon_12_popup.png b/res/drawable/emotion_icon_12_popup.png Binary files differindex 195600d..195600d 100644 --- a/PinyinIME/res/drawable/emotion_icon_12_popup.png +++ b/res/drawable/emotion_icon_12_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_13.png b/res/drawable/emotion_icon_13.png Binary files differindex 70b7334..70b7334 100644 --- a/PinyinIME/res/drawable/emotion_icon_13.png +++ b/res/drawable/emotion_icon_13.png diff --git a/PinyinIME/res/drawable/emotion_icon_13_popup.png b/res/drawable/emotion_icon_13_popup.png Binary files differindex 1df73ec..1df73ec 100644 --- a/PinyinIME/res/drawable/emotion_icon_13_popup.png +++ b/res/drawable/emotion_icon_13_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_14.png b/res/drawable/emotion_icon_14.png Binary files differindex 852b7c1..852b7c1 100644 --- a/PinyinIME/res/drawable/emotion_icon_14.png +++ b/res/drawable/emotion_icon_14.png diff --git a/PinyinIME/res/drawable/emotion_icon_14_popup.png b/res/drawable/emotion_icon_14_popup.png Binary files differindex 800a240..800a240 100644 --- a/PinyinIME/res/drawable/emotion_icon_14_popup.png +++ b/res/drawable/emotion_icon_14_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_15.png b/res/drawable/emotion_icon_15.png Binary files differindex cfbbe16..cfbbe16 100644 --- a/PinyinIME/res/drawable/emotion_icon_15.png +++ b/res/drawable/emotion_icon_15.png diff --git a/PinyinIME/res/drawable/emotion_icon_15_popup.png b/res/drawable/emotion_icon_15_popup.png Binary files differindex 7f175f5..7f175f5 100644 --- a/PinyinIME/res/drawable/emotion_icon_15_popup.png +++ b/res/drawable/emotion_icon_15_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_16.png b/res/drawable/emotion_icon_16.png Binary files differindex 52368c0..52368c0 100644 --- a/PinyinIME/res/drawable/emotion_icon_16.png +++ b/res/drawable/emotion_icon_16.png diff --git a/PinyinIME/res/drawable/emotion_icon_16_popup.png b/res/drawable/emotion_icon_16_popup.png Binary files differindex 2a5b815..2a5b815 100644 --- a/PinyinIME/res/drawable/emotion_icon_16_popup.png +++ b/res/drawable/emotion_icon_16_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_20.png b/res/drawable/emotion_icon_20.png Binary files differindex 2681132..2681132 100644 --- a/PinyinIME/res/drawable/emotion_icon_20.png +++ b/res/drawable/emotion_icon_20.png diff --git a/PinyinIME/res/drawable/emotion_icon_20_popup.png b/res/drawable/emotion_icon_20_popup.png Binary files differindex 8887619..8887619 100644 --- a/PinyinIME/res/drawable/emotion_icon_20_popup.png +++ b/res/drawable/emotion_icon_20_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_21.png b/res/drawable/emotion_icon_21.png Binary files differindex ed425d8..ed425d8 100644 --- a/PinyinIME/res/drawable/emotion_icon_21.png +++ b/res/drawable/emotion_icon_21.png diff --git a/PinyinIME/res/drawable/emotion_icon_21_popup.png b/res/drawable/emotion_icon_21_popup.png Binary files differindex 48afe8a..48afe8a 100644 --- a/PinyinIME/res/drawable/emotion_icon_21_popup.png +++ b/res/drawable/emotion_icon_21_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_22.png b/res/drawable/emotion_icon_22.png Binary files differindex 88d37ec..88d37ec 100644 --- a/PinyinIME/res/drawable/emotion_icon_22.png +++ b/res/drawable/emotion_icon_22.png diff --git a/PinyinIME/res/drawable/emotion_icon_22_popup.png b/res/drawable/emotion_icon_22_popup.png Binary files differindex cb08d1b..cb08d1b 100644 --- a/PinyinIME/res/drawable/emotion_icon_22_popup.png +++ b/res/drawable/emotion_icon_22_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_23.png b/res/drawable/emotion_icon_23.png Binary files differindex 75f592b..75f592b 100644 --- a/PinyinIME/res/drawable/emotion_icon_23.png +++ b/res/drawable/emotion_icon_23.png diff --git a/PinyinIME/res/drawable/emotion_icon_23_popup.png b/res/drawable/emotion_icon_23_popup.png Binary files differindex e3ecfc3..e3ecfc3 100644 --- a/PinyinIME/res/drawable/emotion_icon_23_popup.png +++ b/res/drawable/emotion_icon_23_popup.png diff --git a/PinyinIME/res/drawable/emotion_icon_24.png b/res/drawable/emotion_icon_24.png Binary files differindex fdadf91..fdadf91 100644 --- a/PinyinIME/res/drawable/emotion_icon_24.png +++ b/res/drawable/emotion_icon_24.png diff --git a/PinyinIME/res/drawable/emotion_icon_24_popup.png b/res/drawable/emotion_icon_24_popup.png Binary files differindex 1766a5d..1766a5d 100644 --- a/PinyinIME/res/drawable/emotion_icon_24_popup.png +++ b/res/drawable/emotion_icon_24_popup.png diff --git a/PinyinIME/res/drawable/enter_icon.png b/res/drawable/enter_icon.png Binary files differindex 17f2574..17f2574 100644 --- a/PinyinIME/res/drawable/enter_icon.png +++ b/res/drawable/enter_icon.png diff --git a/PinyinIME/res/drawable/enter_popup_icon.png b/res/drawable/enter_popup_icon.png Binary files differindex 03d9c9b..03d9c9b 100644 --- a/PinyinIME/res/drawable/enter_popup_icon.png +++ b/res/drawable/enter_popup_icon.png diff --git a/PinyinIME/res/drawable/ime_en.png b/res/drawable/ime_en.png Binary files differindex 652d7d7..652d7d7 100644 --- a/PinyinIME/res/drawable/ime_en.png +++ b/res/drawable/ime_en.png diff --git a/PinyinIME/res/drawable/ime_pinyin.png b/res/drawable/ime_pinyin.png Binary files differindex b398d89..b398d89 100644 --- a/PinyinIME/res/drawable/ime_pinyin.png +++ b/res/drawable/ime_pinyin.png diff --git a/PinyinIME/res/drawable/key_balloon_bg.9.png b/res/drawable/key_balloon_bg.9.png Binary files differindex 1789b34..1789b34 100644 --- a/PinyinIME/res/drawable/key_balloon_bg.9.png +++ b/res/drawable/key_balloon_bg.9.png diff --git a/PinyinIME/res/drawable/light_key_bg.9.png b/res/drawable/light_key_bg.9.png Binary files differindex bda9b83..bda9b83 100644 --- a/PinyinIME/res/drawable/light_key_bg.9.png +++ b/res/drawable/light_key_bg.9.png diff --git a/PinyinIME/res/drawable/light_key_hl_bg.9.png b/res/drawable/light_key_hl_bg.9.png Binary files differindex bdcf06e..bdcf06e 100644 --- a/PinyinIME/res/drawable/light_key_hl_bg.9.png +++ b/res/drawable/light_key_hl_bg.9.png diff --git a/PinyinIME/res/drawable/light_key_up_bg.9.png b/res/drawable/light_key_up_bg.9.png Binary files differindex 0c16ed5..0c16ed5 100644 --- a/PinyinIME/res/drawable/light_key_up_bg.9.png +++ b/res/drawable/light_key_up_bg.9.png diff --git a/PinyinIME/res/drawable/light_key_up_hl_bg.9.png b/res/drawable/light_key_up_hl_bg.9.png Binary files differindex 79621a9..79621a9 100644 --- a/PinyinIME/res/drawable/light_key_up_hl_bg.9.png +++ b/res/drawable/light_key_up_hl_bg.9.png diff --git a/PinyinIME/res/drawable/miniskb_bg.9.png b/res/drawable/miniskb_bg.9.png Binary files differindex 74fddc8..74fddc8 100644 --- a/PinyinIME/res/drawable/miniskb_bg.9.png +++ b/res/drawable/miniskb_bg.9.png diff --git a/PinyinIME/res/drawable/normal_key_bg.9.png b/res/drawable/normal_key_bg.9.png Binary files differindex 7ba18dd..7ba18dd 100644 --- a/PinyinIME/res/drawable/normal_key_bg.9.png +++ b/res/drawable/normal_key_bg.9.png diff --git a/PinyinIME/res/drawable/normal_key_hl_bg.9.png b/res/drawable/normal_key_hl_bg.9.png Binary files differindex 39b9314..39b9314 100644 --- a/PinyinIME/res/drawable/normal_key_hl_bg.9.png +++ b/res/drawable/normal_key_hl_bg.9.png diff --git a/PinyinIME/res/drawable/num0.png b/res/drawable/num0.png Binary files differindex e7007c8..e7007c8 100644 --- a/PinyinIME/res/drawable/num0.png +++ b/res/drawable/num0.png diff --git a/PinyinIME/res/drawable/num1.png b/res/drawable/num1.png Binary files differindex aaac11b..aaac11b 100644 --- a/PinyinIME/res/drawable/num1.png +++ b/res/drawable/num1.png diff --git a/PinyinIME/res/drawable/num2.png b/res/drawable/num2.png Binary files differindex 4372eb8..4372eb8 100644 --- a/PinyinIME/res/drawable/num2.png +++ b/res/drawable/num2.png diff --git a/PinyinIME/res/drawable/num3.png b/res/drawable/num3.png Binary files differindex 6f54c85..6f54c85 100644 --- a/PinyinIME/res/drawable/num3.png +++ b/res/drawable/num3.png diff --git a/PinyinIME/res/drawable/num4.png b/res/drawable/num4.png Binary files differindex 3e50bb9..3e50bb9 100644 --- a/PinyinIME/res/drawable/num4.png +++ b/res/drawable/num4.png diff --git a/PinyinIME/res/drawable/num5.png b/res/drawable/num5.png Binary files differindex c39ef44..c39ef44 100644 --- a/PinyinIME/res/drawable/num5.png +++ b/res/drawable/num5.png diff --git a/PinyinIME/res/drawable/num6.png b/res/drawable/num6.png Binary files differindex ea88ceb..ea88ceb 100644 --- a/PinyinIME/res/drawable/num6.png +++ b/res/drawable/num6.png diff --git a/PinyinIME/res/drawable/num7.png b/res/drawable/num7.png Binary files differindex 4d75583..4d75583 100644 --- a/PinyinIME/res/drawable/num7.png +++ b/res/drawable/num7.png diff --git a/PinyinIME/res/drawable/num8.png b/res/drawable/num8.png Binary files differindex 1a8ff94..1a8ff94 100644 --- a/PinyinIME/res/drawable/num8.png +++ b/res/drawable/num8.png diff --git a/PinyinIME/res/drawable/num9.png b/res/drawable/num9.png Binary files differindex 8b344c0..8b344c0 100644 --- a/PinyinIME/res/drawable/num9.png +++ b/res/drawable/num9.png diff --git a/PinyinIME/res/drawable/numalt.png b/res/drawable/numalt.png Binary files differindex 32a2cf3..32a2cf3 100644 --- a/PinyinIME/res/drawable/numalt.png +++ b/res/drawable/numalt.png diff --git a/PinyinIME/res/drawable/numpound.png b/res/drawable/numpound.png Binary files differindex b2419d9..b2419d9 100644 --- a/PinyinIME/res/drawable/numpound.png +++ b/res/drawable/numpound.png diff --git a/PinyinIME/res/drawable/numstar.png b/res/drawable/numstar.png Binary files differindex cb66f96..cb66f96 100644 --- a/PinyinIME/res/drawable/numstar.png +++ b/res/drawable/numstar.png diff --git a/PinyinIME/res/drawable/period_full_icon.png b/res/drawable/period_full_icon.png Binary files differindex 1d7c6c7..1d7c6c7 100644 --- a/PinyinIME/res/drawable/period_full_icon.png +++ b/res/drawable/period_full_icon.png diff --git a/PinyinIME/res/drawable/period_full_popup_icon.png b/res/drawable/period_full_popup_icon.png Binary files differindex 07ee288..07ee288 100644 --- a/PinyinIME/res/drawable/period_full_popup_icon.png +++ b/res/drawable/period_full_popup_icon.png diff --git a/PinyinIME/res/drawable/period_icon.png b/res/drawable/period_icon.png Binary files differindex 6a8bd86..6a8bd86 100644 --- a/PinyinIME/res/drawable/period_icon.png +++ b/res/drawable/period_icon.png diff --git a/PinyinIME/res/drawable/period_popup_icon.png b/res/drawable/period_popup_icon.png Binary files differindex 3e18e03..3e18e03 100644 --- a/PinyinIME/res/drawable/period_popup_icon.png +++ b/res/drawable/period_popup_icon.png diff --git a/PinyinIME/res/drawable/search_icon.png b/res/drawable/search_icon.png Binary files differindex 127755d..127755d 100644 --- a/PinyinIME/res/drawable/search_icon.png +++ b/res/drawable/search_icon.png diff --git a/PinyinIME/res/drawable/search_popup_icon.png b/res/drawable/search_popup_icon.png Binary files differindex f4af341..f4af341 100644 --- a/PinyinIME/res/drawable/search_popup_icon.png +++ b/res/drawable/search_popup_icon.png diff --git a/PinyinIME/res/drawable/shift_off_icon.png b/res/drawable/shift_off_icon.png Binary files differindex 0566e5a..0566e5a 100644 --- a/PinyinIME/res/drawable/shift_off_icon.png +++ b/res/drawable/shift_off_icon.png diff --git a/PinyinIME/res/drawable/shift_off_popup_icon.png b/res/drawable/shift_off_popup_icon.png Binary files differindex 97f4661..97f4661 100644 --- a/PinyinIME/res/drawable/shift_off_popup_icon.png +++ b/res/drawable/shift_off_popup_icon.png diff --git a/PinyinIME/res/drawable/shift_on_icon.png b/res/drawable/shift_on_icon.png Binary files differindex ccaf05d..ccaf05d 100644 --- a/PinyinIME/res/drawable/shift_on_icon.png +++ b/res/drawable/shift_on_icon.png diff --git a/PinyinIME/res/drawable/shift_on_popup_icon.png b/res/drawable/shift_on_popup_icon.png Binary files differindex 7194b30..7194b30 100644 --- a/PinyinIME/res/drawable/shift_on_popup_icon.png +++ b/res/drawable/shift_on_popup_icon.png diff --git a/PinyinIME/res/drawable/skb_bg.png b/res/drawable/skb_bg.png Binary files differindex f582462..f582462 100644 --- a/PinyinIME/res/drawable/skb_bg.png +++ b/res/drawable/skb_bg.png diff --git a/PinyinIME/res/drawable/skb_container_bg.9.png b/res/drawable/skb_container_bg.9.png Binary files differindex d6d7537..d6d7537 100644 --- a/PinyinIME/res/drawable/skb_container_bg.9.png +++ b/res/drawable/skb_container_bg.9.png diff --git a/PinyinIME/res/drawable/smiley_icon.png b/res/drawable/smiley_icon.png Binary files differindex daa2dc1..daa2dc1 100644 --- a/PinyinIME/res/drawable/smiley_icon.png +++ b/res/drawable/smiley_icon.png diff --git a/PinyinIME/res/drawable/smiley_popup_icon.png b/res/drawable/smiley_popup_icon.png Binary files differindex 5d50370..5d50370 100644 --- a/PinyinIME/res/drawable/smiley_popup_icon.png +++ b/res/drawable/smiley_popup_icon.png diff --git a/PinyinIME/res/drawable/space_icon.png b/res/drawable/space_icon.png Binary files differindex 4e6273b..4e6273b 100644 --- a/PinyinIME/res/drawable/space_icon.png +++ b/res/drawable/space_icon.png diff --git a/PinyinIME/res/drawable/space_popup_icon.png b/res/drawable/space_popup_icon.png Binary files differindex 739db68..739db68 100644 --- a/PinyinIME/res/drawable/space_popup_icon.png +++ b/res/drawable/space_popup_icon.png diff --git a/PinyinIME/res/layout/candidates_container.xml b/res/layout/candidates_container.xml index eda7e28..eda7e28 100644 --- a/PinyinIME/res/layout/candidates_container.xml +++ b/res/layout/candidates_container.xml diff --git a/PinyinIME/res/layout/floating_container.xml b/res/layout/floating_container.xml index ad9f3fd..ad9f3fd 100644 --- a/PinyinIME/res/layout/floating_container.xml +++ b/res/layout/floating_container.xml diff --git a/PinyinIME/res/layout/skb_container.xml b/res/layout/skb_container.xml index 5a20aab..5a20aab 100644 --- a/PinyinIME/res/layout/skb_container.xml +++ b/res/layout/skb_container.xml diff --git a/PinyinIME/res/raw/dict_pinyin.dat b/res/raw/dict_pinyin.dat Binary files differindex 1be3f9c..1be3f9c 100644 --- a/PinyinIME/res/raw/dict_pinyin.dat +++ b/res/raw/dict_pinyin.dat diff --git a/PinyinIME/res/values-land/dimens.xml b/res/values-land/dimens.xml index 3ee7751..3ee7751 100644 --- a/PinyinIME/res/values-land/dimens.xml +++ b/res/values-land/dimens.xml diff --git a/PinyinIME/res/values-port/dimens.xml b/res/values-port/dimens.xml index 47a3a53..47a3a53 100644 --- a/PinyinIME/res/values-port/dimens.xml +++ b/res/values-port/dimens.xml diff --git a/PinyinIME/res/values-zh/bools.xml b/res/values-zh/bools.xml index c3291be..c3291be 100644 --- a/PinyinIME/res/values-zh/bools.xml +++ b/res/values-zh/bools.xml diff --git a/PinyinIME/res/values/colors.xml b/res/values/colors.xml index e66a1ce..e66a1ce 100644 --- a/PinyinIME/res/values/colors.xml +++ b/res/values/colors.xml diff --git a/PinyinIME/res/values/dimens.xml b/res/values/dimens.xml index 0c8519e..0c8519e 100644 --- a/PinyinIME/res/values/dimens.xml +++ b/res/values/dimens.xml diff --git a/PinyinIME/res/values/strings.xml b/res/values/strings.xml index 09d64db..09d64db 100644 --- a/PinyinIME/res/values/strings.xml +++ b/res/values/strings.xml diff --git a/PinyinIME/res/xml/method.xml b/res/xml/method.xml index 2ff16b8..2ff16b8 100644 --- a/PinyinIME/res/xml/method.xml +++ b/res/xml/method.xml diff --git a/PinyinIME/res/xml/settings.xml b/res/xml/settings.xml index b46e621..b46e621 100644 --- a/PinyinIME/res/xml/settings.xml +++ b/res/xml/settings.xml diff --git a/PinyinIME/res/xml/skb_phone.xml b/res/xml/skb_phone.xml index 80a44fb..80a44fb 100644 --- a/PinyinIME/res/xml/skb_phone.xml +++ b/res/xml/skb_phone.xml diff --git a/PinyinIME/res/xml/skb_qwerty.xml b/res/xml/skb_qwerty.xml index 57b8838..57b8838 100644 --- a/PinyinIME/res/xml/skb_qwerty.xml +++ b/res/xml/skb_qwerty.xml diff --git a/PinyinIME/res/xml/skb_smiley.xml b/res/xml/skb_smiley.xml index ec48b12..ec48b12 100644 --- a/PinyinIME/res/xml/skb_smiley.xml +++ b/res/xml/skb_smiley.xml diff --git a/PinyinIME/res/xml/skb_sym1.xml b/res/xml/skb_sym1.xml index 918fd33..918fd33 100644 --- a/PinyinIME/res/xml/skb_sym1.xml +++ b/res/xml/skb_sym1.xml diff --git a/PinyinIME/res/xml/skb_sym2.xml b/res/xml/skb_sym2.xml index a55f91e..a55f91e 100644 --- a/PinyinIME/res/xml/skb_sym2.xml +++ b/res/xml/skb_sym2.xml diff --git a/PinyinIME/res/xml/skb_template1.xml b/res/xml/skb_template1.xml index 16338eb..16338eb 100644 --- a/PinyinIME/res/xml/skb_template1.xml +++ b/res/xml/skb_template1.xml diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/BalloonHint.java b/src/com/android/inputmethod/pinyin/BalloonHint.java index 919dbf1..919dbf1 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/BalloonHint.java +++ b/src/com/android/inputmethod/pinyin/BalloonHint.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/CandidateView.java b/src/com/android/inputmethod/pinyin/CandidateView.java index 8dc1bf1..8dc1bf1 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/CandidateView.java +++ b/src/com/android/inputmethod/pinyin/CandidateView.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/CandidateViewListener.java b/src/com/android/inputmethod/pinyin/CandidateViewListener.java index 795d119..795d119 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/CandidateViewListener.java +++ b/src/com/android/inputmethod/pinyin/CandidateViewListener.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/CandidatesContainer.java b/src/com/android/inputmethod/pinyin/CandidatesContainer.java index 5b2a999..5b2a999 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/CandidatesContainer.java +++ b/src/com/android/inputmethod/pinyin/CandidatesContainer.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/ComposingView.java b/src/com/android/inputmethod/pinyin/ComposingView.java index b781cda..f70af45 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/ComposingView.java +++ b/src/com/android/inputmethod/pinyin/ComposingView.java @@ -264,6 +264,7 @@ public class ComposingView extends View { mPaint.setColor(mStrColorIdle); int oriPos = activeCmpsLen; if (cursorPos > activeCmpsLen) { + if (cursorPos > cmpsStr.length()) cursorPos = cmpsStr.length(); canvas.drawText(cmpsStr, oriPos, cursorPos, x, y, mPaint); x += mPaint.measureText(cmpsStr, oriPos, cursorPos); diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/EnglishInputProcessor.java b/src/com/android/inputmethod/pinyin/EnglishInputProcessor.java index 6d61119..6d61119 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/EnglishInputProcessor.java +++ b/src/com/android/inputmethod/pinyin/EnglishInputProcessor.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/Environment.java b/src/com/android/inputmethod/pinyin/Environment.java index 8869294..8869294 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/Environment.java +++ b/src/com/android/inputmethod/pinyin/Environment.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/InputModeSwitcher.java b/src/com/android/inputmethod/pinyin/InputModeSwitcher.java index 96b59c3..7167182 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/InputModeSwitcher.java +++ b/src/com/android/inputmethod/pinyin/InputModeSwitcher.java @@ -543,9 +543,6 @@ public class InputModeSwitcher { english = true; } else if (v == EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE) { mShortMessageField = true; - } else if ((editorInfo.imeOptions & - EditorInfo.IME_MASK_ACTION) == EditorInfo.IME_ACTION_SEARCH) { - newInputMode = MODE_HKB_CHINESE; } break; default: @@ -594,13 +591,10 @@ public class InputModeSwitcher { || v == EditorInfo.TYPE_TEXT_VARIATION_URI) { // If the application request English mode, we switch to it. newInputMode = MODE_SKB_ENGLISH_LOWER; - } else if (v == EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE) { - newInputMode = MODE_SKB_CHINESE; - mShortMessageField = true; - } else if ((editorInfo.imeOptions & - EditorInfo.IME_MASK_ACTION) == EditorInfo.IME_ACTION_SEARCH) { - newInputMode = MODE_SKB_CHINESE; } else { + if (v == EditorInfo.TYPE_TEXT_VARIATION_SHORT_MESSAGE) { + mShortMessageField = true; + } // If the application do not request English mode, we will // try to keep the previous mode. int skbLayout = (mInputMode & MASK_SKB_LAYOUT); @@ -615,7 +609,17 @@ public class InputModeSwitcher { } break; default: - newInputMode = MODE_SKB_CHINESE; + // Try to keep the previous mode. + int skbLayout = (mInputMode & MASK_SKB_LAYOUT); + newInputMode = mInputMode; + if (0 == skbLayout) { + if ((mInputMode & MASK_LANGUAGE) == MASK_LANGUAGE_CN) { + newInputMode = MODE_SKB_CHINESE; + } else { + newInputMode = MODE_SKB_ENGLISH_LOWER; + } + } + break; } mEditorInfo = editorInfo; @@ -708,7 +712,7 @@ public class InputModeSwitcher { mInputMode = newInputMode; int skbLayout = (mInputMode & MASK_SKB_LAYOUT); - if (MASK_SKB_LAYOUT_QWERTY == skbLayout) { + if (MASK_SKB_LAYOUT_QWERTY == skbLayout || 0 == skbLayout) { mRecentLauageInputMode = mInputMode; } diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/KeyMapDream.java b/src/com/android/inputmethod/pinyin/KeyMapDream.java index 5a95c6f..5a95c6f 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/KeyMapDream.java +++ b/src/com/android/inputmethod/pinyin/KeyMapDream.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/PinyinDecoderService.java b/src/com/android/inputmethod/pinyin/PinyinDecoderService.java index a4a3ac4..a4a3ac4 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/PinyinDecoderService.java +++ b/src/com/android/inputmethod/pinyin/PinyinDecoderService.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/PinyinIME.java b/src/com/android/inputmethod/pinyin/PinyinIME.java index 8d7dcce..9ac2c2d 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/PinyinIME.java +++ b/src/com/android/inputmethod/pinyin/PinyinIME.java @@ -235,17 +235,7 @@ public class PinyinIME extends InputMethodService { @Override public boolean onKeyDown(int keyCode, KeyEvent event) { - int count = event.getRepeatCount(); - if (0 == count) { - if (processKey(event, false)) return true; - } else { - boolean processed = false; - while (count > 0) { - processed |= processKey(event, true); - count--; - } - if (processed) return true; - } + if (processKey(event, 0 != event.getRepeatCount())) return true; return super.onKeyDown(keyCode, event); } @@ -265,7 +255,7 @@ public class PinyinIME extends InputMethodService { if (!realAction) return true; updateIcon(mInputModeSwitcher.switchLanguageWithHkb()); - resetToIdleState(true); + resetToIdleState(false); int allMetaState = KeyEvent.META_ALT_ON | KeyEvent.META_ALT_LEFT_ON | KeyEvent.META_ALT_RIGHT_ON | KeyEvent.META_SHIFT_ON @@ -462,6 +452,27 @@ public class PinyinIME extends InputMethodService { private boolean processStateInput(int keyChar, int keyCode, KeyEvent event, boolean realAction) { + // If ALT key is pressed, input alternative key. But if the + // alternative key is quote key, it will be used for input a splitter + // in Pinyin string. + if (event.isAltPressed()) { + if ('\'' != event.getUnicodeChar(event.getMetaState())) { + if (realAction) { + char fullwidth_char = KeyMapDream.getChineseLabel(keyCode); + if (0 != fullwidth_char) { + commitResultText(mDecInfo + .getCurrentFullSent(mCandidatesContainer + .getActiveCandiatePos()) + + String.valueOf(fullwidth_char)); + resetToIdleState(false); + } + } + return true; + } else { + keyChar = '\''; + } + } + if (keyChar >= 'a' && keyChar <= 'z' || keyChar == '\'' && !mDecInfo.charBeforeCursorIsSeparator() || keyCode == KeyEvent.KEYCODE_DEL) { @@ -513,13 +524,13 @@ public class PinyinIME extends InputMethodService { if (!realAction) return true; if (mInputModeSwitcher.isEnterNoramlState()) { commitResultText(mDecInfo.getOrigianlSplStr().toString()); - resetToIdleState(true); + resetToIdleState(false); } else { commitResultText(mDecInfo .getCurrentFullSent(mCandidatesContainer .getActiveCandiatePos())); sendKeyChar('\n'); - resetToIdleState(true); + resetToIdleState(false); } return true; } else if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER @@ -529,7 +540,7 @@ public class PinyinIME extends InputMethodService { return true; } else if (keyCode == KeyEvent.KEYCODE_BACK) { if (!realAction) return true; - resetToIdleState(true); + resetToIdleState(false); requestHideSelf(0); return true; } @@ -540,6 +551,18 @@ public class PinyinIME extends InputMethodService { KeyEvent event, boolean realAction) { if (!realAction) return true; + // If ALT key is pressed, input alternative key. + if (event.isAltPressed()) { + char fullwidth_char = KeyMapDream.getChineseLabel(keyCode); + if (0 != fullwidth_char) { + commitResultText(mDecInfo.getCandidate(mCandidatesContainer + .getActiveCandiatePos()) + + String.valueOf(fullwidth_char)); + resetToIdleState(false); + } + return true; + } + // In this status, when user presses keys in [a..z], the status will // change to input state. if (keyChar >= 'a' && keyChar <= 'z') { @@ -569,7 +592,7 @@ public class PinyinIME extends InputMethodService { } else if (keyCode == KeyEvent.KEYCODE_BACK) { resetToIdleState(false); requestHideSelf(0); - } else if (keyCode >= KeyEvent.KEYCODE_1 + } else if (keyCode >= KeyEvent.KEYCODE_1 && keyCode <= KeyEvent.KEYCODE_9) { int activePos = keyCode - KeyEvent.KEYCODE_1; int currentPage = mCandidatesContainer.getCurrentPage(); @@ -595,6 +618,32 @@ public class PinyinIME extends InputMethodService { KeyEvent event, boolean realAction) { if (!realAction) return true; + ComposingView.ComposingStatus cmpsvStatus = + mComposingView.getComposingStatus(); + + // If ALT key is pressed, input alternative key. But if the + // alternative key is quote key, it will be used for input a splitter + // in Pinyin string. + if (event.isAltPressed()) { + if ('\'' != event.getUnicodeChar(event.getMetaState())) { + char fullwidth_char = KeyMapDream.getChineseLabel(keyCode); + if (0 != fullwidth_char) { + String retStr; + if (ComposingView.ComposingStatus.SHOW_STRING_LOWERCASE == + cmpsvStatus) { + retStr = mDecInfo.getOrigianlSplStr().toString(); + } else { + retStr = mDecInfo.getComposingStr(); + } + commitResultText(retStr + String.valueOf(fullwidth_char)); + resetToIdleState(false); + } + return true; + } else { + keyChar = '\''; + } + } + if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) { if (!mDecInfo.selectionFinished()) { changeToStateInput(true); @@ -606,9 +655,6 @@ public class PinyinIME extends InputMethodService { .isEnterNoramlState()) || keyCode == KeyEvent.KEYCODE_DPAD_CENTER || keyCode == KeyEvent.KEYCODE_SPACE) { - ComposingView.ComposingStatus cmpsvStatus = mComposingView - .getComposingStatus(); - if (ComposingView.ComposingStatus.SHOW_STRING_LOWERCASE == cmpsvStatus) { String str = mDecInfo.getOrigianlSplStr().toString(); if (!tryInputRawUnicode(str)) { @@ -734,7 +780,7 @@ public class PinyinIME extends InputMethodService { private void commitResultText(String resultText) { InputConnection ic = getCurrentInputConnection(); - if (null != ic) ic.commitText(resultText, resultText.length()); + if (null != ic) ic.commitText(resultText, 1); if (null != mComposingView) { mComposingView.setVisibility(View.INVISIBLE); mComposingView.invalidate(); @@ -929,7 +975,7 @@ public class PinyinIME extends InputMethodService { if (sKey.isUserDefKey()) { updateIcon(mInputModeSwitcher.switchModeForUserKey(keyCode)); - resetToIdleState(true); + resetToIdleState(false); mSkbContainer.updateInputMode(); } else { if (sKey.isKeyCodeKey()) { @@ -968,7 +1014,7 @@ public class PinyinIME extends InputMethodService { // back to the previous soft keyboard automatically. if (!mSkbContainer.isCurrentSkbSticky()) { updateIcon(mInputModeSwitcher.requestBackToPreviousSkb()); - resetToIdleState(true); + resetToIdleState(false); mSkbContainer.updateInputMode(); } } @@ -1689,9 +1735,13 @@ public class PinyinIME extends InputMethodService { } public String getCurrentFullSent(int activeCandPos) { - String retStr = mFullSent.substring(0, mFixedLen); - retStr += mCandidatesList.get(activeCandPos); - return retStr; + try { + String retStr = mFullSent.substring(0, mFixedLen); + retStr += mCandidatesList.get(activeCandPos); + return retStr; + } catch (Exception e) { + return ""; + } } public void resetCandidates() { @@ -1818,6 +1868,9 @@ public class PinyinIME extends InputMethodService { } } catch (RemoteException e) { Log.w(TAG, "PinyinDecoderService died", e); + } catch (Exception e) { + mTotalChoicesNum = 0; + mComposingStr = ""; } // Prepare page 0. if (!mFinishSelection) { diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/Settings.java b/src/com/android/inputmethod/pinyin/Settings.java index c05f605..c05f605 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/Settings.java +++ b/src/com/android/inputmethod/pinyin/Settings.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/SettingsActivity.java b/src/com/android/inputmethod/pinyin/SettingsActivity.java index 7d23d8e..7d23d8e 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/SettingsActivity.java +++ b/src/com/android/inputmethod/pinyin/SettingsActivity.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/SkbContainer.java b/src/com/android/inputmethod/pinyin/SkbContainer.java index 2294860..2294860 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/SkbContainer.java +++ b/src/com/android/inputmethod/pinyin/SkbContainer.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/SkbPool.java b/src/com/android/inputmethod/pinyin/SkbPool.java index 4c46951..4c46951 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/SkbPool.java +++ b/src/com/android/inputmethod/pinyin/SkbPool.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/SkbTemplate.java b/src/com/android/inputmethod/pinyin/SkbTemplate.java index 9ab53ff..9ab53ff 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/SkbTemplate.java +++ b/src/com/android/inputmethod/pinyin/SkbTemplate.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/SoftKey.java b/src/com/android/inputmethod/pinyin/SoftKey.java index 67eaf29..67eaf29 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/SoftKey.java +++ b/src/com/android/inputmethod/pinyin/SoftKey.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/SoftKeyToggle.java b/src/com/android/inputmethod/pinyin/SoftKeyToggle.java index 89ff2fe..89ff2fe 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/SoftKeyToggle.java +++ b/src/com/android/inputmethod/pinyin/SoftKeyToggle.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/SoftKeyboard.java b/src/com/android/inputmethod/pinyin/SoftKeyboard.java index b8cc504..b8cc504 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/SoftKeyboard.java +++ b/src/com/android/inputmethod/pinyin/SoftKeyboard.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/SoftKeyboardView.java b/src/com/android/inputmethod/pinyin/SoftKeyboardView.java index 5543f33..5543f33 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/SoftKeyboardView.java +++ b/src/com/android/inputmethod/pinyin/SoftKeyboardView.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/SoundManager.java b/src/com/android/inputmethod/pinyin/SoundManager.java index 82be407..82be407 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/SoundManager.java +++ b/src/com/android/inputmethod/pinyin/SoundManager.java diff --git a/PinyinIME/src/com/android/inputmethod/pinyin/XmlKeyboardLoader.java b/src/com/android/inputmethod/pinyin/XmlKeyboardLoader.java index fd192a3..fd192a3 100644 --- a/PinyinIME/src/com/android/inputmethod/pinyin/XmlKeyboardLoader.java +++ b/src/com/android/inputmethod/pinyin/XmlKeyboardLoader.java |