diff options
author | 2010-11-23 23:59:56 -0800 | |
---|---|---|
committer | 2010-11-25 00:11:21 -0800 | |
commit | 7f0befe1f0e346ec6468f229f337eda32e19f6d8 (patch) | |
tree | 63ec28b201708fca18c4da3eb5340fdd508d8d77 /java | |
parent | 79efbed76f638be298493107fa2d0cd1b5eb529e (diff) | |
download | latinime-7f0befe1f0e346ec6468f229f337eda32e19f6d8.tar.gz latinime-7f0befe1f0e346ec6468f229f337eda32e19f6d8.tar.xz latinime-7f0befe1f0e346ec6468f229f337eda32e19f6d8.zip |
Update tablet keyboard layout to the latest design
This change introduces shiftedIcon attribute for Key which specifies
icon to draw the shift key while the key is in shifted state.
This change also intriduces new configurable dimension value
key_label_horizontal_alignment_padding which represents horizontal
padding for left or right alignment of key label.
Bug: 3216592
Bug: 3201839
Change-Id: I3aa7392227ce573c404517678e6340a8d1fcb328
Diffstat (limited to 'java')
96 files changed, 870 insertions, 433 deletions
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 bc0a03fc1..c89f7385a 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_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_off_holo.9.png Binary files differindex 3f2fc0002..1fbb15ea5 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_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_normal_on_holo.9.png Binary files differindex 9e77015ea..e4469c6dc 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_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_holo.9.png Binary files differindex b3ac506ad..f574a38c9 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_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_off_holo.9.png Binary files differindex 66138edec..af5253763 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_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_dark_pressed_on_holo.9.png Binary files differindex 7c80300e9..541cf5c4a 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_light_normal_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_light_normal_holo.9.png Binary files differindex 737de397b..0ad025c90 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_pressed_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_light_pressed_holo.9.png Binary files differindex 3dcd8323d..c0403f0bd 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_popup_selected_holo.9.png b/java/res/drawable-hdpi/btn_keyboard_key_popup_selected_holo.9.png Binary files differnew file mode 100644 index 000000000..4a77ffb97 --- /dev/null +++ b/java/res/drawable-hdpi/btn_keyboard_key_popup_selected_holo.9.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 2b8520a92..e7ce4b065 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 ff56845f8..3e8db989c 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_exclamation_holo.9.png b/java/res/drawable-hdpi/key_hint_exclamation_holo.9.png Binary files differindex 7230fb92a..0e2d3545e 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 0152ce21b..75a450c87 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_question_holo.9.png b/java/res/drawable-hdpi/key_hint_question_holo.9.png Binary files differindex 088550f5b..84bf78fd4 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 8a9dffbe2..d1e9fda06 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 51dcfac99..9d5a88bbf 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 6514e0bf7..49154a737 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_underline_holo.9.png b/java/res/drawable-hdpi/key_hint_underline_holo.9.png Binary files differindex fef1b6369..8d83cf938 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/keyboard_background_holo.9.png b/java/res/drawable-hdpi/keyboard_background_holo.9.png Binary files differnew file mode 100644 index 000000000..1eeb9e5cc --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_background_holo.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 differnew file mode 100644 index 000000000..571f3aa37 --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_key_feedback_background_holo.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 differnew file mode 100644 index 000000000..c33d66429 --- /dev/null +++ b/java/res/drawable-hdpi/keyboard_popup_panel_background_holo.9.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 differnew file mode 100644 index 000000000..c432bf4a3 --- /dev/null +++ b/java/res/drawable-hdpi/sym_keyboard_shift_locked_holo.png diff --git a/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_holo.9.png b/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_holo.9.png Binary files differindex bc0a03fc1..c89f7385a 100644 --- a/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_holo.9.png +++ b/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_holo.9.png diff --git a/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_off_holo.9.png b/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_off_holo.9.png Binary files differindex 3f2fc0002..1fbb15ea5 100644 --- a/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_off_holo.9.png +++ b/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_off_holo.9.png diff --git a/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_on_holo.9.png b/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_on_holo.9.png Binary files differindex 9e77015ea..e4469c6dc 100644 --- a/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_on_holo.9.png +++ b/java/res/drawable-mdpi/btn_keyboard_key_dark_normal_on_holo.9.png diff --git a/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_holo.9.png b/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_holo.9.png Binary files differindex b3ac506ad..f574a38c9 100644 --- a/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_holo.9.png +++ b/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_holo.9.png diff --git a/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_off_holo.9.png b/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_off_holo.9.png Binary files differindex 66138edec..af5253763 100644 --- a/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_off_holo.9.png +++ b/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_off_holo.9.png diff --git a/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_on_holo.9.png b/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_on_holo.9.png Binary files differindex 7c80300e9..541cf5c4a 100644 --- a/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_on_holo.9.png +++ b/java/res/drawable-mdpi/btn_keyboard_key_dark_pressed_on_holo.9.png diff --git a/java/res/drawable-mdpi/btn_keyboard_key_light_normal_holo.9.png b/java/res/drawable-mdpi/btn_keyboard_key_light_normal_holo.9.png Binary files differindex 737de397b..0ad025c90 100644 --- a/java/res/drawable-mdpi/btn_keyboard_key_light_normal_holo.9.png +++ b/java/res/drawable-mdpi/btn_keyboard_key_light_normal_holo.9.png diff --git a/java/res/drawable-mdpi/btn_keyboard_key_light_pressed_holo.9.png b/java/res/drawable-mdpi/btn_keyboard_key_light_pressed_holo.9.png Binary files differindex 3dcd8323d..c0403f0bd 100644 --- a/java/res/drawable-mdpi/btn_keyboard_key_light_pressed_holo.9.png +++ b/java/res/drawable-mdpi/btn_keyboard_key_light_pressed_holo.9.png diff --git a/java/res/drawable-mdpi/btn_keyboard_key_popup_selected_holo.9.png b/java/res/drawable-mdpi/btn_keyboard_key_popup_selected_holo.9.png Binary files differnew file mode 100644 index 000000000..4a77ffb97 --- /dev/null +++ b/java/res/drawable-mdpi/btn_keyboard_key_popup_selected_holo.9.png diff --git a/java/res/drawable-mdpi/hint_popup_holo.9.png b/java/res/drawable-mdpi/hint_popup_holo.9.png Binary files differnew file mode 100644 index 000000000..f3ab24481 --- /dev/null +++ b/java/res/drawable-mdpi/hint_popup_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_at_holo.9.png b/java/res/drawable-mdpi/key_hint_at_holo.9.png Binary files differindex 2b8520a92..54ec524be 100644 --- a/java/res/drawable-mdpi/key_hint_at_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_at_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_at_large_holo.9.png b/java/res/drawable-mdpi/key_hint_at_large_holo.9.png Binary files differindex ff56845f8..ae7b64543 100644 --- a/java/res/drawable-mdpi/key_hint_at_large_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_at_large_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_exclamation_holo.9.png b/java/res/drawable-mdpi/key_hint_exclamation_holo.9.png Binary files differindex 7230fb92a..0e2d3545e 100644 --- a/java/res/drawable-mdpi/key_hint_exclamation_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_exclamation_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_exclamation_large_holo.9.png b/java/res/drawable-mdpi/key_hint_exclamation_large_holo.9.png Binary files differindex 0152ce21b..75a450c87 100644 --- a/java/res/drawable-mdpi/key_hint_exclamation_large_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_exclamation_large_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_question_holo.9.png b/java/res/drawable-mdpi/key_hint_question_holo.9.png Binary files differindex 088550f5b..84bf78fd4 100644 --- a/java/res/drawable-mdpi/key_hint_question_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_question_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_question_large_holo.9.png b/java/res/drawable-mdpi/key_hint_question_large_holo.9.png Binary files differindex 8a9dffbe2..d1e9fda06 100644 --- a/java/res/drawable-mdpi/key_hint_question_large_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_question_large_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_quote_holo.9.png b/java/res/drawable-mdpi/key_hint_quote_holo.9.png Binary files differindex 51dcfac99..9d5a88bbf 100644 --- a/java/res/drawable-mdpi/key_hint_quote_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_quote_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_quote_large_holo.9.png b/java/res/drawable-mdpi/key_hint_quote_large_holo.9.png Binary files differindex 6514e0bf7..49154a737 100644 --- a/java/res/drawable-mdpi/key_hint_quote_large_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_quote_large_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_underline_holo.9.png b/java/res/drawable-mdpi/key_hint_underline_holo.9.png Binary files differindex fef1b6369..8d83cf938 100644 --- a/java/res/drawable-mdpi/key_hint_underline_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_underline_holo.9.png diff --git a/java/res/drawable-mdpi/key_hint_underline_large_holo.9.png b/java/res/drawable-mdpi/key_hint_underline_large_holo.9.png Binary files differindex d584dad3d..8d83b6277 100644 --- a/java/res/drawable-mdpi/key_hint_underline_large_holo.9.png +++ b/java/res/drawable-mdpi/key_hint_underline_large_holo.9.png diff --git a/java/res/drawable-mdpi/keyboard_background_holo.9.png b/java/res/drawable-mdpi/keyboard_background_holo.9.png Binary files differnew file mode 100644 index 000000000..13cb0a071 --- /dev/null +++ b/java/res/drawable-mdpi/keyboard_background_holo.9.png diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_background_holo.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_background_holo.9.png Binary files differnew file mode 100644 index 000000000..571f3aa37 --- /dev/null +++ b/java/res/drawable-mdpi/keyboard_key_feedback_background_holo.9.png diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_more_background_holo.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_more_background_holo.9.png Binary files differnew file mode 100644 index 000000000..94756b717 --- /dev/null +++ b/java/res/drawable-mdpi/keyboard_key_feedback_more_background_holo.9.png diff --git a/java/res/drawable-mdpi/keyboard_popup_panel_background_holo.9.png b/java/res/drawable-mdpi/keyboard_popup_panel_background_holo.9.png Binary files differnew file mode 100644 index 000000000..c33d66429 --- /dev/null +++ b/java/res/drawable-mdpi/keyboard_popup_panel_background_holo.9.png diff --git a/java/res/drawable-mdpi/sym_keyboard_delete_holo.png b/java/res/drawable-mdpi/sym_keyboard_delete_holo.png Binary files differnew file mode 100644 index 000000000..1141ddd83 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_delete_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_num0_holo.png b/java/res/drawable-mdpi/sym_keyboard_num0_holo.png Binary files differnew file mode 100644 index 000000000..39f19a487 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_num0_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_num1_holo.png b/java/res/drawable-mdpi/sym_keyboard_num1_holo.png Binary files differnew file mode 100644 index 000000000..40c82a7f4 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_num1_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_num2_holo.png b/java/res/drawable-mdpi/sym_keyboard_num2_holo.png Binary files differnew file mode 100644 index 000000000..0f444b76b --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_num2_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_num3_holo.png b/java/res/drawable-mdpi/sym_keyboard_num3_holo.png Binary files differnew file mode 100644 index 000000000..e4c5bee3a --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_num3_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_num4_holo.png b/java/res/drawable-mdpi/sym_keyboard_num4_holo.png Binary files differnew file mode 100644 index 000000000..68404aa43 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_num4_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_num5_holo.png b/java/res/drawable-mdpi/sym_keyboard_num5_holo.png Binary files differnew file mode 100644 index 000000000..dfa3b8925 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_num5_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_num6_holo.png b/java/res/drawable-mdpi/sym_keyboard_num6_holo.png Binary files differnew file mode 100644 index 000000000..1827d5409 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_num6_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_num7_holo.png b/java/res/drawable-mdpi/sym_keyboard_num7_holo.png Binary files differnew file mode 100644 index 000000000..2488b7f91 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_num7_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_num8_holo.png b/java/res/drawable-mdpi/sym_keyboard_num8_holo.png Binary files differnew file mode 100644 index 000000000..3f60df194 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_num8_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_num9_holo.png b/java/res/drawable-mdpi/sym_keyboard_num9_holo.png Binary files differnew file mode 100644 index 000000000..71c5dfc6e --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_num9_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_numbpound_holo.png b/java/res/drawable-mdpi/sym_keyboard_numbpound_holo.png Binary files differnew file mode 100644 index 000000000..a9866bbac --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_numbpound_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_numbstar_holo.png b/java/res/drawable-mdpi/sym_keyboard_numbstar_holo.png Binary files differnew file mode 100644 index 000000000..ba4ea88e8 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_numbstar_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_return_holo.png b/java/res/drawable-mdpi/sym_keyboard_return_holo.png Binary files differnew file mode 100644 index 000000000..f64c73160 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_return_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_shift_holo.png b/java/res/drawable-mdpi/sym_keyboard_shift_holo.png Binary files differnew file mode 100644 index 000000000..b7d62136d --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_shift_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_shift_lock.png b/java/res/drawable-mdpi/sym_keyboard_shift_lock.png Binary files differdeleted file mode 100644 index 244179c2d..000000000 --- a/java/res/drawable-mdpi/sym_keyboard_shift_lock.png +++ /dev/null diff --git a/java/res/drawable-mdpi/sym_keyboard_shift_locked_holo.png b/java/res/drawable-mdpi/sym_keyboard_shift_locked_holo.png Binary files differnew file mode 100644 index 000000000..c432bf4a3 --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_shift_locked_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_smiley_holo.png b/java/res/drawable-mdpi/sym_keyboard_smiley_holo.png Binary files differnew file mode 100644 index 000000000..a123d4cdf --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_smiley_holo.png diff --git a/java/res/drawable-mdpi/sym_keyboard_space_holo.png b/java/res/drawable-mdpi/sym_keyboard_space_holo.png Binary files differnew file mode 100644 index 000000000..d1ef4414e --- /dev/null +++ b/java/res/drawable-mdpi/sym_keyboard_space_holo.png diff --git a/java/res/drawable/btn_keyboard_key_honeycomb_popup.xml b/java/res/drawable/btn_keyboard_key_honeycomb_popup.xml new file mode 100644 index 000000000..87e952c60 --- /dev/null +++ b/java/res/drawable/btn_keyboard_key_honeycomb_popup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 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. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true" + android:drawable="@drawable/btn_keyboard_key_popup_selected_holo" /> + <item android:drawable="@drawable/btn_keyboard_key_light_popup_normal" /> +</selector> diff --git a/java/res/drawable/keyboard_key_feedback_honeycomb.xml b/java/res/drawable/keyboard_key_feedback_honeycomb.xml new file mode 100644 index 000000000..dd9b53e46 --- /dev/null +++ b/java/res/drawable/keyboard_key_feedback_honeycomb.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 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. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_long_pressable="true" + android:drawable="@drawable/keyboard_key_feedback_more_background" /> + <item android:drawable="@drawable/keyboard_key_feedback_background_holo" /> +</selector> diff --git a/java/res/layout-xlarge/keyboard_popup_honeycomb.xml b/java/res/layout-xlarge/keyboard_popup_honeycomb.xml new file mode 100644 index 000000000..50e91f7ea --- /dev/null +++ b/java/res/layout-xlarge/keyboard_popup_honeycomb.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2010, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:background="@drawable/keyboard_popup_panel_background_holo" + android:paddingLeft="44dip" + android:paddingRight="32dip" + > + <com.android.inputmethod.latin.BaseKeyboardView + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" + android:id="@+id/BaseKeyboardView" + android:layout_alignParentBottom="true" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/latinkeyboard_transparent" + + latin:keyBackground="@drawable/btn_keyboard_key_honeycomb_popup" + latin:keyHysteresisDistance="0dip" + latin:verticalCorrection="@dimen/mini_keyboard_vertical_correction" + /> +</LinearLayout> diff --git a/java/res/layout/input_honeycomb.xml b/java/res/layout/input_honeycomb.xml index 7bc0df427..79eb7be96 100644 --- a/java/res/layout/input_honeycomb.xml +++ b/java/res/layout/input_honeycomb.xml @@ -27,9 +27,11 @@ android:layout_height="wrap_content" android:paddingTop="@dimen/keyboard_top_padding" android:paddingBottom="@dimen/keyboard_bottom_padding" - android:background="@drawable/keyboard_dark_background" + android:background="@drawable/keyboard_background_holo" android:textStyle="bold" latin:keyBackground="@drawable/btn_keyboard_key_honeycomb" + latin:keyPreviewLayout="@layout/key_preview_honeycomb" + latin:popupLayout="@layout/keyboard_popup_honeycomb" latin:keyTextStyle="bold" /> diff --git a/java/res/layout/key_preview_honeycomb.xml b/java/res/layout/key_preview_honeycomb.xml new file mode 100644 index 000000000..a90fe5588 --- /dev/null +++ b/java/res/layout/key_preview_honeycomb.xml @@ -0,0 +1,29 @@ +<?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. +*/ +--> + +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="80sp" + android:textSize="40sp" + android:textColor="@color/latinkeyboard_key_color_white" + android:minWidth="24dip" + android:gravity="center" + android:background="@drawable/keyboard_key_feedback_honeycomb" + /> diff --git a/java/res/layout/keyboard_popup_honeycomb.xml b/java/res/layout/keyboard_popup_honeycomb.xml new file mode 100644 index 000000000..63b535381 --- /dev/null +++ b/java/res/layout/keyboard_popup_honeycomb.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2010, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:background="@drawable/keyboard_popup_panel_background_holo" + android:paddingLeft="24dip" + android:paddingRight="24dip" + > + <com.android.inputmethod.latin.BaseKeyboardView + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" + android:id="@+id/BaseKeyboardView" + android:layout_alignParentBottom="true" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@color/latinkeyboard_transparent" + + latin:keyBackground="@drawable/btn_keyboard_key_honeycomb_popup" + latin:keyHysteresisDistance="0dip" + latin:verticalCorrection="@dimen/mini_keyboard_vertical_correction" + /> +</LinearLayout> diff --git a/java/res/values-xlarge/dimens.xml b/java/res/values-xlarge/dimens.xml index 1162a3172..58fea4edf 100644 --- a/java/res/values-xlarge/dimens.xml +++ b/java/res/values-xlarge/dimens.xml @@ -21,22 +21,24 @@ <resources> <!-- key_height + key_bottom_gap = popup_key_height --> <dimen name="key_height">13.0mm</dimen> - <dimen name="key_bottom_gap">2.0mm</dimen> + <dimen name="key_bottom_gap">1.5mm</dimen> <dimen name="key_horizontal_gap">2.0mm</dimen> <dimen name="popup_key_height">15.0mm</dimen> <dimen name="keyboard_top_padding">1.0mm</dimen> <dimen name="keyboard_bottom_padding">1.0mm</dimen> - <!-- key_height x 1.6 --> - <dimen name="key_preview_height">20.8mm</dimen> + <!-- key_height x 1.0 --> + <dimen name="key_preview_height">13.0mm</dimen> <!-- Amount of allowance for selecting keys in a mini popup keyboard by sliding finger. --> <!-- popup_key_height x 1.2 --> <dimen name="mini_keyboard_slide_allowance">15.6mm</dimen> <!-- popup_key_height x -1.0 --> <dimen name="mini_keyboard_vertical_correction">-13.0mm</dimen> - <dimen name="key_text_size">0.175in</dimen> - <dimen name="key_label_text_size">0.110in</dimen> - <dimen name="key_preview_text_size_large">0.245in</dimen> + <dimen name="key_text_size">24dip</dimen> + <dimen name="key_label_text_size">18dip</dimen> + <dimen name="key_preview_text_size_large">24dip</dimen> + <!-- left or right padding for of label alignment --> + <dimen name="key_label_horizontal_alignment_padding">18dip</dimen> <dimen name="candidate_strip_height">46dip</dimen> </resources> diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 28ea6fccc..ee4ec0517 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -126,6 +126,8 @@ <attr name="manualTemporaryUpperCaseHintIcon" format="reference" /> <!-- The key style to specify a set of key attributes defined by <key_style/> --> <attr name="keyStyle" format="string" /> + <!-- Shift key icon for shifted state --> + <attr name="shiftedIcon" format="reference" /> </declare-styleable> <declare-styleable name="BaseKeyboard_Row"> diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml index 0073835fd..f29bc4d11 100644 --- a/java/res/values/dimens.xml +++ b/java/res/values/dimens.xml @@ -37,6 +37,8 @@ <dimen name="key_text_size">0.13in</dimen> <dimen name="key_label_text_size">0.083in</dimen> <dimen name="key_preview_text_size_large">40sp</dimen> + <!-- left or right padding for of label alignment --> + <dimen name="key_label_horizontal_alignment_padding">0.13in</dimen> <dimen name="key_preview_offset">0.000in</dimen> <!-- We use "inch", not "dip" because this value tries dealing with physical distance related to user's finger. --> diff --git a/java/res/xml-xlarge/kbd_key_styles.xml b/java/res/xml-xlarge/kbd_key_styles.xml new file mode 100644 index 000000000..0643bc344 --- /dev/null +++ b/java/res/xml-xlarge/kbd_key_styles.xml @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2010, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<merge + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <!-- Functional key styles --> + <switch> + <case + latin:colorScheme="white" + > + <key-style + latin:styleName="functionalKeyStyle" + latin:isModifier="true" /> + <key-style + latin:styleName="shiftKeyStyle" + latin:codes="@integer/key_shift" + latin:keyIcon="@drawable/sym_keyboard_shift_holo" + latin:shiftedIcon="@drawable/sym_keyboard_shift_locked_holo" + latin:iconPreview="@drawable/sym_keyboard_feedback_shift" + latin:parentStyle="functionalKeyStyle" + latin:isSticky="true" /> + <key-style + latin:styleName="deleteKeyStyle" + latin:codes="@integer/key_delete" + latin:keyIcon="@drawable/sym_keyboard_delete_holo" + latin:iconPreview="@drawable/sym_keyboard_feedback_delete" + latin:parentStyle="functionalKeyStyle" + latin:isRepeatable="true" /> + <key-style + latin:styleName="returnKeyStyle" + latin:codes="@integer/key_return" + latin:keyIcon="@drawable/sym_keyboard_return_holo" + latin:iconPreview="@drawable/sym_keyboard_feedback_return" + latin:parentStyle="functionalKeyStyle" /> + 1 + <key-style + latin:styleName="spaceKeyStyle" + latin:codes="@integer/key_space" + latin:keyIcon="@drawable/sym_keyboard_space_holo" + latin:iconPreview="@drawable/sym_keyboard_feedback_space" + latin:parentStyle="functionalKeyStyle" /> + <key-style + latin:styleName="nonSpecialBackgroundSpaceKeyStyle" + latin:codes="@integer/key_space" + latin:keyIcon="@drawable/sym_keyboard_space_holo" + latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> + <key-style + latin:styleName="smileyKeyStyle" + latin:codes="0" + latin:keyIcon="@drawable/sym_keyboard_smiley_holo" + latin:keyOutputText=";-) " + latin:keyHintIcon="@drawable/hint_popup_holo" + latin:popupKeyboard="@xml/popup_smileys" /> + </case> + <case + latin:colorScheme="black" + > + <key-style + latin:styleName="functionalKeyStyle" /> + <key-style + latin:styleName="shiftKeyStyle" + latin:codes="@integer/key_shift" + latin:keyIcon="@drawable/sym_bkeyboard_shift" + latin:shiftedIcon="@drawable/sym_bkeyboard_shift_locked" + latin:iconPreview="@drawable/sym_keyboard_feedback_shift" + latin:parentStyle="functionalKeyStyle" + latin:isSticky="true" /> + <key-style + latin:styleName="deleteKeyStyle" + latin:codes="@integer/key_delete" + latin:keyIcon="@drawable/sym_bkeyboard_delete" + latin:iconPreview="@drawable/sym_keyboard_feedback_delete" + latin:parentStyle="functionalKeyStyle" + latin:isRepeatable="true" /> + <key-style + latin:styleName="returnKeyStyle" + latin:codes="@integer/key_return" + latin:keyIcon="@drawable/sym_bkeyboard_return" + latin:iconPreview="@drawable/sym_keyboard_feedback_return" + latin:parentStyle="functionalKeyStyle" /> + <key-style + latin:styleName="spaceKeyStyle" + latin:codes="@integer/key_space" + latin:keyIcon="@drawable/sym_bkeyboard_space" + latin:iconPreview="@drawable/sym_keyboard_feedback_space" + latin:parentStyle="functionalKeyStyle" /> + <key-style + latin:styleName="nonSpecialBackgroundSpaceKeyStyle" + latin:codes="@integer/key_space" + latin:keyIcon="@drawable/sym_bkeyboard_space" + latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> + <key-style + latin:styleName="smileyKeyStyle" + latin:keyLabel=";-)" + latin:keyOutputText=";-) " + latin:keyHintIcon="@drawable/hint_popup_holo" + latin:popupKeyboard="@xml/popup_smileys" /> + </case> + </switch> + <key-style + latin:styleName="tabKeyStyle" + latin:codes="@integer/key_tab" + latin:keyLabel="@string/label_tab_key" + latin:keyLabelOption="fontNormal" + latin:parentStyle="functionalKeyStyle" /> + <key-style + latin:styleName="toSymbolKeyStyle" + latin:codes="@integer/key_switch_alpha_symbol" + latin:keyLabel="@string/label_to_symbol_key" + latin:keyLabelOption="fontNormal" + latin:parentStyle="functionalKeyStyle" /> + <key-style + latin:styleName="toAlphaKeyStyle" + latin:codes="@integer/key_switch_alpha_symbol" + latin:keyLabel="@string/label_to_alpha_key" + latin:keyLabelOption="fontNormal" + latin:parentStyle="functionalKeyStyle" /> + <key-style + latin:styleName="moreKeyStyle" + latin:codes="@integer/key_shift" + latin:keyLabel="@string/label_more_key" + latin:keyLabelOption="fontNormal" + latin:parentStyle="functionalKeyStyle" + latin:isSticky="true" /> + <key-style + latin:styleName="comKeyStyle" + latin:keyLabel=".com" + latin:keyLabelOption="fontNormal" + latin:keyHintIcon="@drawable/hint_popup_holo" + latin:popupKeyboard="@xml/popup_domains" /> +</merge> diff --git a/java/res/xml-xlarge/kbd_number.xml b/java/res/xml-xlarge/kbd_number.xml index dd251ea9f..f5f4fbc8a 100644 --- a/java/res/xml-xlarge/kbd_number.xml +++ b/java/res/xml-xlarge/kbd_number.xml @@ -25,13 +25,13 @@ latin:verticalGap="@dimen/key_bottom_gap" latin:keyHeight="@dimen/key_height" > + <include + latin:keyboardLayout="@xml/kbd_key_styles" /> <!-- This row is intentionally not marked as a top row --> <Row> <Key - latin:codes="@integer/key_tab" - latin:keyLabel="@string/label_tab_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" - latin:isModifier="true" + latin:keyStyle="tabKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyEdgeFlags="left" /> <Spacer latin:horizontalGap="4.458%p" /> @@ -55,12 +55,8 @@ <Spacer latin:horizontalGap="9.360%p" /> <Key - latin:codes="@integer/key_delete" - latin:keyLabel="@string/label_backspace_key" - latin:keyLabelOption="fontNormal|alignRight|alignBottom" + latin:keyStyle="deleteKeyStyle" latin:keyWidth="9.804%p" - latin:isModifier="true" - latin:isRepeatable="true" latin:keyEdgeFlags="right" /> </Row> <Row> @@ -86,11 +82,8 @@ <Spacer latin:horizontalGap="4.458%p" /> <Key - latin:codes="@integer/key_return" - latin:keyLabel="@string/label_return_key" - latin:keyLabelOption="fontNormal|alignRight|alignBottom" + latin:keyStyle="returnKeyStyle" latin:keyWidth="14.706%p" - latin:isModifier="true" latin:keyEdgeFlags="right" /> </Row> <Row> @@ -125,9 +118,7 @@ <Spacer latin:horizontalGap="16.406%p" /> <Key - latin:codes="@integer/key_space" - latin:keyIcon="@drawable/sym_keyboard_space" - latin:iconPreview="@drawable/sym_keyboard_feedback_space" + latin:keyStyle="nonSpecialBackgroundSpaceKeyStyle" latin:keyWidth="24.127%p" /> <Spacer latin:horizontalGap="4.458%p" /> diff --git a/java/res/xml-xlarge/kbd_numkey_styles.xml b/java/res/xml-xlarge/kbd_numkey_styles.xml new file mode 100644 index 000000000..adf45a861 --- /dev/null +++ b/java/res/xml-xlarge/kbd_numkey_styles.xml @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2010, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<merge + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <switch> + <case + latin:colorScheme="white" + > + <key-style + latin:styleName="num0KeyStyle" + latin:codes="48" + latin:keyIcon="@drawable/sym_keyboard_num0_holo" /> + <key-style + latin:styleName="num1KeyStyle" + latin:codes="49" + latin:keyIcon="@drawable/sym_keyboard_num1_holo" /> + <key-style + latin:styleName="num2KeyStyle" + latin:codes="50" + latin:keyIcon="@drawable/sym_keyboard_num2_holo" /> + <key-style + latin:styleName="num3KeyStyle" + latin:codes="51" + latin:keyIcon="@drawable/sym_keyboard_num3_holo" /> + <key-style + latin:styleName="num4KeyStyle" + latin:codes="52" + latin:keyIcon="@drawable/sym_keyboard_num4_holo" /> + <key-style + latin:styleName="num5KeyStyle" + latin:codes="53" + latin:keyIcon="@drawable/sym_keyboard_num5_holo" /> + <key-style + latin:styleName="num6KeyStyle" + latin:codes="54" + latin:keyIcon="@drawable/sym_keyboard_num6_holo" /> + <key-style + latin:styleName="num7KeyStyle" + latin:codes="55" + latin:keyIcon="@drawable/sym_keyboard_num7_holo" /> + <key-style + latin:styleName="num8KeyStyle" + latin:codes="56" + latin:keyIcon="@drawable/sym_keyboard_num8_holo" /> + <key-style + latin:styleName="num9KeyStyle" + latin:codes="57" + latin:keyIcon="@drawable/sym_keyboard_num9_holo" /> + <key-style + latin:styleName="numStarKeyStyle" + latin:codes="42" + latin:keyIcon="@drawable/sym_keyboard_numbstar_holo" /> + <key-style + latin:styleName="numPoundKeyStyle" + latin:codes="35" + latin:keyIcon="@drawable/sym_keyboard_numbpound_holo" /> + <key-style + latin:styleName="numAltKeyStyle" + latin:codes="@integer/key_switch_alpha_symbol" + latin:keyIcon="@drawable/sym_keyboard_numalt" + latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" /> + <key-style + latin:styleName="numSpaceKeyStyle" + latin:codes="@integer/key_space" + latin:keyIcon="@drawable/sym_keyboard_space_holo" + latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> + </case> + <case + latin:colorScheme="black" + > + <key-style + latin:styleName="num0KeyStyle" + latin:codes="48" + latin:keyIcon="@drawable/sym_bkeyboard_num0" /> + <key-style + latin:styleName="num1KeyStyle" + latin:codes="49" + latin:keyIcon="@drawable/sym_bkeyboard_num1" /> + <key-style + latin:styleName="num2KeyStyle" + latin:codes="50" + latin:keyIcon="@drawable/sym_bkeyboard_num2" /> + <key-style + latin:styleName="num3KeyStyle" + latin:codes="51" + latin:keyIcon="@drawable/sym_bkeyboard_num3" /> + <key-style + latin:styleName="num4KeyStyle" + latin:codes="52" + latin:keyIcon="@drawable/sym_bkeyboard_num4" /> + <key-style + latin:styleName="num5KeyStyle" + latin:codes="53" + latin:keyIcon="@drawable/sym_bkeyboard_num5" /> + <key-style + latin:styleName="num6KeyStyle" + latin:codes="54" + latin:keyIcon="@drawable/sym_bkeyboard_num6" /> + <key-style + latin:styleName="num7KeyStyle" + latin:codes="55" + latin:keyIcon="@drawable/sym_bkeyboard_num7" /> + <key-style + latin:styleName="num8KeyStyle" + latin:codes="56" + latin:keyIcon="@drawable/sym_bkeyboard_num8" /> + <key-style + latin:styleName="num9KeyStyle" + latin:codes="57" + latin:keyIcon="@drawable/sym_bkeyboard_num9" /> + <key-style + latin:styleName="numStarKeyStyle" + latin:codes="42" + latin:keyIcon="@drawable/sym_bkeyboard_numstar" /> + <key-style + latin:styleName="numPoundKeyStyle" + latin:codes="35" + latin:keyIcon="@drawable/sym_bkeyboard_numpound" /> + <key-style + latin:styleName="numAltKeyStyle" + latin:codes="@integer/key_switch_alpha_symbol" + latin:keyIcon="@drawable/sym_bkeyboard_numalt" + latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" /> + <key-style + latin:styleName="numSpaceKeyStyle" + latin:codes="@integer/key_space" + latin:keyIcon="@drawable/sym_bkeyboard_space" + latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> + </case> + </switch> +</merge> diff --git a/java/res/xml-xlarge/kbd_phone.xml b/java/res/xml-xlarge/kbd_phone.xml index 842c74bf5..483b022a5 100644 --- a/java/res/xml-xlarge/kbd_phone.xml +++ b/java/res/xml-xlarge/kbd_phone.xml @@ -25,13 +25,15 @@ latin:verticalGap="@dimen/key_bottom_gap" latin:keyHeight="@dimen/key_height" > + <include + latin:keyboardLayout="@xml/kbd_key_styles" /> + <include + latin:keyboardLayout="@xml/kbd_numkey_styles" /> <!-- This row is intentionally not marked as a top row --> <Row> <Key - latin:codes="@integer/key_tab" - latin:keyLabel="@string/label_tab_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" - latin:isModifier="true" + latin:keyStyle="tabKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyEdgeFlags="left" /> <!-- To match one character label size with "Tab", I placed spaces around the char '-' and '+'. --> @@ -48,32 +50,22 @@ <Spacer latin:horizontalGap="8.479%p" /> <Key - latin:codes="49" - latin:keyIcon="@drawable/sym_keyboard_num1" /> + latin:keyStyle="num1KeyStyle" /> <Key - latin:codes="50" - latin:keyIcon="@drawable/sym_keyboard_num2" /> + latin:keyStyle="num2KeyStyle" /> <Key - latin:codes="51" - latin:keyIcon="@drawable/sym_keyboard_num3" /> + latin:keyStyle="num3KeyStyle" /> <Spacer - latin:horizontalGap="4.458%p" /> + latin:horizontalGap="9.360%p" /> <Key - latin:codes="@integer/key_delete" - latin:keyLabel="@string/label_backspace_key" - latin:keyLabelOption="fontNormal|alignRight|alignBottom" - latin:keyWidth="14.706%p" - latin:isModifier="true" - latin:isRepeatable="true" + latin:keyStyle="deleteKeyStyle" + latin:keyWidth="9.804%p" latin:keyEdgeFlags="right" /> </Row> <Row> <Key - latin:codes="@integer/key_shift" - latin:keyLabel="@string/label_more_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" - latin:isModifier="true" - latin:isSticky="true" + latin:keyStyle="moreKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyEdgeFlags="left" /> <!-- To match one character label size with "More", I placed spaces around the char ',' and '.'. --> @@ -90,22 +82,16 @@ <Spacer latin:horizontalGap="8.479%p" /> <Key - latin:codes="52" - latin:keyIcon="@drawable/sym_keyboard_num4" /> + latin:keyStyle="num4KeyStyle" /> <Key - latin:codes="53" - latin:keyIcon="@drawable/sym_keyboard_num5" /> + latin:keyStyle="num5KeyStyle" /> <Key - latin:codes="54" - latin:keyIcon="@drawable/sym_keyboard_num6" /> + latin:keyStyle="num6KeyStyle" /> <Spacer latin:horizontalGap="4.458%p" /> <Key - latin:codes="@integer/key_return" - latin:keyLabel="@string/label_return_key" - latin:keyLabelOption="fontNormal|alignRight|alignBottom" + latin:keyStyle="returnKeyStyle" latin:keyWidth="14.706%p" - latin:isModifier="true" latin:keyEdgeFlags="right" /> </Row> <Row> @@ -126,14 +112,11 @@ <Spacer latin:horizontalGap="8.479%p" /> <Key - latin:codes="55" - latin:keyIcon="@drawable/sym_keyboard_num7" /> + latin:keyStyle="num7KeyStyle" /> <Key - latin:codes="56" - latin:keyIcon="@drawable/sym_keyboard_num8" /> + latin:keyStyle="num8KeyStyle" /> <Key - latin:codes="57" - latin:keyIcon="@drawable/sym_keyboard_num9" /> + latin:keyStyle="num9KeyStyle" /> <!-- There is an empty area bellow the "Enter" key and right of the "9" key. To ignore the touch event on the area, "9" is intentionally not marked as a right edge key. --> </Row> @@ -144,21 +127,16 @@ <Spacer latin:horizontalGap="20.427%p" /> <Key - latin:codes="@integer/key_space" - latin:keyIcon="@drawable/sym_keyboard_space" - latin:iconPreview="@drawable/sym_keyboard_feedback_space" + latin:keyStyle="nonSpecialBackgroundSpaceKeyStyle" latin:keyWidth="16.085%p" /> <Spacer latin:horizontalGap="8.479%p" /> <Key - latin:codes="42" - latin:keyIcon="@drawable/sym_keyboard_numstar" /> + latin:keyStyle="numStarKeyStyle" /> <Key - latin:codes="48" - latin:keyIcon="@drawable/sym_keyboard_num0" /> + latin:keyStyle="num0KeyStyle" /> <Key - latin:codes="35" - latin:keyIcon="@drawable/sym_keyboard_numpound" /> + latin:keyStyle="numPoundKeyStyle" /> <!-- There is an empty area bellow the "Enter" key and right of the "#" key. To ignore the touch event on the area, "#" is intentionally not marked as a right edge key. --> </Row> diff --git a/java/res/xml-xlarge/kbd_phone_symbols.xml b/java/res/xml-xlarge/kbd_phone_symbols.xml index 9ba60ed85..09eb403c8 100644 --- a/java/res/xml-xlarge/kbd_phone_symbols.xml +++ b/java/res/xml-xlarge/kbd_phone_symbols.xml @@ -25,13 +25,15 @@ latin:verticalGap="@dimen/key_bottom_gap" latin:keyHeight="@dimen/key_height" > + <include + latin:keyboardLayout="@xml/kbd_key_styles" /> + <include + latin:keyboardLayout="@xml/kbd_numkey_styles" /> <!-- This row is intentionally not marked as a top row --> <Row> <Key - latin:codes="@integer/key_tab" - latin:keyLabel="@string/label_tab_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" - latin:isModifier="true" + latin:keyStyle="tabKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyEdgeFlags="left" /> <Spacer latin:horizontalGap="4.458%p" /> @@ -52,32 +54,22 @@ <Spacer latin:horizontalGap="4.458%p" /> <Key - latin:codes="49" - latin:keyIcon="@drawable/sym_keyboard_num1" /> + latin:keyStyle="num1KeyStyle" /> <Key - latin:codes="50" - latin:keyIcon="@drawable/sym_keyboard_num2" /> + latin:keyStyle="num2KeyStyle" /> <Key - latin:codes="51" - latin:keyIcon="@drawable/sym_keyboard_num3" /> + latin:keyStyle="num3KeyStyle" /> <Spacer - latin:horizontalGap="4.458%p" /> + latin:horizontalGap="9.360%p" /> <Key - latin:codes="@integer/key_delete" - latin:keyLabel="@string/label_backspace_key" - latin:keyLabelOption="fontNormal|alignRight|alignBottom" - latin:keyWidth="14.706%p" - latin:isModifier="true" - latin:isRepeatable="true" + latin:keyStyle="deleteKeyStyle" + latin:keyWidth="9.804%p" latin:keyEdgeFlags="right" /> </Row> <Row> <Key - latin:codes="@integer/key_shift" - latin:keyLabel="@string/label_more_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" - latin:isModifier="true" - latin:isSticky="true" + latin:keyStyle="moreKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyEdgeFlags="left" /> <Spacer latin:horizontalGap="4.458%p" /> @@ -98,22 +90,16 @@ <Spacer latin:horizontalGap="4.458%p" /> <Key - latin:codes="52" - latin:keyIcon="@drawable/sym_keyboard_num4" /> + latin:keyStyle="num4KeyStyle" /> <Key - latin:codes="53" - latin:keyIcon="@drawable/sym_keyboard_num5" /> + latin:keyStyle="num5KeyStyle" /> <Key - latin:codes="54" - latin:keyIcon="@drawable/sym_keyboard_num6" /> + latin:keyStyle="num6KeyStyle" /> <Spacer latin:horizontalGap="4.458%p" /> <Key - latin:codes="@integer/key_return" - latin:keyLabel="@string/label_return_key" - latin:keyLabelOption="fontNormal|alignRight|alignBottom" + latin:keyStyle="returnKeyStyle" latin:keyWidth="14.706%p" - latin:isModifier="true" latin:keyEdgeFlags="right" /> </Row> <Row> @@ -138,14 +124,11 @@ <Spacer latin:horizontalGap="4.458%p" /> <Key - latin:codes="55" - latin:keyIcon="@drawable/sym_keyboard_num7" /> + latin:keyStyle="num7KeyStyle" /> <Key - latin:codes="56" - latin:keyIcon="@drawable/sym_keyboard_num8" /> + latin:keyStyle="num8KeyStyle" /> <Key - latin:codes="57" - latin:keyIcon="@drawable/sym_keyboard_num9" /> + latin:keyStyle="num9KeyStyle" /> <!-- There is an empty area bellow the "Enter" key and right of the "9" key. To ignore the touch event on the area, "9" is intentionally not marked as a right edge key. --> </Row> @@ -156,21 +139,16 @@ <Spacer latin:horizontalGap="16.406%p" /> <Key - latin:codes="@integer/key_space" - latin:keyIcon="@drawable/sym_keyboard_space" - latin:iconPreview="@drawable/sym_keyboard_feedback_space" + latin:keyStyle="nonSpecialBackgroundSpaceKeyStyle" latin:keyWidth="24.127%p" /> <Spacer latin:horizontalGap="4.458%p" /> <Key - latin:codes="42" - latin:keyIcon="@drawable/sym_keyboard_numstar" /> + latin:keyStyle="numStarKeyStyle" /> <Key - latin:codes="48" - latin:keyIcon="@drawable/sym_keyboard_num0" /> + latin:keyStyle="num0KeyStyle" /> <Key - latin:codes="35" - latin:keyIcon="@drawable/sym_keyboard_numpound" /> + latin:keyStyle="numPoundKeyStyle" /> <!-- There is an empty area bellow the "Enter" key and right of the "#" key. To ignore the touch event on the area, "#" is intentionally not marked as a right edge key. --> </Row> diff --git a/java/res/xml-xlarge/kbd_qwerty.xml b/java/res/xml-xlarge/kbd_qwerty.xml index b45060497..6f6877b0b 100644 --- a/java/res/xml-xlarge/kbd_qwerty.xml +++ b/java/res/xml-xlarge/kbd_qwerty.xml @@ -24,8 +24,14 @@ latin:verticalGap="@dimen/key_bottom_gap" latin:keyHeight="@dimen/key_height" > - <include latin:keyboardLayout="@xml/kbd_qwerty_row1" /> - <include latin:keyboardLayout="@xml/kbd_qwerty_row2" /> - <include latin:keyboardLayout="@xml/kbd_qwerty_row3" /> - <include latin:keyboardLayout="@xml/kbd_qwerty_row4" /> + <include + latin:keyboardLayout="@xml/kbd_key_styles" /> + <include + latin:keyboardLayout="@xml/kbd_qwerty_row1" /> + <include + latin:keyboardLayout="@xml/kbd_qwerty_row2" /> + <include + latin:keyboardLayout="@xml/kbd_qwerty_row3" /> + <include + latin:keyboardLayout="@xml/kbd_qwerty_row4" /> </Keyboard> diff --git a/java/res/xml-xlarge/kbd_qwerty_row1.xml b/java/res/xml-xlarge/kbd_qwerty_row1.xml index eca24b6e1..159686792 100644 --- a/java/res/xml-xlarge/kbd_qwerty_row1.xml +++ b/java/res/xml-xlarge/kbd_qwerty_row1.xml @@ -26,11 +26,9 @@ latin:keyWidth="8.272%p" > <Key - latin:codes="@integer/key_tab" - latin:keyLabel="@string/label_tab_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" + latin:keyStyle="tabKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyWidth="7.949%p" - latin:isModifier="true" latin:keyEdgeFlags="left" /> <Key latin:keyLabel="q" @@ -73,12 +71,8 @@ latin:popupKeyboard="@xml/kbd_popup_template" latin:popupCharacters="@string/alternates_for_p" /> <Key - latin:codes="@integer/key_delete" - latin:keyIcon="@drawable/sym_keyboard_delete" - latin:iconPreview="@drawable/sym_keyboard_feedback_delete" + latin:keyStyle="deleteKeyStyle" latin:keyWidth="9.331%p" - latin:isModifier="true" - latin:isRepeatable="true" latin:keyEdgeFlags="right" /> </Row> </merge> diff --git a/java/res/xml-xlarge/kbd_qwerty_row2.xml b/java/res/xml-xlarge/kbd_qwerty_row2.xml index 8dfb48885..2b9be10ab 100644 --- a/java/res/xml-xlarge/kbd_qwerty_row2.xml +++ b/java/res/xml-xlarge/kbd_qwerty_row2.xml @@ -25,11 +25,9 @@ latin:keyWidth="8.157%p" > <Key - latin:codes="@integer/key_switch_alpha_symbol" - latin:keyLabel="@string/label_to_symbol_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" + latin:keyStyle="toSymbolKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyWidth="11.167%p" - latin:isModifier="true" latin:keyEdgeFlags="left" /> <Key latin:keyLabel="a" @@ -60,11 +58,8 @@ latin:popupKeyboard="@xml/kbd_popup_template" latin:popupCharacters="@string/alternates_for_l" /> <Key - latin:codes="@integer/key_return" - latin:keyLabel="@string/label_return_key" - latin:keyLabelOption="fontNormal|alignRight|alignBottom" + latin:keyStyle="returnKeyStyle" latin:keyWidth="15.750%p" - latin:isModifier="true" latin:keyEdgeFlags="right" /> </Row> </merge> diff --git a/java/res/xml-xlarge/kbd_qwerty_row3.xml b/java/res/xml-xlarge/kbd_qwerty_row3.xml index c26dcc410..209ef213d 100644 --- a/java/res/xml-xlarge/kbd_qwerty_row3.xml +++ b/java/res/xml-xlarge/kbd_qwerty_row3.xml @@ -25,12 +25,8 @@ latin:keyWidth="8.042%p" > <Key - latin:codes="@integer/key_shift" - latin:keyLabel="@string/label_shift_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" + latin:keyStyle="shiftKeyStyle" latin:keyWidth="15.192%p" - latin:isModifier="true" - latin:isSticky="true" latin:keyEdgeFlags="left" /> <Key latin:keyLabel="z" @@ -81,12 +77,8 @@ </default> </switch> <Key - latin:codes="@integer/key_shift" - latin:keyLabel="@string/label_shift_key" - latin:keyLabelOption="fontNormal|alignRight|alignBottom" - latin:keyWidth="12.430%p" - latin:isModifier="true" - latin:isSticky="true" + latin:keyStyle="shiftKeyStyle" + latin:keyWidth="12.530%p" latin:keyEdgeFlags="right" /> </Row> </merge> diff --git a/java/res/xml-xlarge/kbd_qwerty_row4.xml b/java/res/xml-xlarge/kbd_qwerty_row4.xml index 8b31ec6fa..7b9049a8e 100644 --- a/java/res/xml-xlarge/kbd_qwerty_row4.xml +++ b/java/res/xml-xlarge/kbd_qwerty_row4.xml @@ -32,10 +32,7 @@ latin:mode="email" > <Key - latin:keyLabel=".com" - latin:keyOutputText=".com" - latin:keyHintIcon="@drawable/hint_popup" - latin:popupKeyboard="@xml/popup_domains" /> + latin:keyStyle="comKeyStyle" /> <Key latin:keyLabel="\@" /> </case> @@ -44,18 +41,12 @@ latin:mode="url" > <Key - latin:keyLabel=".com" - latin:keyOutputText=".com" - latin:keyHintIcon="@drawable/hint_popup" - latin:popupKeyboard="@xml/popup_domains" + latin:keyStyle="comKeyStyle" latin:keyWidth="16.084%p" /> </case> <default> <Key - latin:keyLabel=":-)" - latin:keyOutputText=":-)" - latin:keyHintIcon="@drawable/hint_popup" - latin:popupKeyboard="@xml/popup_smileys" /> + latin:keyStyle="smileyKeyStyle" /> <Key latin:keyLabel="/" latin:manualTemporaryUpperCaseCode="64" @@ -66,11 +57,8 @@ </default> </switch> <Key - latin:codes="@integer/key_space" - latin:keyIcon="@drawable/sym_keyboard_space" - latin:iconPreview="@drawable/sym_keyboard_feedback_space" - latin:keyWidth="37.454%p" - latin:isModifier="true" /> + latin:keyStyle="spaceKeyStyle" + latin:keyWidth="37.454%p" /> <switch> <case latin:mode="email" diff --git a/java/res/xml-xlarge/kbd_symbols.xml b/java/res/xml-xlarge/kbd_symbols.xml index 317c32b81..7197115d6 100644 --- a/java/res/xml-xlarge/kbd_symbols.xml +++ b/java/res/xml-xlarge/kbd_symbols.xml @@ -24,16 +24,16 @@ latin:verticalGap="@dimen/key_bottom_gap" latin:keyHeight="@dimen/key_height" > + <include + latin:keyboardLayout="@xml/kbd_key_styles" /> <!-- This row is intentionally not marked as a top row --> <Row latin:keyWidth="8.272%p" > <Key - latin:codes="@integer/key_tab" - latin:keyLabel="@string/label_tab_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" + latin:keyStyle="tabKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyWidth="7.949%p" - latin:isModifier="true" latin:keyEdgeFlags="left" /> <Key latin:keyLabel="1" @@ -70,23 +70,17 @@ latin:popupKeyboard="@xml/kbd_popup_template" latin:popupCharacters="ⁿ∅" /> <Key - latin:codes="@integer/key_delete" - latin:keyIcon="@drawable/sym_keyboard_delete" - latin:iconPreview="@drawable/sym_keyboard_feedback_delete" + latin:keyStyle="deleteKeyStyle" latin:keyWidth="9.331%p" - latin:isModifier="true" - latin:isRepeatable="true" latin:keyEdgeFlags="right" /> </Row> <Row latin:keyWidth="8.157%p" > <Key - latin:codes="@integer/key_switch_alpha_symbol" - latin:keyLabel="@string/label_to_alpha_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" + latin:keyStyle="toAlphaKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyWidth="11.167%p" - latin:isModifier="true" latin:keyEdgeFlags="left" /> <Key latin:keyLabel="#" /> @@ -121,23 +115,17 @@ latin:popupKeyboard="@xml/kbd_popup_template" latin:popupCharacters="]}>" /> <Key - latin:codes="@integer/key_return" - latin:keyLabel="@string/label_return_key" - latin:keyLabelOption="fontNormal|alignRight|alignBottom" + latin:keyStyle="returnKeyStyle" latin:keyWidth="15.750%p" - latin:isModifier="true" latin:keyEdgeFlags="right" /> </Row> <Row latin:keyWidth="8.042%p" > <Key - latin:codes="@integer/key_shift" - latin:keyLabel="@string/label_more_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" + latin:keyStyle="moreKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyWidth="15.192%p" - latin:isModifier="true" - latin:isSticky="true" latin:keyEdgeFlags="left" /> <Key latin:keyLabel="<" @@ -166,13 +154,9 @@ latin:popupKeyboard="@xml/kbd_popup_template" latin:popupCharacters="¿" /> <Key - latin:codes="@integer/key_shift" - latin:keyLabel="@string/label_more_key" - latin:keyLabelOption="fontNormal|alignRight|alignBottom" - latin:iconPreview="@drawable/sym_keyboard_feedback_shift" - latin:keyWidth="12.430%p" - latin:isModifier="true" - latin:isSticky="true" + latin:keyStyle="moreKeyStyle" + latin:keyLabelOption="alignRight" + latin:keyWidth="12.530%p" latin:keyEdgeFlags="right" /> </Row> <!-- This row is intentionally not marked as a bottom row --> @@ -186,11 +170,8 @@ <Key latin:keyLabel="\@" /> <Key - latin:codes="@integer/key_space" - latin:keyIcon="@drawable/sym_keyboard_space" - latin:iconPreview="@drawable/sym_keyboard_feedback_space" - latin:keyWidth="37.454%p" - latin:isModifier="true" /> + latin:keyStyle="spaceKeyStyle" + latin:keyWidth="37.454%p" /> <Key latin:keyLabel=""" latin:popupKeyboard="@xml/kbd_popup_template" diff --git a/java/res/xml-xlarge/kbd_symbols_shift.xml b/java/res/xml-xlarge/kbd_symbols_shift.xml index 603b36b4e..474296732 100644 --- a/java/res/xml-xlarge/kbd_symbols_shift.xml +++ b/java/res/xml-xlarge/kbd_symbols_shift.xml @@ -24,16 +24,16 @@ latin:verticalGap="@dimen/key_bottom_gap" latin:keyHeight="@dimen/key_height" > + <include + latin:keyboardLayout="@xml/kbd_key_styles" /> <!-- This row is intentionally not marked as a top row --> <Row latin:keyWidth="8.272%p" > <Key - latin:codes="@integer/key_tab" - latin:keyLabel="@string/label_tab_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" + latin:keyStyle="tabKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyWidth="7.949%p" - latin:isModifier="true" latin:keyEdgeFlags="left" /> <Key latin:keyLabel="~" /> @@ -60,23 +60,17 @@ <Key latin:keyLabel="}" /> <Key - latin:codes="@integer/key_delete" - latin:keyIcon="@drawable/sym_keyboard_delete" - latin:iconPreview="@drawable/sym_keyboard_feedback_delete" + latin:keyStyle="deleteKeyStyle" latin:keyWidth="9.331%p" - latin:isModifier="true" - latin:isRepeatable="true" latin:keyEdgeFlags="right" /> </Row> <Row latin:keyWidth="8.157%p" > <Key - latin:codes="@integer/key_switch_alpha_symbol" - latin:keyLabel="@string/label_to_alpha_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" + latin:keyStyle="toAlphaKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyWidth="11.167%p" - latin:isModifier="true" latin:keyEdgeFlags="left" /> <Key latin:keyLabel="£" /> @@ -101,23 +95,17 @@ <Key latin:keyLabel="]" /> <Key - latin:codes="@integer/key_return" - latin:keyLabel="@string/label_return_key" - latin:keyLabelOption="fontNormal|alignRight|alignBottom" + latin:keyStyle="returnKeyStyle" latin:keyWidth="15.750%p" - latin:isModifier="true" latin:keyEdgeFlags="right" /> </Row> <Row latin:keyWidth="8.042%p" > <Key - latin:codes="@integer/key_shift" - latin:keyLabel="@string/label_more_key" - latin:keyLabelOption="fontNormal|alignLeft|alignBottom" + latin:keyStyle="moreKeyStyle" + latin:keyLabelOption="alignLeft" latin:keyWidth="15.192%p" - latin:isModifier="true" - latin:isSticky="true" latin:keyEdgeFlags="left" /> <Key latin:keyLabel="©" /> @@ -142,12 +130,9 @@ <Key latin:keyLabel="¿" /> <Key - latin:codes="@integer/key_shift" - latin:keyLabel="@string/label_more_key" - latin:keyLabelOption="fontNormal|alignRight|alignBottom" - latin:keyWidth="12.430%p" - latin:isModifier="true" - latin:isSticky="true" + latin:keyStyle="moreKeyStyle" + latin:keyLabelOption="alignRight" + latin:keyWidth="12.530%p" latin:keyEdgeFlags="right" /> </Row> <!-- This row is intentionally not marked as a bottom row --> @@ -157,10 +142,7 @@ <Spacer latin:horizontalGap="32.488%p" /> <Key - latin:codes="@integer/key_space" - latin:keyIcon="@drawable/sym_keyboard_space" - latin:iconPreview="@drawable/sym_keyboard_feedback_space" - latin:keyWidth="37.454%p" - latin:isModifier="true" /> + latin:keyStyle="spaceKeyStyle" + latin:keyWidth="37.454%p" /> </Row> </Keyboard> diff --git a/java/res/xml/kbd_key_styles.xml b/java/res/xml/kbd_key_styles.xml index b80bb9ff4..9dd166a41 100644 --- a/java/res/xml/kbd_key_styles.xml +++ b/java/res/xml/kbd_key_styles.xml @@ -33,6 +33,7 @@ latin:styleName="shiftKeyStyle" latin:codes="@integer/key_shift" latin:keyIcon="@drawable/sym_keyboard_shift" + latin:shiftedIcon="@drawable/sym_keyboard_shift_locked" latin:iconPreview="@drawable/sym_keyboard_feedback_shift" latin:parentStyle="functionalKeyStyle" latin:isSticky="true" /> @@ -109,6 +110,7 @@ latin:styleName="shiftKeyStyle" latin:codes="@integer/key_shift" latin:keyIcon="@drawable/sym_bkeyboard_shift" + latin:shiftedIcon="@drawable/sym_bkeyboard_shift_locked" latin:iconPreview="@drawable/sym_keyboard_feedback_shift" latin:parentStyle="functionalKeyStyle" latin:isSticky="true" /> diff --git a/java/res/xml/kbd_numkey_styles.xml b/java/res/xml/kbd_numkey_styles.xml new file mode 100644 index 000000000..006476db2 --- /dev/null +++ b/java/res/xml/kbd_numkey_styles.xml @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2010, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<merge + xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" +> + <switch> + <case + latin:colorScheme="white" + > + <key-style + latin:styleName="num0KeyStyle" + latin:codes="48" + latin:keyIcon="@drawable/sym_keyboard_num0" /> + <key-style + latin:styleName="num1KeyStyle" + latin:codes="49" + latin:keyIcon="@drawable/sym_keyboard_num1" /> + <key-style + latin:styleName="num2KeyStyle" + latin:codes="50" + latin:keyIcon="@drawable/sym_keyboard_num2" /> + <key-style + latin:styleName="num3KeyStyle" + latin:codes="51" + latin:keyIcon="@drawable/sym_keyboard_num3" /> + <key-style + latin:styleName="num4KeyStyle" + latin:codes="52" + latin:keyIcon="@drawable/sym_keyboard_num4" /> + <key-style + latin:styleName="num5KeyStyle" + latin:codes="53" + latin:keyIcon="@drawable/sym_keyboard_num5" /> + <key-style + latin:styleName="num6KeyStyle" + latin:codes="54" + latin:keyIcon="@drawable/sym_keyboard_num6" /> + <key-style + latin:styleName="num7KeyStyle" + latin:codes="55" + latin:keyIcon="@drawable/sym_keyboard_num7" /> + <key-style + latin:styleName="num8KeyStyle" + latin:codes="56" + latin:keyIcon="@drawable/sym_keyboard_num8" /> + <key-style + latin:styleName="num9KeyStyle" + latin:codes="57" + latin:keyIcon="@drawable/sym_keyboard_num9" /> + <key-style + latin:styleName="numStarKeyStyle" + latin:codes="42" + latin:keyIcon="@drawable/sym_keyboard_numstar" /> + <key-style + latin:styleName="numPoundKeyStyle" + latin:codes="35" + latin:keyIcon="@drawable/sym_keyboard_numpound" /> + <key-style + latin:styleName="numAltKeyStyle" + latin:codes="@integer/key_switch_alpha_symbol" + latin:keyIcon="@drawable/sym_keyboard_numalt" + latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" /> + <key-style + latin:styleName="numSpaceKeyStyle" + latin:codes="@integer/key_space" + latin:keyIcon="@drawable/sym_keyboard_space" + latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> + </case> + <case + latin:colorScheme="black" + > + <key-style + latin:styleName="num0KeyStyle" + latin:codes="48" + latin:keyIcon="@drawable/sym_bkeyboard_num0" /> + <key-style + latin:styleName="num1KeyStyle" + latin:codes="49" + latin:keyIcon="@drawable/sym_bkeyboard_num1" /> + <key-style + latin:styleName="num2KeyStyle" + latin:codes="50" + latin:keyIcon="@drawable/sym_bkeyboard_num2" /> + <key-style + latin:styleName="num3KeyStyle" + latin:codes="51" + latin:keyIcon="@drawable/sym_bkeyboard_num3" /> + <key-style + latin:styleName="num4KeyStyle" + latin:codes="52" + latin:keyIcon="@drawable/sym_bkeyboard_num4" /> + <key-style + latin:styleName="num5KeyStyle" + latin:codes="53" + latin:keyIcon="@drawable/sym_bkeyboard_num5" /> + <key-style + latin:styleName="num6KeyStyle" + latin:codes="54" + latin:keyIcon="@drawable/sym_bkeyboard_num6" /> + <key-style + latin:styleName="num7KeyStyle" + latin:codes="55" + latin:keyIcon="@drawable/sym_bkeyboard_num7" /> + <key-style + latin:styleName="num8KeyStyle" + latin:codes="56" + latin:keyIcon="@drawable/sym_bkeyboard_num8" /> + <key-style + latin:styleName="num9KeyStyle" + latin:codes="57" + latin:keyIcon="@drawable/sym_bkeyboard_num9" /> + <key-style + latin:styleName="numStarKeyStyle" + latin:codes="42" + latin:keyIcon="@drawable/sym_bkeyboard_numstar" /> + <key-style + latin:styleName="numPoundKeyStyle" + latin:codes="35" + latin:keyIcon="@drawable/sym_bkeyboard_numpound" /> + <key-style + latin:styleName="numAltKeyStyle" + latin:codes="@integer/key_switch_alpha_symbol" + latin:keyIcon="@drawable/sym_bkeyboard_numalt" + latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" /> + <key-style + latin:styleName="numSpaceKeyStyle" + latin:codes="@integer/key_space" + latin:keyIcon="@drawable/sym_bkeyboard_space" + latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> + </case> + </switch> +</merge> diff --git a/java/res/xml/kbd_phone.xml b/java/res/xml/kbd_phone.xml index c9b1ad631..7e146ed69 100644 --- a/java/res/xml/kbd_phone.xml +++ b/java/res/xml/kbd_phone.xml @@ -27,116 +27,8 @@ > <include latin:keyboardLayout="@xml/kbd_key_styles" /> - <switch> - <case - latin:colorScheme="white" - > - <key-style - latin:styleName="num0KeyStyle" - latin:codes="48" - latin:keyIcon="@drawable/sym_keyboard_num0" /> - <key-style - latin:styleName="num1KeyStyle" - latin:codes="49" - latin:keyIcon="@drawable/sym_keyboard_num1" /> - <key-style - latin:styleName="num2KeyStyle" - latin:codes="50" - latin:keyIcon="@drawable/sym_keyboard_num2" /> - <key-style - latin:styleName="num3KeyStyle" - latin:codes="51" - latin:keyIcon="@drawable/sym_keyboard_num3" /> - <key-style - latin:styleName="num4KeyStyle" - latin:codes="52" - latin:keyIcon="@drawable/sym_keyboard_num4" /> - <key-style - latin:styleName="num5KeyStyle" - latin:codes="53" - latin:keyIcon="@drawable/sym_keyboard_num5" /> - <key-style - latin:styleName="num6KeyStyle" - latin:codes="54" - latin:keyIcon="@drawable/sym_keyboard_num6" /> - <key-style - latin:styleName="num7KeyStyle" - latin:codes="55" - latin:keyIcon="@drawable/sym_keyboard_num7" /> - <key-style - latin:styleName="num8KeyStyle" - latin:codes="56" - latin:keyIcon="@drawable/sym_keyboard_num8" /> - <key-style - latin:styleName="num9KeyStyle" - latin:codes="57" - latin:keyIcon="@drawable/sym_keyboard_num9" /> - <key-style - latin:styleName="numAltKeyStyle" - latin:codes="@integer/key_switch_alpha_symbol" - latin:keyIcon="@drawable/sym_keyboard_numalt" - latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" /> - <key-style - latin:styleName="numSpaceKeyStyle" - latin:codes="@integer/key_space" - latin:keyIcon="@drawable/sym_keyboard_space" - latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> - </case> - <case - latin:colorScheme="black" - > - <key-style - latin:styleName="num0KeyStyle" - latin:codes="48" - latin:keyIcon="@drawable/sym_bkeyboard_num0" /> - <key-style - latin:styleName="num1KeyStyle" - latin:codes="49" - latin:keyIcon="@drawable/sym_bkeyboard_num1" /> - <key-style - latin:styleName="num2KeyStyle" - latin:codes="50" - latin:keyIcon="@drawable/sym_bkeyboard_num2" /> - <key-style - latin:styleName="num3KeyStyle" - latin:codes="51" - latin:keyIcon="@drawable/sym_bkeyboard_num3" /> - <key-style - latin:styleName="num4KeyStyle" - latin:codes="52" - latin:keyIcon="@drawable/sym_bkeyboard_num4" /> - <key-style - latin:styleName="num5KeyStyle" - latin:codes="53" - latin:keyIcon="@drawable/sym_bkeyboard_num5" /> - <key-style - latin:styleName="num6KeyStyle" - latin:codes="54" - latin:keyIcon="@drawable/sym_bkeyboard_num6" /> - <key-style - latin:styleName="num7KeyStyle" - latin:codes="55" - latin:keyIcon="@drawable/sym_bkeyboard_num7" /> - <key-style - latin:styleName="num8KeyStyle" - latin:codes="56" - latin:keyIcon="@drawable/sym_bkeyboard_num8" /> - <key-style - latin:styleName="num9KeyStyle" - latin:codes="57" - latin:keyIcon="@drawable/sym_bkeyboard_num9" /> - <key-style - latin:styleName="numAltKeyStyle" - latin:codes="@integer/key_switch_alpha_symbol" - latin:keyIcon="@drawable/sym_bkeyboard_numalt" - latin:iconPreview="@drawable/sym_keyboard_feedback_numalt" /> - <key-style - latin:styleName="numSpaceKeyStyle" - latin:codes="@integer/key_space" - latin:keyIcon="@drawable/sym_bkeyboard_space" - latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> - </case> - </switch> + <include + latin:keyboardLayout="@xml/kbd_numkey_styles" /> <Row latin:rowEdgeFlags="top" > diff --git a/java/res/xml/kbd_phone_symbols.xml b/java/res/xml/kbd_phone_symbols.xml index 0d6d0e407..1bb4bac74 100644 --- a/java/res/xml/kbd_phone_symbols.xml +++ b/java/res/xml/kbd_phone_symbols.xml @@ -27,44 +27,8 @@ > <include latin:keyboardLayout="@xml/kbd_key_styles" /> - <switch> - <case - latin:colorScheme="white" - > - <key-style - latin:styleName="numStarKeyStyle" - latin:codes="42" - latin:keyIcon="@drawable/sym_keyboard_numstar" - latin:keyEdgeFlags="left" /> - <key-style - latin:styleName="numPoundKeyStyle" - latin:codes="35" - latin:keyIcon="@drawable/sym_keyboard_numpound" /> - <key-style - latin:styleName="numSpaceKeyStyle" - latin:codes="@integer/key_space" - latin:keyIcon="@drawable/sym_keyboard_space" - latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> - </case> - <case - latin:colorScheme="black" - > - <key-style - latin:styleName="numStarKeyStyle" - latin:codes="42" - latin:keyIcon="@drawable/sym_bkeyboard_numstar" - latin:keyEdgeFlags="left" /> - <key-style - latin:styleName="numPoundKeyStyle" - latin:codes="35" - latin:keyIcon="@drawable/sym_bkeyboard_numpound" /> - <key-style - latin:styleName="numSpaceKeyStyle" - latin:codes="@integer/key_space" - latin:keyIcon="@drawable/sym_bkeyboard_space" - latin:iconPreview="@drawable/sym_keyboard_feedback_space" /> - </case> - </switch> + <include + latin:keyboardLayout="@xml/kbd_numkey_styles" /> <Row latin:rowEdgeFlags="top" > diff --git a/java/src/com/android/inputmethod/latin/BaseKeyboard.java b/java/src/com/android/inputmethod/latin/BaseKeyboard.java index 485cc3153..00ed453c4 100644 --- a/java/src/com/android/inputmethod/latin/BaseKeyboard.java +++ b/java/src/com/android/inputmethod/latin/BaseKeyboard.java @@ -28,11 +28,14 @@ import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.graphics.drawable.Drawable; import android.text.TextUtils; +import android.util.Log; import android.util.Xml; import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * Loads an XML description of a keyboard and stores the attributes of the keys. A keyboard @@ -86,6 +89,9 @@ public class BaseKeyboard { /** List of shift keys in this keyboard */ private final List<Key> mShiftKeys = new ArrayList<Key>(); + /** List of shift keys and its shifted state icon */ + private final HashMap<Key, Drawable> mShiftedIcons = new HashMap<Key, Drawable>(); + /** Total height of the keyboard, including the padding and keys */ private int mTotalHeight; @@ -340,6 +346,10 @@ public class BaseKeyboard { manualTemporaryUpperCaseCode = style.getInt(a, R.styleable.BaseKeyboard_Key_manualTemporaryUpperCaseCode, 0); text = style.getText(a, R.styleable.BaseKeyboard_Key_keyOutputText); + final Drawable shiftedIcon = style.getDrawable(a, + R.styleable.BaseKeyboard_Key_shiftedIcon); + if (shiftedIcon != null) + keyboard.getShiftedIcons().put(this, shiftedIcon); if (codes == null && !TextUtils.isEmpty(label)) { codes = new int[] { label.charAt(0) }; @@ -622,6 +632,10 @@ public class BaseKeyboard { return mShiftKeys; } + public Map<Key, Drawable> getShiftedIcons() { + return mShiftedIcons; + } + private void computeNearestNeighbors() { // Round-up so we don't have any pixels outside the grid mCellWidth = (getMinWidth() + GRID_WIDTH - 1) / GRID_WIDTH; @@ -686,8 +700,10 @@ public class BaseKeyboard { mTotalWidth = parser.getMaxRowWidth(); mTotalHeight = parser.getTotalHeight(); } catch (XmlPullParserException e) { + Log.w(TAG, "keyboard XML parse error: " + e); throw new IllegalArgumentException(e); } catch (IOException e) { + Log.w(TAG, "keyboard XML parse error: " + e); throw new RuntimeException(e); } } diff --git a/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java b/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java index 621e875bf..38b2a1b57 100644 --- a/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java +++ b/java/src/com/android/inputmethod/latin/BaseKeyboardParser.java @@ -174,6 +174,7 @@ public class BaseKeyboardParser { keyboard.setVerticalGap(getDimensionOrFraction(a, R.styleable.BaseKeyboard_verticalGap, height, 0)); a.recycle(); + if (DEBUG_TAG) Log.d(TAG, "id=" + keyboard.mId); } private void parseKeyboardContent(XmlResourceParser parser, List<Key> keys) @@ -310,6 +311,7 @@ public class BaseKeyboardParser { checkEndTag(TAG_INCLUDE, parser); if (keyboardLayout == 0) throw new ParseException("No keyboardLayout attribute in <include/>", parser); + if (DEBUG_TAG) Log.d(TAG, String.format(" keyboardLayout=0x%08x", keyboardLayout)); parseMerge(mResources.getLayout(keyboardLayout), row, keys); } } @@ -560,10 +562,10 @@ public class BaseKeyboardParser { } private static String debugInteger(TypedArray a, int index, String name) { - return a.hasValue(index) ? name + "=" + a.getInt(index, 0) : ""; + return a.hasValue(index) ? " " + name + "=" + a.getInt(index, 0) : ""; } private static String debugBoolean(TypedArray a, int index, String name) { - return a.hasValue(index) ? name + "=" + a.getBoolean(index, false) : ""; + return a.hasValue(index) ? " " + name + "=" + a.getBoolean(index, false) : ""; } } diff --git a/java/src/com/android/inputmethod/latin/BaseKeyboardView.java b/java/src/com/android/inputmethod/latin/BaseKeyboardView.java index 129ff81a1..954f264bd 100644 --- a/java/src/com/android/inputmethod/latin/BaseKeyboardView.java +++ b/java/src/com/android/inputmethod/latin/BaseKeyboardView.java @@ -71,6 +71,7 @@ import java.util.WeakHashMap; public class BaseKeyboardView extends View implements PointerTracker.UIProxy { private static final String TAG = "BaseKeyboardView"; private static final boolean DEBUG = false; + private static final boolean DEBUG_SHOW_ALIGN = false; private static final boolean DEBUG_KEYBOARD_GRID = false; public static final int COLOR_SCHEME_WHITE = 0; @@ -252,17 +253,15 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { 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>(); - // This map caches key label text width in pixel as value and key label text size as map key. - private final HashMap<Integer, Integer> mTextWidthCache = new HashMap<Integer, Integer>(); // Distance from horizontal center of the key, proportional to key label text height and width. private final float KEY_LABEL_VERTICAL_ADJUSTMENT_FACTOR_CENTER = 0.55f; private final float KEY_LABEL_VERTICAL_PADDING_FACTOR = 1.60f; - private final float KEY_LABEL_HORIZONTAL_PADDING_FACTOR = 0.80f; private final String KEY_LABEL_REFERENCE_CHAR = "H"; private final int KEY_LABEL_OPTION_ALIGN_LEFT = 1; private final int KEY_LABEL_OPTION_ALIGN_RIGHT = 2; private final int KEY_LABEL_OPTION_ALIGN_BOTTOM = 8; private final int KEY_LABEL_OPTION_FONT_NORMAL = 16; + private final int mKeyLabelHorizontalPadding; private final UIHandler mHandler = new UIHandler(); @@ -514,6 +513,8 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { mPreviewPopup.setAnimationStyle(R.style.KeyPreviewAnimation); mDelayBeforePreview = res.getInteger(R.integer.config_delay_before_preview); mDelayAfterPreview = res.getInteger(R.integer.config_delay_after_preview); + mKeyLabelHorizontalPadding = (int)res.getDimension( + R.dimen.key_label_horizontal_alignment_padding); mMiniKeyboardParent = this; mMiniKeyboardPopup = new PopupWindow(context); @@ -818,44 +819,22 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { canvas.translate(key.x + kbdPaddingLeft, key.y + kbdPaddingTop); keyBackground.draw(canvas); + final int rowHeight = padding.top + key.height; boolean drawHintIcon = true; // Draw key label if (label != null) { // For characters, use large font. For labels like "Done", use small font. - final int labelSize; - if (label.length() > 1 && key.codes.length < 2) { - labelSize = mLabelTextSize; - if ((key.labelOption & KEY_LABEL_OPTION_FONT_NORMAL) != 0) { - paint.setTypeface(Typeface.DEFAULT); - } else { - paint.setTypeface(Typeface.DEFAULT_BOLD); - } - } else { - labelSize = mKeyTextSize; - paint.setTypeface(mKeyTextStyle); - } - paint.setTextSize(labelSize); - - Integer labelHeightValue = mTextHeightCache.get(labelSize); - final int labelCharHeight; - final int labelCharWidth; - if (labelHeightValue != null) { - labelCharHeight = labelHeightValue; - labelCharWidth = mTextWidthCache.get(labelSize); - } else { - Rect textBounds = new Rect(); - paint.getTextBounds(KEY_LABEL_REFERENCE_CHAR, 0, 1, textBounds); - labelCharHeight = textBounds.height(); - labelCharWidth = textBounds.width(); - mTextHeightCache.put(labelSize, labelCharHeight); - mTextWidthCache.put(labelSize, labelCharWidth); - } + final int labelSize = getLabelSizeAndSetPaint(label, key, paint); + final int labelCharHeight = getLabelCharHeight(labelSize, paint); // Vertical label text alignment. final float baseline; if ((key.labelOption & KEY_LABEL_OPTION_ALIGN_BOTTOM) != 0) { baseline = key.height - + labelCharHeight * KEY_LABEL_VERTICAL_PADDING_FACTOR; + if (DEBUG_SHOW_ALIGN) + drawHorizontalLine(canvas, (int)baseline, key.width, 0xc0008000, + new Paint()); } else { // Align center final float centerY = (key.height + padding.top - padding.bottom) / 2; baseline = centerY @@ -864,16 +843,20 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { // Horizontal label text alignment final int positionX; if ((key.labelOption & KEY_LABEL_OPTION_ALIGN_LEFT) != 0) { - positionX = (int)( - labelCharWidth * KEY_LABEL_HORIZONTAL_PADDING_FACTOR + padding.left); + positionX = mKeyLabelHorizontalPadding + padding.left; paint.setTextAlign(Align.LEFT); + if (DEBUG_SHOW_ALIGN) + drawVerticalLine(canvas, positionX, rowHeight, 0xc0800080, new Paint()); } else if ((key.labelOption & KEY_LABEL_OPTION_ALIGN_RIGHT) != 0) { - positionX = (int)(key.width - - labelCharWidth * KEY_LABEL_HORIZONTAL_PADDING_FACTOR - padding.right); + positionX = key.width - mKeyLabelHorizontalPadding - padding.right; paint.setTextAlign(Align.RIGHT); + if (DEBUG_SHOW_ALIGN) + drawVerticalLine(canvas, positionX, rowHeight, 0xc0808000, new Paint()); } else { positionX = (key.width + padding.left - padding.right) / 2; paint.setTextAlign(Align.CENTER); + if (DEBUG_SHOW_ALIGN && label.length() > 1) + drawVerticalLine(canvas, positionX, rowHeight, 0xc0008080, new Paint()); } // Set a drop shadow for the text paint.setShadowLayer(mShadowRadius, 0, 0, mShadowColor); @@ -883,21 +866,44 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { } // Draw key icon if (key.label == null && key.icon != null) { - int drawableWidth = key.icon.getIntrinsicWidth(); - int drawableHeight = key.icon.getIntrinsicHeight(); - int drawableX = (key.width + padding.left - padding.right - drawableWidth) / 2; - int drawableY = (key.height + padding.top - padding.bottom - drawableHeight) / 2; + final int drawableWidth = key.icon.getIntrinsicWidth(); + final int drawableHeight = key.icon.getIntrinsicHeight(); + final int drawableX; + final int drawableY = ( + key.height + padding.top - padding.bottom - drawableHeight) / 2; + if ((key.labelOption & KEY_LABEL_OPTION_ALIGN_LEFT) != 0) { + drawableX = padding.left + mKeyLabelHorizontalPadding; + if (DEBUG_SHOW_ALIGN) + drawVerticalLine(canvas, drawableX, rowHeight, 0xc0800080, new Paint()); + } else if ((key.labelOption & KEY_LABEL_OPTION_ALIGN_RIGHT) != 0) { + drawableX = key.width - padding.right - mKeyLabelHorizontalPadding + - drawableWidth; + if (DEBUG_SHOW_ALIGN) + drawVerticalLine(canvas, drawableX + drawableWidth, rowHeight, + 0xc0808000, new Paint()); + } else { // Align center + drawableX = (key.width + padding.left - padding.right - drawableWidth) / 2; + if (DEBUG_SHOW_ALIGN) + drawVerticalLine(canvas, drawableX + drawableWidth / 2, rowHeight, + 0xc0008080, new Paint()); + } drawIcon(canvas, key.icon, drawableX, drawableY, drawableWidth, drawableHeight); + if (DEBUG_SHOW_ALIGN) + drawRectangle(canvas, drawableX, drawableY, drawableWidth, drawableHeight, + 0x80c00000, new Paint()); } if (key.hintIcon != null && drawHintIcon) { - int drawableWidth = key.width; - int drawableHeight = key.height; - int drawableX = 0; - int drawableY = HINT_ICON_VERTICAL_ADJUSTMENT_PIXEL; + final int drawableWidth = key.width; + final int drawableHeight = key.height; + final int drawableX = 0; + final int drawableY = HINT_ICON_VERTICAL_ADJUSTMENT_PIXEL; Drawable icon = (isManualTemporaryUpperCase && key.manualTemporaryUpperCaseHintIcon != null) ? key.manualTemporaryUpperCaseHintIcon : key.hintIcon; drawIcon(canvas, icon, drawableX, drawableY, drawableWidth, drawableHeight); + if (DEBUG_SHOW_ALIGN) + drawRectangle(canvas, drawableX, drawableY, drawableWidth, drawableHeight, + 0x80c0c000, new Paint()); } canvas.translate(-key.x - kbdPaddingLeft, -key.y - kbdPaddingTop); } @@ -945,13 +951,70 @@ public class BaseKeyboardView extends View implements PointerTracker.UIProxy { mDirtyRect.setEmpty(); } - private void drawIcon(Canvas canvas, Drawable icon, int x, int y, int width, int height) { + private int getLabelSizeAndSetPaint(CharSequence label, Key key, Paint paint) { + // For characters, use large font. For labels like "Done", use small font. + final int labelSize; + if (label.length() > 1 && key.codes.length < 2) { + labelSize = mLabelTextSize; + if ((key.labelOption & KEY_LABEL_OPTION_FONT_NORMAL) != 0) { + paint.setTypeface(Typeface.DEFAULT); + } else { + paint.setTypeface(Typeface.DEFAULT_BOLD); + } + } else { + labelSize = mKeyTextSize; + paint.setTypeface(mKeyTextStyle); + } + paint.setTextSize(labelSize); + return labelSize; + } + + private int getLabelCharHeight(int labelSize, Paint paint) { + Integer labelHeightValue = mTextHeightCache.get(labelSize); + final int labelCharHeight; + if (labelHeightValue != null) { + labelCharHeight = labelHeightValue; + } else { + Rect textBounds = new Rect(); + paint.getTextBounds(KEY_LABEL_REFERENCE_CHAR, 0, 1, textBounds); + labelCharHeight = textBounds.height(); + mTextHeightCache.put(labelSize, labelCharHeight); + } + return labelCharHeight; + } + + private static void drawIcon(Canvas canvas, Drawable icon, int x, int y, int width, + int height) { canvas.translate(x, y); icon.setBounds(0, 0, width, height); icon.draw(canvas); canvas.translate(-x, -y); } + private static void drawHorizontalLine(Canvas canvas, int y, int w, int color, Paint paint) { + paint.setStyle(Paint.Style.STROKE); + paint.setStrokeWidth(1.0f); + paint.setColor(color); + canvas.drawLine(0, y, w, y, paint); + } + + private static void drawVerticalLine(Canvas canvas, int x, int h, int color, Paint paint) { + paint.setStyle(Paint.Style.STROKE); + paint.setStrokeWidth(1.0f); + paint.setColor(color); + canvas.drawLine(x, 0, x, h, paint); + } + + private static void drawRectangle(Canvas canvas, int x, int y, int w, int h, int color, + Paint paint) { + paint.setStyle(Paint.Style.STROKE); + paint.setStrokeWidth(1.0f); + paint.setColor(color); + canvas.translate(x, y); + canvas.drawRect(0, 0, w, h, paint); + canvas.translate(-x, -y); + } + public void setForeground(boolean foreground) { mInForeground = foreground; } diff --git a/java/src/com/android/inputmethod/latin/KeyStyles.java b/java/src/com/android/inputmethod/latin/KeyStyles.java index e53e351a3..fceede7c3 100644 --- a/java/src/com/android/inputmethod/latin/KeyStyles.java +++ b/java/src/com/android/inputmethod/latin/KeyStyles.java @@ -104,7 +104,7 @@ public class KeyStyles { try { values[count++] = Integer.parseInt(st.nextToken()); } catch (NumberFormatException nfe) { - Log.e(TAG, "Error parsing integer CSV " + value); + Log.w(TAG, "Error parsing integer CSV " + value); } } return values; @@ -163,6 +163,7 @@ public class KeyStyles { readDrawable(a, R.styleable.BaseKeyboard_Key_keyIcon); readDrawable(a, R.styleable.BaseKeyboard_Key_iconPreview); readDrawable(a, R.styleable.BaseKeyboard_Key_keyHintIcon); + readDrawable(a, R.styleable.BaseKeyboard_Key_shiftedIcon); readResourceId(a, R.styleable.BaseKeyboard_Key_popupKeyboard); readBoolean(a, R.styleable.BaseKeyboard_Key_isModifier); readBoolean(a, R.styleable.BaseKeyboard_Key_isSticky); diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java index 58958b610..b08b97a81 100644 --- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java @@ -691,9 +691,11 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha ).inflate(THEMES[newLayout], null); tryGC = false; } catch (OutOfMemoryError e) { + Log.w(TAG, "load keyboard failed: " + e); tryGC = LatinIMEUtil.GCUtils.getInstance().tryGCOrWait( mLayoutId + "," + newLayout, e); } catch (InflateException e) { + Log.w(TAG, "load keyboard failed: " + e); tryGC = LatinIMEUtil.GCUtils.getInstance().tryGCOrWait( mLayoutId + "," + newLayout, e); } diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java index c6e911680..cae0b10b3 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java @@ -37,6 +37,7 @@ import android.view.ViewConfiguration; import java.util.HashMap; import java.util.List; import java.util.Locale; +import java.util.Map; public class LatinKeyboard extends BaseKeyboard { @@ -45,7 +46,6 @@ public class LatinKeyboard extends BaseKeyboard { private static final int OPACITY_FULLY_OPAQUE = 255; private static final int SPACE_LED_LENGTH_PERCENT = 80; - private final Drawable mShiftedIcon; private Drawable mShiftLockPreviewIcon; private final HashMap<Key, Drawable> mNormalShiftIcons = new HashMap<Key, Drawable>(); private Drawable mSpaceIcon; @@ -89,11 +89,9 @@ public class LatinKeyboard extends BaseKeyboard { mContext = context; mRes = res; if (id.mColorScheme == BaseKeyboardView.COLOR_SCHEME_BLACK) { - mShiftedIcon = res.getDrawable(R.drawable.sym_bkeyboard_shift_locked); mSpaceBarTextShadowColor = res.getColor( R.color.latinkeyboard_bar_language_shadow_black); } else { // default color scheme is BaseKeyboardView.COLOR_SCHEME_WHITE - mShiftedIcon = res.getDrawable(R.drawable.sym_keyboard_shift_locked); mSpaceBarTextShadowColor = res.getColor( R.color.latinkeyboard_bar_language_shadow_white); } @@ -132,9 +130,10 @@ public class LatinKeyboard extends BaseKeyboard { } public boolean setShiftLocked(boolean newShiftLockState) { + final Map<Key, Drawable> shiftedIcons = getShiftedIcons(); for (final Key key : getShiftKeys()) { key.on = newShiftLockState; - key.icon = newShiftLockState ? mShiftedIcon : mNormalShiftIcons.get(key); + key.icon = newShiftLockState ? shiftedIcons.get(key) : mNormalShiftIcons.get(key); } mShiftState.setShiftLocked(newShiftLockState); return true; @@ -149,11 +148,12 @@ public class LatinKeyboard extends BaseKeyboard { if (getShiftKeys().size() == 0) return super.setShifted(newShiftState); + final Map<Key, Drawable> shiftedIcons = getShiftedIcons(); for (final Key key : getShiftKeys()) { if (!newShiftState && !mShiftState.isShiftLocked()) { key.icon = mNormalShiftIcons.get(key); } else if (newShiftState && !mShiftState.isShiftedOrShiftLocked()) { - key.icon = mShiftedIcon; + key.icon = shiftedIcons.get(key); } } return mShiftState.setShifted(newShiftState); |