aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/res/color/emoji_tab_label_color_holo.xml33
-rw-r--r--java/res/drawable-hdpi/emoji_category_tab_selected_holo_dark.9.pngbin145 -> 0 bytes
-rw-r--r--java/res/drawable-hdpi/emoji_category_tab_selected_ics.9.pngbin0 -> 137 bytes
-rw-r--r--java/res/drawable-hdpi/emoji_category_tab_selected_klp.9.pngbin0 -> 134 bytes
-rw-r--r--java/res/drawable-hdpi/emoji_category_tab_selected_lxx_dark.9.pngbin0 -> 137 bytes
-rw-r--r--java/res/drawable-hdpi/emoji_category_tab_unselected_lxx_dark.9.pngbin0 -> 142 bytes
-rw-r--r--java/res/drawable-hdpi/ic_emoji_emoticons_activated_holo_dark.pngbin0 -> 1138 bytes
-rw-r--r--java/res/drawable-hdpi/ic_emoji_emoticons_normal_holo_dark.pngbin0 -> 990 bytes
-rw-r--r--java/res/drawable-hdpi/ic_emoji_recents_activated_holo_dark.png (renamed from java/res/drawable-hdpi/ic_emoji_recent_activated_holo_dark.png)bin1667 -> 1667 bytes
-rw-r--r--java/res/drawable-hdpi/ic_emoji_recents_normal_holo_dark.png (renamed from java/res/drawable-hdpi/ic_emoji_recent_normal_holo_dark.png)bin1703 -> 1703 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_key_feedback_background_lxx_dark.9.pngbin1651 -> 557 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_key_feedback_left_background_lxx_dark.9.pngbin1651 -> 0 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.pngbin1745 -> 0 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_key_feedback_more_background_lxx_dark.9.pngbin1738 -> 687 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_key_feedback_right_background_lxx_dark.9.pngbin1637 -> 0 bytes
-rw-r--r--java/res/drawable-hdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.pngbin1734 -> 0 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_shift_locked_lxx_dark.pngbin0 -> 631 bytes
-rw-r--r--java/res/drawable-hdpi/sym_keyboard_shift_lxx_dark.pngbin0 -> 637 bytes
-rw-r--r--java/res/drawable-mdpi/emoji_category_tab_selected_holo_dark.9.pngbin140 -> 0 bytes
-rw-r--r--java/res/drawable-mdpi/emoji_category_tab_selected_ics.9.pngbin0 -> 137 bytes
-rw-r--r--java/res/drawable-mdpi/emoji_category_tab_selected_klp.9.pngbin0 -> 132 bytes
-rw-r--r--java/res/drawable-mdpi/emoji_category_tab_selected_lxx_dark.9.pngbin0 -> 137 bytes
-rw-r--r--java/res/drawable-mdpi/emoji_category_tab_unselected_lxx_dark.9.pngbin0 -> 141 bytes
-rw-r--r--java/res/drawable-mdpi/ic_emoji_emoticons_activated_holo_dark.pngbin0 -> 873 bytes
-rw-r--r--java/res/drawable-mdpi/ic_emoji_emoticons_normal_holo_dark.pngbin0 -> 713 bytes
-rw-r--r--java/res/drawable-mdpi/ic_emoji_recents_activated_holo_dark.png (renamed from java/res/drawable-mdpi/ic_emoji_recent_activated_holo_dark.png)bin1105 -> 1105 bytes
-rw-r--r--java/res/drawable-mdpi/ic_emoji_recents_normal_holo_dark.png (renamed from java/res/drawable-mdpi/ic_emoji_recent_normal_holo_dark.png)bin1106 -> 1106 bytes
-rw-r--r--java/res/drawable-mdpi/keyboard_key_feedback_background_lxx_dark.9.pngbin1023 -> 361 bytes
-rw-r--r--java/res/drawable-mdpi/keyboard_key_feedback_left_background_lxx_dark.9.pngbin1000 -> 0 bytes
-rw-r--r--java/res/drawable-mdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.pngbin1085 -> 0 bytes
-rw-r--r--java/res/drawable-mdpi/keyboard_key_feedback_more_background_lxx_dark.9.pngbin1106 -> 398 bytes
-rw-r--r--java/res/drawable-mdpi/keyboard_key_feedback_right_background_lxx_dark.9.pngbin1023 -> 0 bytes
-rw-r--r--java/res/drawable-mdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.pngbin1111 -> 0 bytes
-rw-r--r--java/res/drawable-mdpi/sym_keyboard_shift_locked_lxx_dark.pngbin0 -> 517 bytes
-rw-r--r--java/res/drawable-mdpi/sym_keyboard_shift_lxx_dark.pngbin0 -> 558 bytes
-rw-r--r--java/res/drawable-xhdpi/emoji_category_tab_selected_holo_dark.9.pngbin148 -> 0 bytes
-rw-r--r--java/res/drawable-xhdpi/emoji_category_tab_selected_ics.9.pngbin0 -> 138 bytes
-rw-r--r--java/res/drawable-xhdpi/emoji_category_tab_selected_klp.9.pngbin0 -> 135 bytes
-rw-r--r--java/res/drawable-xhdpi/emoji_category_tab_selected_lxx_dark.pngbin0 -> 138 bytes
-rw-r--r--java/res/drawable-xhdpi/emoji_category_tab_unselected_lxx_dark.9.pngbin0 -> 143 bytes
-rw-r--r--java/res/drawable-xhdpi/ic_emoji_emoticons_activated_holo_dark.pngbin0 -> 1317 bytes
-rw-r--r--java/res/drawable-xhdpi/ic_emoji_emoticons_normal_holo_dark.pngbin0 -> 1213 bytes
-rw-r--r--java/res/drawable-xhdpi/ic_emoji_recents_activated_holo_dark.png (renamed from java/res/drawable-xhdpi/ic_emoji_recent_activated_holo_dark.png)bin2459 -> 2459 bytes
-rw-r--r--java/res/drawable-xhdpi/ic_emoji_recents_normal_holo_dark.png (renamed from java/res/drawable-xhdpi/ic_emoji_recent_normal_holo_dark.png)bin2346 -> 2346 bytes
-rw-r--r--java/res/drawable-xhdpi/keyboard_key_feedback_background_lxx_dark.9.pngbin2148 -> 765 bytes
-rw-r--r--java/res/drawable-xhdpi/keyboard_key_feedback_left_background_lxx_dark.9.pngbin2120 -> 0 bytes
-rw-r--r--java/res/drawable-xhdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.pngbin2194 -> 0 bytes
-rw-r--r--java/res/drawable-xhdpi/keyboard_key_feedback_more_background_lxx_dark.9.pngbin2219 -> 835 bytes
-rw-r--r--java/res/drawable-xhdpi/keyboard_key_feedback_right_background_lxx_dark.9.pngbin2102 -> 0 bytes
-rw-r--r--java/res/drawable-xhdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.pngbin2182 -> 0 bytes
-rw-r--r--java/res/drawable-xhdpi/sym_keyboard_shift_locked_lxx_dark.pngbin0 -> 720 bytes
-rw-r--r--java/res/drawable-xhdpi/sym_keyboard_shift_lxx_dark.pngbin0 -> 827 bytes
-rw-r--r--java/res/drawable-xxhdpi/emoji_category_tab_selected_holo_dark.9.pngbin1030 -> 0 bytes
-rw-r--r--java/res/drawable-xxhdpi/emoji_category_tab_selected_ics.9.pngbin0 -> 113 bytes
-rw-r--r--java/res/drawable-xxhdpi/emoji_category_tab_selected_klp.9.pngbin0 -> 110 bytes
-rw-r--r--java/res/drawable-xxhdpi/emoji_category_tab_selected_lxx_dark.9.pngbin0 -> 113 bytes
-rw-r--r--java/res/drawable-xxhdpi/emoji_category_tab_unselected_lxx_dark.9.pngbin0 -> 93 bytes
-rw-r--r--java/res/drawable-xxhdpi/ic_emoji_emoticons_activated_holo_dark.pngbin0 -> 1383 bytes
-rw-r--r--java/res/drawable-xxhdpi/ic_emoji_emoticons_normal_holo_dark.pngbin0 -> 1096 bytes
-rw-r--r--java/res/drawable-xxhdpi/ic_emoji_recents_activated_holo_dark.png (renamed from java/res/drawable-xxhdpi/ic_emoji_recent_activated_holo_dark.png)bin3152 -> 3152 bytes
-rw-r--r--java/res/drawable-xxhdpi/ic_emoji_recents_normal_holo_dark.png (renamed from java/res/drawable-xxhdpi/ic_emoji_recent_normal_holo_dark.png)bin2943 -> 2943 bytes
-rw-r--r--java/res/drawable-xxhdpi/keyboard_key_feedback_background_lxx_dark.9.pngbin3744 -> 1187 bytes
-rw-r--r--java/res/drawable-xxhdpi/keyboard_key_feedback_left_background_lxx_dark.9.pngbin3757 -> 0 bytes
-rw-r--r--java/res/drawable-xxhdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.pngbin3842 -> 0 bytes
-rw-r--r--java/res/drawable-xxhdpi/keyboard_key_feedback_more_background_lxx_dark.9.pngbin3833 -> 1358 bytes
-rw-r--r--java/res/drawable-xxhdpi/keyboard_key_feedback_right_background_lxx_dark.9.pngbin3677 -> 0 bytes
-rw-r--r--java/res/drawable-xxhdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.pngbin3767 -> 0 bytes
-rw-r--r--java/res/drawable-xxhdpi/sym_keyboard_shift_locked_lxx_dark.pngbin0 -> 957 bytes
-rw-r--r--java/res/drawable-xxhdpi/sym_keyboard_shift_lxx_dark.pngbin0 -> 1069 bytes
-rw-r--r--java/res/drawable/ic_emoji_emoticons_holo_dark.xml (renamed from java/res/color/emoji_tab_label_color_lxx_dark.xml)9
-rw-r--r--java/res/drawable/ic_emoji_recents_holo_dark.xml (renamed from java/res/drawable/ic_emoji_recent_holo_dark.xml)8
-rw-r--r--java/res/drawable/keyboard_key_feedback_lxx_dark.xml8
-rw-r--r--java/res/layout/emoji_keyboard_tab_label.xml26
-rw-r--r--java/res/layout/emoji_palettes_view.xml9
-rw-r--r--java/res/values/attrs.xml16
-rw-r--r--java/res/values/colors.xml4
-rw-r--r--java/res/values/themes-common.xml2
-rw-r--r--java/res/values/themes-ics.xml19
-rw-r--r--java/res/values/themes-klp.xml19
-rw-r--r--java/res/values/themes-lxx-dark.xml20
-rw-r--r--java/res/xml/method.xml6
-rw-r--r--java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java42
-rw-r--r--java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java232
-rw-r--r--java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityNodeProvider.java (renamed from java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityNodeProvider.java)7
-rw-r--r--java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityDelegate.java234
-rw-r--r--java/src/com/android/inputmethod/keyboard/MainKeyboardView.java11
-rw-r--r--java/src/com/android/inputmethod/keyboard/emoji/EmojiCategory.java33
-rw-r--r--java/src/com/android/inputmethod/keyboard/emoji/EmojiCategoryPageIndicatorView.java27
-rw-r--r--java/src/com/android/inputmethod/keyboard/emoji/EmojiLayoutParams.java13
-rw-r--r--java/src/com/android/inputmethod/keyboard/emoji/EmojiPageKeyboardView.java13
-rw-r--r--java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesView.java41
-rw-r--r--java/src/com/android/inputmethod/latin/InputAttributes.java5
92 files changed, 441 insertions, 396 deletions
diff --git a/java/res/color/emoji_tab_label_color_holo.xml b/java/res/color/emoji_tab_label_color_holo.xml
deleted file mode 100644
index 373e9314b..000000000
--- a/java/res/color/emoji_tab_label_color_holo.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2013, 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_focused="true"
- android:color="@color/key_text_color_holo" />
- <item
- android:state_pressed="true"
- android:color="@color/key_text_color_holo" />
- <item
- android:state_selected="true"
- android:color="@color/key_text_color_holo" />
- <item
- android:color="@color/key_text_inactivated_color_holo" />
-</selector>
diff --git a/java/res/drawable-hdpi/emoji_category_tab_selected_holo_dark.9.png b/java/res/drawable-hdpi/emoji_category_tab_selected_holo_dark.9.png
deleted file mode 100644
index 84e63df17..000000000
--- a/java/res/drawable-hdpi/emoji_category_tab_selected_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-hdpi/emoji_category_tab_selected_ics.9.png b/java/res/drawable-hdpi/emoji_category_tab_selected_ics.9.png
new file mode 100644
index 000000000..9138cef9c
--- /dev/null
+++ b/java/res/drawable-hdpi/emoji_category_tab_selected_ics.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/emoji_category_tab_selected_klp.9.png b/java/res/drawable-hdpi/emoji_category_tab_selected_klp.9.png
new file mode 100644
index 000000000..345d05e9d
--- /dev/null
+++ b/java/res/drawable-hdpi/emoji_category_tab_selected_klp.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/emoji_category_tab_selected_lxx_dark.9.png b/java/res/drawable-hdpi/emoji_category_tab_selected_lxx_dark.9.png
new file mode 100644
index 000000000..ca981f4f4
--- /dev/null
+++ b/java/res/drawable-hdpi/emoji_category_tab_selected_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/emoji_category_tab_unselected_lxx_dark.9.png b/java/res/drawable-hdpi/emoji_category_tab_unselected_lxx_dark.9.png
new file mode 100644
index 000000000..10b1dd2cb
--- /dev/null
+++ b/java/res/drawable-hdpi/emoji_category_tab_unselected_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/ic_emoji_emoticons_activated_holo_dark.png b/java/res/drawable-hdpi/ic_emoji_emoticons_activated_holo_dark.png
new file mode 100644
index 000000000..1c937c9ef
--- /dev/null
+++ b/java/res/drawable-hdpi/ic_emoji_emoticons_activated_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-hdpi/ic_emoji_emoticons_normal_holo_dark.png b/java/res/drawable-hdpi/ic_emoji_emoticons_normal_holo_dark.png
new file mode 100644
index 000000000..3508d242a
--- /dev/null
+++ b/java/res/drawable-hdpi/ic_emoji_emoticons_normal_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-hdpi/ic_emoji_recent_activated_holo_dark.png b/java/res/drawable-hdpi/ic_emoji_recents_activated_holo_dark.png
index de570a185..de570a185 100644
--- a/java/res/drawable-hdpi/ic_emoji_recent_activated_holo_dark.png
+++ b/java/res/drawable-hdpi/ic_emoji_recents_activated_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-hdpi/ic_emoji_recent_normal_holo_dark.png b/java/res/drawable-hdpi/ic_emoji_recents_normal_holo_dark.png
index b2562088d..b2562088d 100644
--- a/java/res/drawable-hdpi/ic_emoji_recent_normal_holo_dark.png
+++ b/java/res/drawable-hdpi/ic_emoji_recents_normal_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_background_lxx_dark.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_background_lxx_dark.9.png
index 6a76ce66e..9d6514bdd 100644
--- a/java/res/drawable-hdpi/keyboard_key_feedback_background_lxx_dark.9.png
+++ b/java/res/drawable-hdpi/keyboard_key_feedback_background_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_left_background_lxx_dark.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_left_background_lxx_dark.9.png
deleted file mode 100644
index 752c7581f..000000000
--- a/java/res/drawable-hdpi/keyboard_key_feedback_left_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.png
deleted file mode 100644
index a24519fef..000000000
--- a/java/res/drawable-hdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_more_background_lxx_dark.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_more_background_lxx_dark.9.png
index f3c2f6ba0..8ad54f69d 100644
--- a/java/res/drawable-hdpi/keyboard_key_feedback_more_background_lxx_dark.9.png
+++ b/java/res/drawable-hdpi/keyboard_key_feedback_more_background_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_right_background_lxx_dark.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_right_background_lxx_dark.9.png
deleted file mode 100644
index 0a9e46734..000000000
--- a/java/res/drawable-hdpi/keyboard_key_feedback_right_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-hdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.png b/java/res/drawable-hdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.png
deleted file mode 100644
index 6a58ed302..000000000
--- a/java/res/drawable-hdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_shift_locked_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_shift_locked_lxx_dark.png
new file mode 100644
index 000000000..108eb7402
--- /dev/null
+++ b/java/res/drawable-hdpi/sym_keyboard_shift_locked_lxx_dark.png
Binary files differ
diff --git a/java/res/drawable-hdpi/sym_keyboard_shift_lxx_dark.png b/java/res/drawable-hdpi/sym_keyboard_shift_lxx_dark.png
new file mode 100644
index 000000000..141f5ad06
--- /dev/null
+++ b/java/res/drawable-hdpi/sym_keyboard_shift_lxx_dark.png
Binary files differ
diff --git a/java/res/drawable-mdpi/emoji_category_tab_selected_holo_dark.9.png b/java/res/drawable-mdpi/emoji_category_tab_selected_holo_dark.9.png
deleted file mode 100644
index 4b00f350a..000000000
--- a/java/res/drawable-mdpi/emoji_category_tab_selected_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-mdpi/emoji_category_tab_selected_ics.9.png b/java/res/drawable-mdpi/emoji_category_tab_selected_ics.9.png
new file mode 100644
index 000000000..1731b46ad
--- /dev/null
+++ b/java/res/drawable-mdpi/emoji_category_tab_selected_ics.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/emoji_category_tab_selected_klp.9.png b/java/res/drawable-mdpi/emoji_category_tab_selected_klp.9.png
new file mode 100644
index 000000000..6354b997a
--- /dev/null
+++ b/java/res/drawable-mdpi/emoji_category_tab_selected_klp.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/emoji_category_tab_selected_lxx_dark.9.png b/java/res/drawable-mdpi/emoji_category_tab_selected_lxx_dark.9.png
new file mode 100644
index 000000000..a08735cb4
--- /dev/null
+++ b/java/res/drawable-mdpi/emoji_category_tab_selected_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/emoji_category_tab_unselected_lxx_dark.9.png b/java/res/drawable-mdpi/emoji_category_tab_unselected_lxx_dark.9.png
new file mode 100644
index 000000000..4cf8f5c41
--- /dev/null
+++ b/java/res/drawable-mdpi/emoji_category_tab_unselected_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/ic_emoji_emoticons_activated_holo_dark.png b/java/res/drawable-mdpi/ic_emoji_emoticons_activated_holo_dark.png
new file mode 100644
index 000000000..c7394e1b0
--- /dev/null
+++ b/java/res/drawable-mdpi/ic_emoji_emoticons_activated_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-mdpi/ic_emoji_emoticons_normal_holo_dark.png b/java/res/drawable-mdpi/ic_emoji_emoticons_normal_holo_dark.png
new file mode 100644
index 000000000..eb4dab4c7
--- /dev/null
+++ b/java/res/drawable-mdpi/ic_emoji_emoticons_normal_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-mdpi/ic_emoji_recent_activated_holo_dark.png b/java/res/drawable-mdpi/ic_emoji_recents_activated_holo_dark.png
index 8009e932f..8009e932f 100644
--- a/java/res/drawable-mdpi/ic_emoji_recent_activated_holo_dark.png
+++ b/java/res/drawable-mdpi/ic_emoji_recents_activated_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-mdpi/ic_emoji_recent_normal_holo_dark.png b/java/res/drawable-mdpi/ic_emoji_recents_normal_holo_dark.png
index c2e598dfb..c2e598dfb 100644
--- a/java/res/drawable-mdpi/ic_emoji_recent_normal_holo_dark.png
+++ b/java/res/drawable-mdpi/ic_emoji_recents_normal_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_background_lxx_dark.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_background_lxx_dark.9.png
index 0173d096f..d3200921a 100644
--- a/java/res/drawable-mdpi/keyboard_key_feedback_background_lxx_dark.9.png
+++ b/java/res/drawable-mdpi/keyboard_key_feedback_background_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_left_background_lxx_dark.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_left_background_lxx_dark.9.png
deleted file mode 100644
index 6d8954961..000000000
--- a/java/res/drawable-mdpi/keyboard_key_feedback_left_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.png
deleted file mode 100644
index a459d42ac..000000000
--- a/java/res/drawable-mdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_more_background_lxx_dark.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_more_background_lxx_dark.9.png
index 5c00e7e52..60a36333e 100644
--- a/java/res/drawable-mdpi/keyboard_key_feedback_more_background_lxx_dark.9.png
+++ b/java/res/drawable-mdpi/keyboard_key_feedback_more_background_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_right_background_lxx_dark.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_right_background_lxx_dark.9.png
deleted file mode 100644
index f85dd03cc..000000000
--- a/java/res/drawable-mdpi/keyboard_key_feedback_right_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-mdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.png b/java/res/drawable-mdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.png
deleted file mode 100644
index 83d72a27b..000000000
--- a/java/res/drawable-mdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-mdpi/sym_keyboard_shift_locked_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_shift_locked_lxx_dark.png
new file mode 100644
index 000000000..9c8903128
--- /dev/null
+++ b/java/res/drawable-mdpi/sym_keyboard_shift_locked_lxx_dark.png
Binary files differ
diff --git a/java/res/drawable-mdpi/sym_keyboard_shift_lxx_dark.png b/java/res/drawable-mdpi/sym_keyboard_shift_lxx_dark.png
new file mode 100644
index 000000000..926c3635e
--- /dev/null
+++ b/java/res/drawable-mdpi/sym_keyboard_shift_lxx_dark.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/emoji_category_tab_selected_holo_dark.9.png b/java/res/drawable-xhdpi/emoji_category_tab_selected_holo_dark.9.png
deleted file mode 100644
index 95e5f4341..000000000
--- a/java/res/drawable-xhdpi/emoji_category_tab_selected_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-xhdpi/emoji_category_tab_selected_ics.9.png b/java/res/drawable-xhdpi/emoji_category_tab_selected_ics.9.png
new file mode 100644
index 000000000..11bc966b0
--- /dev/null
+++ b/java/res/drawable-xhdpi/emoji_category_tab_selected_ics.9.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/emoji_category_tab_selected_klp.9.png b/java/res/drawable-xhdpi/emoji_category_tab_selected_klp.9.png
new file mode 100644
index 000000000..5e8549bdd
--- /dev/null
+++ b/java/res/drawable-xhdpi/emoji_category_tab_selected_klp.9.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/emoji_category_tab_selected_lxx_dark.png b/java/res/drawable-xhdpi/emoji_category_tab_selected_lxx_dark.png
new file mode 100644
index 000000000..65a54b813
--- /dev/null
+++ b/java/res/drawable-xhdpi/emoji_category_tab_selected_lxx_dark.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/emoji_category_tab_unselected_lxx_dark.9.png b/java/res/drawable-xhdpi/emoji_category_tab_unselected_lxx_dark.9.png
new file mode 100644
index 000000000..666b35471
--- /dev/null
+++ b/java/res/drawable-xhdpi/emoji_category_tab_unselected_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/ic_emoji_emoticons_activated_holo_dark.png b/java/res/drawable-xhdpi/ic_emoji_emoticons_activated_holo_dark.png
new file mode 100644
index 000000000..997c9b700
--- /dev/null
+++ b/java/res/drawable-xhdpi/ic_emoji_emoticons_activated_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/ic_emoji_emoticons_normal_holo_dark.png b/java/res/drawable-xhdpi/ic_emoji_emoticons_normal_holo_dark.png
new file mode 100644
index 000000000..23a519c5d
--- /dev/null
+++ b/java/res/drawable-xhdpi/ic_emoji_emoticons_normal_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/ic_emoji_recent_activated_holo_dark.png b/java/res/drawable-xhdpi/ic_emoji_recents_activated_holo_dark.png
index 06003b82d..06003b82d 100644
--- a/java/res/drawable-xhdpi/ic_emoji_recent_activated_holo_dark.png
+++ b/java/res/drawable-xhdpi/ic_emoji_recents_activated_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/ic_emoji_recent_normal_holo_dark.png b/java/res/drawable-xhdpi/ic_emoji_recents_normal_holo_dark.png
index da2effedb..da2effedb 100644
--- a/java/res/drawable-xhdpi/ic_emoji_recent_normal_holo_dark.png
+++ b/java/res/drawable-xhdpi/ic_emoji_recents_normal_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/keyboard_key_feedback_background_lxx_dark.9.png b/java/res/drawable-xhdpi/keyboard_key_feedback_background_lxx_dark.9.png
index fed1da764..d40afebd8 100644
--- a/java/res/drawable-xhdpi/keyboard_key_feedback_background_lxx_dark.9.png
+++ b/java/res/drawable-xhdpi/keyboard_key_feedback_background_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/keyboard_key_feedback_left_background_lxx_dark.9.png b/java/res/drawable-xhdpi/keyboard_key_feedback_left_background_lxx_dark.9.png
deleted file mode 100644
index ca90d52fd..000000000
--- a/java/res/drawable-xhdpi/keyboard_key_feedback_left_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-xhdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.png b/java/res/drawable-xhdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.png
deleted file mode 100644
index ad277d6ab..000000000
--- a/java/res/drawable-xhdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-xhdpi/keyboard_key_feedback_more_background_lxx_dark.9.png b/java/res/drawable-xhdpi/keyboard_key_feedback_more_background_lxx_dark.9.png
index 3c5f89f33..d1a2f7599 100644
--- a/java/res/drawable-xhdpi/keyboard_key_feedback_more_background_lxx_dark.9.png
+++ b/java/res/drawable-xhdpi/keyboard_key_feedback_more_background_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/keyboard_key_feedback_right_background_lxx_dark.9.png b/java/res/drawable-xhdpi/keyboard_key_feedback_right_background_lxx_dark.9.png
deleted file mode 100644
index 6c4982476..000000000
--- a/java/res/drawable-xhdpi/keyboard_key_feedback_right_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-xhdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.png b/java/res/drawable-xhdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.png
deleted file mode 100644
index 2cd7b02fa..000000000
--- a/java/res/drawable-xhdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-xhdpi/sym_keyboard_shift_locked_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_shift_locked_lxx_dark.png
new file mode 100644
index 000000000..6ee55e8c7
--- /dev/null
+++ b/java/res/drawable-xhdpi/sym_keyboard_shift_locked_lxx_dark.png
Binary files differ
diff --git a/java/res/drawable-xhdpi/sym_keyboard_shift_lxx_dark.png b/java/res/drawable-xhdpi/sym_keyboard_shift_lxx_dark.png
new file mode 100644
index 000000000..a5c509324
--- /dev/null
+++ b/java/res/drawable-xhdpi/sym_keyboard_shift_lxx_dark.png
Binary files differ
diff --git a/java/res/drawable-xxhdpi/emoji_category_tab_selected_holo_dark.9.png b/java/res/drawable-xxhdpi/emoji_category_tab_selected_holo_dark.9.png
deleted file mode 100644
index e5efc5828..000000000
--- a/java/res/drawable-xxhdpi/emoji_category_tab_selected_holo_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-xxhdpi/emoji_category_tab_selected_ics.9.png b/java/res/drawable-xxhdpi/emoji_category_tab_selected_ics.9.png
new file mode 100644
index 000000000..b13ee2b6a
--- /dev/null
+++ b/java/res/drawable-xxhdpi/emoji_category_tab_selected_ics.9.png
Binary files differ
diff --git a/java/res/drawable-xxhdpi/emoji_category_tab_selected_klp.9.png b/java/res/drawable-xxhdpi/emoji_category_tab_selected_klp.9.png
new file mode 100644
index 000000000..c81e651dd
--- /dev/null
+++ b/java/res/drawable-xxhdpi/emoji_category_tab_selected_klp.9.png
Binary files differ
diff --git a/java/res/drawable-xxhdpi/emoji_category_tab_selected_lxx_dark.9.png b/java/res/drawable-xxhdpi/emoji_category_tab_selected_lxx_dark.9.png
new file mode 100644
index 000000000..084554f3d
--- /dev/null
+++ b/java/res/drawable-xxhdpi/emoji_category_tab_selected_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-xxhdpi/emoji_category_tab_unselected_lxx_dark.9.png b/java/res/drawable-xxhdpi/emoji_category_tab_unselected_lxx_dark.9.png
new file mode 100644
index 000000000..62547a90f
--- /dev/null
+++ b/java/res/drawable-xxhdpi/emoji_category_tab_unselected_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-xxhdpi/ic_emoji_emoticons_activated_holo_dark.png b/java/res/drawable-xxhdpi/ic_emoji_emoticons_activated_holo_dark.png
new file mode 100644
index 000000000..a217269cb
--- /dev/null
+++ b/java/res/drawable-xxhdpi/ic_emoji_emoticons_activated_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-xxhdpi/ic_emoji_emoticons_normal_holo_dark.png b/java/res/drawable-xxhdpi/ic_emoji_emoticons_normal_holo_dark.png
new file mode 100644
index 000000000..dfa43cd5b
--- /dev/null
+++ b/java/res/drawable-xxhdpi/ic_emoji_emoticons_normal_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-xxhdpi/ic_emoji_recent_activated_holo_dark.png b/java/res/drawable-xxhdpi/ic_emoji_recents_activated_holo_dark.png
index 25e847ef3..25e847ef3 100644
--- a/java/res/drawable-xxhdpi/ic_emoji_recent_activated_holo_dark.png
+++ b/java/res/drawable-xxhdpi/ic_emoji_recents_activated_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-xxhdpi/ic_emoji_recent_normal_holo_dark.png b/java/res/drawable-xxhdpi/ic_emoji_recents_normal_holo_dark.png
index c86368d73..c86368d73 100644
--- a/java/res/drawable-xxhdpi/ic_emoji_recent_normal_holo_dark.png
+++ b/java/res/drawable-xxhdpi/ic_emoji_recents_normal_holo_dark.png
Binary files differ
diff --git a/java/res/drawable-xxhdpi/keyboard_key_feedback_background_lxx_dark.9.png b/java/res/drawable-xxhdpi/keyboard_key_feedback_background_lxx_dark.9.png
index 1f10e926c..f7814917d 100644
--- a/java/res/drawable-xxhdpi/keyboard_key_feedback_background_lxx_dark.9.png
+++ b/java/res/drawable-xxhdpi/keyboard_key_feedback_background_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-xxhdpi/keyboard_key_feedback_left_background_lxx_dark.9.png b/java/res/drawable-xxhdpi/keyboard_key_feedback_left_background_lxx_dark.9.png
deleted file mode 100644
index 25e362ce7..000000000
--- a/java/res/drawable-xxhdpi/keyboard_key_feedback_left_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-xxhdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.png b/java/res/drawable-xxhdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.png
deleted file mode 100644
index c6d9f3cc7..000000000
--- a/java/res/drawable-xxhdpi/keyboard_key_feedback_left_more_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-xxhdpi/keyboard_key_feedback_more_background_lxx_dark.9.png b/java/res/drawable-xxhdpi/keyboard_key_feedback_more_background_lxx_dark.9.png
index a197c2932..a79499f24 100644
--- a/java/res/drawable-xxhdpi/keyboard_key_feedback_more_background_lxx_dark.9.png
+++ b/java/res/drawable-xxhdpi/keyboard_key_feedback_more_background_lxx_dark.9.png
Binary files differ
diff --git a/java/res/drawable-xxhdpi/keyboard_key_feedback_right_background_lxx_dark.9.png b/java/res/drawable-xxhdpi/keyboard_key_feedback_right_background_lxx_dark.9.png
deleted file mode 100644
index 686f757ba..000000000
--- a/java/res/drawable-xxhdpi/keyboard_key_feedback_right_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-xxhdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.png b/java/res/drawable-xxhdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.png
deleted file mode 100644
index 41fad2db0..000000000
--- a/java/res/drawable-xxhdpi/keyboard_key_feedback_right_more_background_lxx_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/java/res/drawable-xxhdpi/sym_keyboard_shift_locked_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_shift_locked_lxx_dark.png
new file mode 100644
index 000000000..2595ec985
--- /dev/null
+++ b/java/res/drawable-xxhdpi/sym_keyboard_shift_locked_lxx_dark.png
Binary files differ
diff --git a/java/res/drawable-xxhdpi/sym_keyboard_shift_lxx_dark.png b/java/res/drawable-xxhdpi/sym_keyboard_shift_lxx_dark.png
new file mode 100644
index 000000000..a58b525a0
--- /dev/null
+++ b/java/res/drawable-xxhdpi/sym_keyboard_shift_lxx_dark.png
Binary files differ
diff --git a/java/res/color/emoji_tab_label_color_lxx_dark.xml b/java/res/drawable/ic_emoji_emoticons_holo_dark.xml
index 090f83e6a..59e23499e 100644
--- a/java/res/color/emoji_tab_label_color_lxx_dark.xml
+++ b/java/res/drawable/ic_emoji_emoticons_holo_dark.xml
@@ -21,13 +21,12 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_focused="true"
- android:color="@color/key_text_color_lxx_dark" />
+ android:drawable="@drawable/ic_emoji_emoticons_activated_holo_dark" />
<item
android:state_pressed="true"
- android:color="@color/key_text_color_lxx_dark" />
+ android:drawable="@drawable/ic_emoji_emoticons_activated_holo_dark" />
<item
android:state_selected="true"
- android:color="@color/key_text_color_lxx_dark" />
- <item
- android:color="@color/key_text_inactive_color_lxx_dark" />
+ android:drawable="@drawable/ic_emoji_emoticons_activated_holo_dark" />
+ <item android:drawable="@drawable/ic_emoji_emoticons_normal_holo_dark" />
</selector>
diff --git a/java/res/drawable/ic_emoji_recent_holo_dark.xml b/java/res/drawable/ic_emoji_recents_holo_dark.xml
index 225caeb2b..f14349f34 100644
--- a/java/res/drawable/ic_emoji_recent_holo_dark.xml
+++ b/java/res/drawable/ic_emoji_recents_holo_dark.xml
@@ -21,12 +21,12 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_focused="true"
- android:drawable="@drawable/ic_emoji_recent_activated_holo_dark" />
+ android:drawable="@drawable/ic_emoji_recents_activated_holo_dark" />
<item
android:state_pressed="true"
- android:drawable="@drawable/ic_emoji_recent_activated_holo_dark" />
+ android:drawable="@drawable/ic_emoji_recents_activated_holo_dark" />
<item
android:state_selected="true"
- android:drawable="@drawable/ic_emoji_recent_activated_holo_dark" />
- <item android:drawable="@drawable/ic_emoji_recent_normal_holo_dark" />
+ android:drawable="@drawable/ic_emoji_recents_activated_holo_dark" />
+ <item android:drawable="@drawable/ic_emoji_recents_normal_holo_dark" />
</selector>
diff --git a/java/res/drawable/keyboard_key_feedback_lxx_dark.xml b/java/res/drawable/keyboard_key_feedback_lxx_dark.xml
index e624a8ba8..ab1109bcc 100644
--- a/java/res/drawable/keyboard_key_feedback_lxx_dark.xml
+++ b/java/res/drawable/keyboard_key_feedback_lxx_dark.xml
@@ -20,15 +20,15 @@
>
<!-- Left edge -->
<item latin:state_left_edge="true" latin:state_has_morekeys="true"
- android:drawable="@drawable/keyboard_key_feedback_left_more_background_lxx_dark" />
+ android:drawable="@drawable/keyboard_key_feedback_more_background_lxx_dark" />
<item latin:state_left_edge="true"
- android:drawable="@drawable/keyboard_key_feedback_left_background_lxx_dark" />
+ android:drawable="@drawable/keyboard_key_feedback_background_lxx_dark" />
<!-- Right edge -->
<item latin:state_right_edge="true" latin:state_has_morekeys="true"
- android:drawable="@drawable/keyboard_key_feedback_right_more_background_lxx_dark" />
+ android:drawable="@drawable/keyboard_key_feedback_more_background_lxx_dark" />
<item latin:state_right_edge="true"
- android:drawable="@drawable/keyboard_key_feedback_right_background_lxx_dark" />
+ android:drawable="@drawable/keyboard_key_feedback_background_lxx_dark" />
<item latin:state_has_morekeys="true"
android:drawable="@drawable/keyboard_key_feedback_more_background_lxx_dark" />
diff --git a/java/res/layout/emoji_keyboard_tab_label.xml b/java/res/layout/emoji_keyboard_tab_label.xml
deleted file mode 100644
index 62c552dd8..000000000
--- a/java/res/layout/emoji_keyboard_tab_label.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2013, 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="0dip"
- android:layout_weight="1.0"
- android:layout_height="wrap_content"
- android:gravity="center"
-/>
diff --git a/java/res/layout/emoji_palettes_view.xml b/java/res/layout/emoji_palettes_view.xml
index c0c346ef0..e2933f96f 100644
--- a/java/res/layout/emoji_palettes_view.xml
+++ b/java/res/layout/emoji_palettes_view.xml
@@ -41,11 +41,9 @@
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@drawable/emoji_category_tab_selected_holo_dark"
android:divider="@null"
android:tabStripEnabled="true"
- android:tabStripLeft="@drawable/emoji_category_tab_unselected_holo_dark"
- android:tabStripRight="@drawable/emoji_category_tab_unselected_holo_dark" />
+ style="?attr/emojiTabWidgetStyle" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="0dip"
@@ -70,7 +68,6 @@
android:layout_width="0dip"
android:layout_weight="12.5"
android:layout_height="match_parent"
- android:src="@drawable/sym_keyboard_delete_holo_dark"
android:contentDescription="@string/spoken_description_delete" />
</LinearLayout>
<android.support.v4.view.ViewPager
@@ -80,8 +77,8 @@
<com.android.inputmethod.keyboard.emoji.EmojiCategoryPageIndicatorView
android:id="@+id/emoji_category_page_id_view"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/emoji_category_page_id_background_holo" />
+ android:layout_height="2dip"
+ style="?attr/emojiCategoryPageIndicatorViewStyle" />
<LinearLayout
android:id="@+id/emoji_action_bar"
android:orientation="horizontal"
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index b90e82b53..307ef1351 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -30,6 +30,10 @@
<attr name="keyPreviewTextViewStyle" format="reference"/>
<!-- EmojiPalettesView style -->
<attr name="emojiPalettesViewStyle" format="reference" />
+ <!-- TabWidget of EmojiPlettesView style -->
+ <attr name="emojiTabWidgetStyle" format="reference" />
+ <!-- EmojiCategoryPageIndicatorView style -->
+ <attr name="emojiCategoryPageIndicatorViewStyle" format="reference" />
<!-- MoreKeysKeyboard style -->
<attr name="moreKeysKeyboardStyle" format="reference" />
<!-- MoreKeysKeyboardView style -->
@@ -172,7 +176,17 @@
</declare-styleable>
<declare-styleable name="EmojiPalettesView">
- <attr name="emojiTabLabelColor" format="reference" />
+ <attr name="iconEmojiRecentsTab" format="reference" />
+ <attr name="iconEmojiCategory1Tab" format="reference" />
+ <attr name="iconEmojiCategory2Tab" format="reference" />
+ <attr name="iconEmojiCategory3Tab" format="reference" />
+ <attr name="iconEmojiCategory4Tab" format="reference" />
+ <attr name="iconEmojiCategory5Tab" format="reference" />
+ <attr name="iconEmojiCategory6Tab" format="reference" />
+ </declare-styleable>
+
+ <declare-styleable name="EmojiCategoryPageIndicatorView">
+ <attr name="emojiCategoryPageIndicatorColor" format="color" />
</declare-styleable>
<declare-styleable name="SuggestionStripView">
diff --git a/java/res/values/colors.xml b/java/res/values/colors.xml
index 12cb71f2e..0eee08de2 100644
--- a/java/res/values/colors.xml
+++ b/java/res/values/colors.xml
@@ -34,6 +34,7 @@
<color name="spacebar_text_color_holo">#FFC0C0C0</color>
<color name="spacebar_text_shadow_color_holo">#80000000</color>
<color name="gesture_floating_preview_color_holo">#C0000000</color>
+ <color name="emoji_tab_page_indicator_background_holo">#111111</color>
<!-- Color resources for KLP theme. Base color = F0F0F0 -->
<color name="highlight_color_klp">#FFF0F0F0</color>
<color name="typed_word_color_klp">#D8F0F0F0</color>
@@ -53,12 +54,11 @@
<color name="suggestions_strip_background_lxx_dark">#263238</color>
<color name="suggested_word_background_selected_lxx_dark">#384248</color>
<color name="gesture_floating_preview_color_lxx_dark">#C0000000</color>
+ <color name="emoji_tab_page_indicator_background_lxx_dark">#263238</color>
<!-- Color resources for setup wizard and tutorial -->
<color name="setup_background">#FFEBEBEB</color>
<color name="setup_text_dark">#FF707070</color>
<color name="setup_text_action">@android:color/holo_blue_light</color>
<color name="setup_step_background">@android:color/background_light</color>
<color name="setup_welcome_video_margin_color">#FFCCCCCC</color>
- <color name="emoji_category_page_id_background_holo">#FF000000</color>
- <color name="emoji_category_page_id_foreground_holo">#80FFFFFF</color>
</resources>
diff --git a/java/res/values/themes-common.xml b/java/res/values/themes-common.xml
index df26fb3b4..c5d3f55a1 100644
--- a/java/res/values/themes-common.xml
+++ b/java/res/values/themes-common.xml
@@ -110,6 +110,8 @@
<!-- Though {@link EmojiPalettesView} doesn't extend {@link KeyboardView}, some views inside it,
for instance delete button, need themed {@link KeyboardView} attributes. -->
<style name="EmojiPalettesView" />
+ <style name="EmojiTabWidget" />
+ <style name="EmojiCategoryPageIndicatorView" />
<style name="MoreKeysKeyboard" />
<style
name="MoreKeysKeyboardView"
diff --git a/java/res/values/themes-ics.xml b/java/res/values/themes-ics.xml
index 22fb2c822..f7ca5a340 100644
--- a/java/res/values/themes-ics.xml
+++ b/java/res/values/themes-ics.xml
@@ -25,6 +25,8 @@
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.ICS</item>
<item name="keyPreviewTextViewStyle">@style/KeyPreviewTextView.ICS</item>
<item name="emojiPalettesViewStyle">@style/EmojiPalettesView.ICS</item>
+ <item name="emojiTabWidgetStyle">@style/EmojiTabWidget.ICS</item>
+ <item name="emojiCategoryPageIndicatorViewStyle">@style/EmojiCategoryPageIndicatorView.ICS</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.ICS</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.ICS</item>
<item name="suggestionStripViewStyle">@style/SuggestionStripView.ICS</item>
@@ -87,7 +89,22 @@
name="EmojiPalettesView.ICS"
parent="MainKeyboardView.ICS"
>
- <item name="emojiTabLabelColor">@color/emoji_tab_label_color_holo</item>
+ <item name="iconEmojiRecentsTab">@drawable/ic_emoji_recents_holo_dark</item>
+ <item name="iconEmojiCategory1Tab">@drawable/ic_emoji_people_holo_dark</item>
+ <item name="iconEmojiCategory2Tab">@drawable/ic_emoji_objects_holo_dark</item>
+ <item name="iconEmojiCategory3Tab">@drawable/ic_emoji_nature_holo_dark</item>
+ <item name="iconEmojiCategory4Tab">@drawable/ic_emoji_places_holo_dark</item>
+ <item name="iconEmojiCategory5Tab">@drawable/ic_emoji_symbols_holo_dark</item>
+ <item name="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_holo_dark</item>
+ </style>
+ <style name="EmojiCategoryPageIndicatorView.ICS">
+ <item name="android:background">@color/emoji_tab_page_indicator_background_holo</item>
+ <item name="emojiCategoryPageIndicatorColor">@color/highlight_color_ics</item>
+ </style>
+ <style name="EmojiTabWidget.ICS">
+ <item name="android:background">@drawable/emoji_category_tab_selected_ics</item>
+ <item name="android:tabStripLeft">@drawable/emoji_category_tab_unselected_holo_dark</item>
+ <item name="android:tabStripRight">@drawable/emoji_category_tab_unselected_holo_dark</item>
</style>
<style
name="MoreKeysKeyboard.ICS"
diff --git a/java/res/values/themes-klp.xml b/java/res/values/themes-klp.xml
index 212f5db01..96d0478ba 100644
--- a/java/res/values/themes-klp.xml
+++ b/java/res/values/themes-klp.xml
@@ -25,6 +25,8 @@
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.KLP</item>
<item name="keyPreviewTextViewStyle">@style/KeyPreviewTextView.KLP</item>
<item name="emojiPalettesViewStyle">@style/EmojiPalettesView.KLP</item>
+ <item name="emojiTabWidgetStyle">@style/EmojiTabWidget.KLP</item>
+ <item name="emojiCategoryPageIndicatorViewStyle">@style/EmojiCategoryPageIndicatorView.KLP</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.KLP</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.KLP</item>
<item name="suggestionStripViewStyle">@style/SuggestionStripView.KLP</item>
@@ -87,7 +89,22 @@
name="EmojiPalettesView.KLP"
parent="MainKeyboardView.KLP"
>
- <item name="emojiTabLabelColor">@color/emoji_tab_label_color_holo</item>
+ <item name="iconEmojiRecentsTab">@drawable/ic_emoji_recents_holo_dark</item>
+ <item name="iconEmojiCategory1Tab">@drawable/ic_emoji_people_holo_dark</item>
+ <item name="iconEmojiCategory2Tab">@drawable/ic_emoji_objects_holo_dark</item>
+ <item name="iconEmojiCategory3Tab">@drawable/ic_emoji_nature_holo_dark</item>
+ <item name="iconEmojiCategory4Tab">@drawable/ic_emoji_places_holo_dark</item>
+ <item name="iconEmojiCategory5Tab">@drawable/ic_emoji_symbols_holo_dark</item>
+ <item name="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_holo_dark</item>
+ </style>
+ <style name="EmojiCategoryPageIndicatorView.KLP">
+ <item name="android:background">@color/emoji_tab_page_indicator_background_holo</item>
+ <item name="emojiCategoryPageIndicatorColor">@color/highlight_color_klp</item>
+ </style>
+ <style name="EmojiTabWidget.KLP">
+ <item name="android:background">@drawable/emoji_category_tab_selected_klp</item>
+ <item name="android:tabStripLeft">@drawable/emoji_category_tab_unselected_holo_dark</item>
+ <item name="android:tabStripRight">@drawable/emoji_category_tab_unselected_holo_dark</item>
</style>
<style
name="MoreKeysKeyboard.KLP"
diff --git a/java/res/values/themes-lxx-dark.xml b/java/res/values/themes-lxx-dark.xml
index ace5fe9c6..7fb122a79 100644
--- a/java/res/values/themes-lxx-dark.xml
+++ b/java/res/values/themes-lxx-dark.xml
@@ -25,6 +25,8 @@
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.LXX_Dark</item>
<item name="keyPreviewTextViewStyle">@style/KeyPreviewTextView.LXX_Dark</item>
<item name="emojiPalettesViewStyle">@style/EmojiPalettesView.LXX_Dark</item>
+ <item name="emojiTabWidgetStyle">@style/EmojiTabWidget.LXX_Dark</item>
+ <item name="emojiCategoryPageIndicatorViewStyle">@style/EmojiCategoryPageIndicatorView.LXX_Dark</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.LXX_Dark</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.LXX_Dark</item>
<item name="suggestionStripViewStyle">@style/SuggestionStripView.LXX_Dark</item>
@@ -88,7 +90,23 @@
name="EmojiPalettesView.LXX_Dark"
parent="MainKeyboardView.LXX_Dark"
>
- <item name="emojiTabLabelColor">@color/emoji_tab_label_color_lxx_dark</item>
+ <!-- TODO: Update those icons to LXX_Dark theme. -->
+ <item name="iconEmojiRecentsTab">@drawable/ic_emoji_recents_holo_dark</item>
+ <item name="iconEmojiCategory1Tab">@drawable/ic_emoji_people_holo_dark</item>
+ <item name="iconEmojiCategory2Tab">@drawable/ic_emoji_objects_holo_dark</item>
+ <item name="iconEmojiCategory3Tab">@drawable/ic_emoji_nature_holo_dark</item>
+ <item name="iconEmojiCategory4Tab">@drawable/ic_emoji_places_holo_dark</item>
+ <item name="iconEmojiCategory5Tab">@drawable/ic_emoji_symbols_holo_dark</item>
+ <item name="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_holo_dark</item>
+ </style>
+ <style name="EmojiCategoryPageIndicatorView.LXX_Dark">
+ <item name="android:background">@color/emoji_tab_page_indicator_background_lxx_dark</item>
+ <item name="emojiCategoryPageIndicatorColor">@color/highlight_color_lxx_dark</item>
+ </style>
+ <style name="EmojiTabWidget.LXX_Dark">
+ <item name="android:background">@drawable/emoji_category_tab_selected_lxx_dark</item>
+ <item name="android:tabStripLeft">@drawable/emoji_category_tab_unselected_lxx_dark</item>
+ <item name="android:tabStripRight">@drawable/emoji_category_tab_unselected_lxx_dark</item>
</style>
<style
name="MoreKeysKeyboard.LXX_Dark"
diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml
index 2adc957b1..777a13d42 100644
--- a/java/res/xml/method.xml
+++ b/java/res/xml/method.xml
@@ -332,6 +332,7 @@
/>
<!-- TODO: This hindi_compact keyboard is a preliminary layout.
This isn't based on the final specification. -->
+ <!--
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic_compact"
android:subtypeId="0xe49c89a1"
@@ -340,6 +341,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=hindi_compact,EmojiCapable"
android:isAsciiCapable="false"
/>
+ -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x35b7526a"
@@ -480,6 +482,7 @@
/>
<!-- TODO: This marathi keyboard is a preliminary layout.
This isn't based on the final specification. -->
+ <!--
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x747b9f03"
@@ -488,6 +491,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=marathi,EmojiCapable"
android:isAsciiCapable="false"
/>
+ -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x84c87c61"
@@ -498,6 +502,7 @@
/>
<!-- TODO: This Myanmar keyboard is a preliminary layout.
This isn't based on the final specification. -->
+ <!--
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0xea266ea4"
@@ -506,6 +511,7 @@
android:imeSubtypeExtraValue="KeyboardLayoutSet=myanmar,EmojiCapable,CombiningRules=MyanmarReordering"
android:isAsciiCapable="false"
/>
+ -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
android:label="@string/subtype_generic"
android:subtypeId="0x3f12ee14"
diff --git a/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java b/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
index 0499a3456..46caef625 100644
--- a/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
+++ b/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
@@ -17,6 +17,7 @@
package com.android.inputmethod.accessibility;
import android.content.Context;
+import android.content.res.Resources;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseIntArray;
@@ -27,21 +28,18 @@ import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.KeyboardId;
import com.android.inputmethod.latin.Constants;
import com.android.inputmethod.latin.R;
-import com.android.inputmethod.latin.utils.CollectionUtils;
-import java.util.HashMap;
+import java.util.Locale;
public final class KeyCodeDescriptionMapper {
private static final String TAG = KeyCodeDescriptionMapper.class.getSimpleName();
+ private static final String SPOKEN_EMOJI_RESOURCE_NAME_FORMAT = "spoken_emoji_%04X";
// The resource ID of the string spoken for obscured keys
private static final int OBSCURED_KEY_RES_ID = R.string.spoken_description_dot;
private static KeyCodeDescriptionMapper sInstance = new KeyCodeDescriptionMapper();
- // Map of key labels to spoken description resource IDs
- private final HashMap<CharSequence, Integer> mKeyLabelMap = CollectionUtils.newHashMap();
-
// Sparse array of spoken description resource IDs indexed by key codes
private final SparseIntArray mKeyCodeMap;
@@ -114,17 +112,12 @@ public final class KeyCodeDescriptionMapper {
return getDescriptionForActionKey(context, keyboard, key);
}
- if (!TextUtils.isEmpty(key.getLabel())) {
- final String label = key.getLabel().trim();
-
- // First, attempt to map the label to a pre-defined description.
- if (mKeyLabelMap.containsKey(label)) {
- return context.getString(mKeyLabelMap.get(label));
- }
+ if (code == Constants.CODE_OUTPUT_TEXT) {
+ return key.getOutputText();
}
// Just attempt to speak the description.
- if (key.getCode() != Constants.CODE_UNSPECIFIED) {
+ if (code != Constants.CODE_UNSPECIFIED) {
return getDescriptionForKeyCode(context, keyboard, key, shouldObscure);
}
return null;
@@ -139,7 +132,7 @@ public final class KeyCodeDescriptionMapper {
* @param keyboard The keyboard on which the key resides.
* @return a character sequence describing the action performed by pressing the key
*/
- private String getDescriptionForSwitchAlphaSymbol(final Context context,
+ private static String getDescriptionForSwitchAlphaSymbol(final Context context,
final Keyboard keyboard) {
final KeyboardId keyboardId = keyboard.mId;
final int elementId = keyboardId.mElementId;
@@ -177,7 +170,8 @@ public final class KeyCodeDescriptionMapper {
* @param keyboard The keyboard on which the key resides.
* @return A context-sensitive description of the "Shift" key.
*/
- private String getDescriptionForShiftKey(final Context context, final Keyboard keyboard) {
+ private static String getDescriptionForShiftKey(final Context context,
+ final Keyboard keyboard) {
final KeyboardId keyboardId = keyboard.mId;
final int elementId = keyboardId.mElementId;
final int resId;
@@ -211,7 +205,7 @@ public final class KeyCodeDescriptionMapper {
* @param key The key to describe.
* @return Returns a context-sensitive description of the "Enter" action key.
*/
- private String getDescriptionForActionKey(final Context context, final Keyboard keyboard,
+ private static String getDescriptionForActionKey(final Context context, final Keyboard keyboard,
final Key key) {
final KeyboardId keyboardId = keyboard.mId;
final int actionId = keyboardId.imeAction();
@@ -280,6 +274,13 @@ public final class KeyCodeDescriptionMapper {
if (mKeyCodeMap.indexOfKey(code) >= 0) {
return context.getString(mKeyCodeMap.get(code));
}
+ final int spokenEmojiId = getSpokenDescriptionId(
+ context, code, SPOKEN_EMOJI_RESOURCE_NAME_FORMAT);
+ if (spokenEmojiId != 0) {
+ final String spokenEmoji = context.getString(spokenEmojiId);
+ mKeyCodeMap.append(code, spokenEmojiId);
+ return spokenEmoji;
+ }
if (isDefinedNonCtrl) {
return Character.toString((char) code);
}
@@ -288,4 +289,13 @@ public final class KeyCodeDescriptionMapper {
}
return context.getString(R.string.spoken_description_unknown, code);
}
+
+ private static int getSpokenDescriptionId(final Context context, final int code,
+ final String resourceNameFormat) {
+ final String resourceName = String.format(Locale.ROOT, resourceNameFormat, code);
+ final Resources resources = context.getResources();
+ final String packageName = resources.getResourcePackageName(
+ R.string.spoken_description_unknown);
+ return resources.getIdentifier(resourceName, "string", packageName);
+ }
}
diff --git a/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java b/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java
new file mode 100644
index 000000000..eed40f4a9
--- /dev/null
+++ b/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityDelegate.java
@@ -0,0 +1,232 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.accessibility;
+
+import android.os.SystemClock;
+import android.support.v4.view.AccessibilityDelegateCompat;
+import android.support.v4.view.ViewCompat;
+import android.support.v4.view.accessibility.AccessibilityEventCompat;
+import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewParent;
+import android.view.accessibility.AccessibilityEvent;
+
+import com.android.inputmethod.keyboard.Key;
+import com.android.inputmethod.keyboard.KeyDetector;
+import com.android.inputmethod.keyboard.Keyboard;
+import com.android.inputmethod.keyboard.KeyboardView;
+
+public class KeyboardAccessibilityDelegate<KV extends KeyboardView>
+ extends AccessibilityDelegateCompat {
+ protected final KV mKeyboardView;
+ protected final KeyDetector mKeyDetector;
+ private Keyboard mKeyboard;
+ private KeyboardAccessibilityNodeProvider mAccessibilityNodeProvider;
+ private Key mLastHoverKey;
+
+ public KeyboardAccessibilityDelegate(final KV keyboardView, final KeyDetector keyDetector) {
+ super();
+ mKeyboardView = keyboardView;
+ mKeyDetector = keyDetector;
+
+ // Ensure that the view has an accessibility delegate.
+ ViewCompat.setAccessibilityDelegate(keyboardView, this);
+ }
+
+ /**
+ * Called when the keyboard layout changes.
+ * <p>
+ * <b>Note:</b> This method will be called even if accessibility is not
+ * enabled.
+ * @param keyboard The keyboard that is being set to the wrapping view.
+ */
+ public void setKeyboard(final Keyboard keyboard) {
+ if (keyboard == null) {
+ return;
+ }
+ if (mAccessibilityNodeProvider != null) {
+ mAccessibilityNodeProvider.setKeyboard(keyboard);
+ }
+ mKeyboard = keyboard;
+ }
+
+ protected Keyboard getKeyboard() {
+ return mKeyboard;
+ }
+
+ /**
+ * Sends a window state change event with the specified text.
+ *
+ * @param text The text to send with the event.
+ */
+ protected void sendWindowStateChanged(final String text) {
+ final AccessibilityEvent stateChange = AccessibilityEvent.obtain(
+ AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
+ mKeyboardView.onInitializeAccessibilityEvent(stateChange);
+ stateChange.getText().add(text);
+ stateChange.setContentDescription(null);
+
+ final ViewParent parent = mKeyboardView.getParent();
+ if (parent != null) {
+ parent.requestSendAccessibilityEvent(mKeyboardView, stateChange);
+ }
+ }
+
+ /**
+ * Delegate method for View.getAccessibilityNodeProvider(). This method is called in SDK
+ * version 15 (Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) and higher to obtain the virtual
+ * node hierarchy provider.
+ *
+ * @param host The host view for the provider.
+ * @return The accessibility node provider for the current keyboard.
+ */
+ @Override
+ public KeyboardAccessibilityNodeProvider getAccessibilityNodeProvider(final View host) {
+ return getAccessibilityNodeProvider();
+ }
+
+ /**
+ * @return A lazily-instantiated node provider for this view delegate.
+ */
+ protected KeyboardAccessibilityNodeProvider getAccessibilityNodeProvider() {
+ // Instantiate the provide only when requested. Since the system
+ // will call this method multiple times it is a good practice to
+ // cache the provider instance.
+ if (mAccessibilityNodeProvider == null) {
+ mAccessibilityNodeProvider = new KeyboardAccessibilityNodeProvider(mKeyboardView);
+ }
+ return mAccessibilityNodeProvider;
+ }
+
+ /**
+ * Receives hover events when touch exploration is turned on in SDK versions ICS and higher.
+ *
+ * @param event The hover event.
+ * @return {@code true} if the event is handled
+ */
+ public boolean dispatchHoverEvent(final MotionEvent event) {
+ final int x = (int) event.getX();
+ final int y = (int) event.getY();
+ final Key previousKey = mLastHoverKey;
+ final Key key = mKeyDetector.detectHitKey(x, y);
+ mLastHoverKey = key;
+
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_HOVER_EXIT:
+ // Make sure we're not getting an EXIT event because the user slid
+ // off the keyboard area, then force a key press.
+ if (key != null) {
+ final long downTime = simulateKeyPress(key);
+ simulateKeyRelease(key, downTime);
+ }
+ //$FALL-THROUGH$
+ case MotionEvent.ACTION_HOVER_ENTER:
+ return onHoverKey(key, event);
+ case MotionEvent.ACTION_HOVER_MOVE:
+ if (key != previousKey) {
+ return onTransitionKey(key, previousKey, event);
+ }
+ return onHoverKey(key, event);
+ }
+ return false;
+ }
+
+ /**
+ * Simulates a key press by injecting touch an event into the keyboard view.
+ * This avoids the complexity of trackers and listeners within the keyboard.
+ *
+ * @param key The key to press.
+ */
+ private long simulateKeyPress(final Key key) {
+ final int x = key.getHitBox().centerX();
+ final int y = key.getHitBox().centerY();
+ final long downTime = SystemClock.uptimeMillis();
+ final MotionEvent downEvent = MotionEvent.obtain(
+ downTime, downTime, MotionEvent.ACTION_DOWN, x, y, 0);
+ mKeyboardView.onTouchEvent(downEvent);
+ downEvent.recycle();
+ return downTime;
+ }
+
+ /**
+ * Simulates a key release by injecting touch an event into the keyboard view.
+ * This avoids the complexity of trackers and listeners within the keyboard.
+ *
+ * @param key The key to release.
+ */
+ private void simulateKeyRelease(final Key key, final long downTime) {
+ final int x = key.getHitBox().centerX();
+ final int y = key.getHitBox().centerY();
+ final MotionEvent upEvent = MotionEvent.obtain(
+ downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, x, y, 0);
+ mKeyboardView.onTouchEvent(upEvent);
+ upEvent.recycle();
+ }
+
+ /**
+ * Simulates a transition between two {@link Key}s by sending a HOVER_EXIT on the previous key,
+ * a HOVER_ENTER on the current key, and a HOVER_MOVE on the current key.
+ *
+ * @param currentKey The currently hovered key.
+ * @param previousKey The previously hovered key.
+ * @param event The event that triggered the transition.
+ * @return {@code true} if the event was handled.
+ */
+ private boolean onTransitionKey(final Key currentKey, final Key previousKey,
+ final MotionEvent event) {
+ final int savedAction = event.getAction();
+ event.setAction(MotionEvent.ACTION_HOVER_EXIT);
+ onHoverKey(previousKey, event);
+ event.setAction(MotionEvent.ACTION_HOVER_ENTER);
+ onHoverKey(currentKey, event);
+ event.setAction(MotionEvent.ACTION_HOVER_MOVE);
+ final boolean handled = onHoverKey(currentKey, event);
+ event.setAction(savedAction);
+ return handled;
+ }
+
+ /**
+ * Handles a hover event on a key. If {@link Key} extended View, this would be analogous to
+ * calling View.onHoverEvent(MotionEvent).
+ *
+ * @param key The currently hovered key.
+ * @param event The hover event.
+ * @return {@code true} if the event was handled.
+ */
+ private boolean onHoverKey(final Key key, final MotionEvent event) {
+ // Null keys can't receive events.
+ if (key == null) {
+ return false;
+ }
+ final KeyboardAccessibilityNodeProvider provider = getAccessibilityNodeProvider();
+
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_HOVER_ENTER:
+ provider.sendAccessibilityEventForKey(
+ key, AccessibilityEventCompat.TYPE_VIEW_HOVER_ENTER);
+ provider.performActionForKey(
+ key, AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS, null);
+ break;
+ case MotionEvent.ACTION_HOVER_EXIT:
+ provider.sendAccessibilityEventForKey(
+ key, AccessibilityEventCompat.TYPE_VIEW_HOVER_EXIT);
+ break;
+ }
+ return true;
+ }
+}
diff --git a/java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityNodeProvider.java b/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityNodeProvider.java
index f69d316c9..cddd1c7ed 100644
--- a/java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityNodeProvider.java
+++ b/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityNodeProvider.java
@@ -47,8 +47,8 @@ import java.util.List;
* virtual views, thus conveying their logical structure.
* </p>
*/
-public final class MainKeyboardAccessibilityNodeProvider extends AccessibilityNodeProviderCompat {
- private static final String TAG = MainKeyboardAccessibilityNodeProvider.class.getSimpleName();
+public final class KeyboardAccessibilityNodeProvider extends AccessibilityNodeProviderCompat {
+ private static final String TAG = KeyboardAccessibilityNodeProvider.class.getSimpleName();
private static final int UNDEFINED = Integer.MIN_VALUE;
private final KeyCodeDescriptionMapper mKeyCodeDescriptionMapper;
@@ -69,7 +69,8 @@ public final class MainKeyboardAccessibilityNodeProvider extends AccessibilityNo
/** The current keyboard. */
private Keyboard mKeyboard;
- public MainKeyboardAccessibilityNodeProvider(final KeyboardView keyboardView) {
+ public KeyboardAccessibilityNodeProvider(final KeyboardView keyboardView) {
+ super();
mKeyCodeDescriptionMapper = KeyCodeDescriptionMapper.getInstance();
mAccessibilityUtils = AccessibilityUtils.getInstance();
mKeyboardView = keyboardView;
diff --git a/java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityDelegate.java b/java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityDelegate.java
index 10929424b..c114551c8 100644
--- a/java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityDelegate.java
+++ b/java/src/com/android/inputmethod/accessibility/MainKeyboardAccessibilityDelegate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,15 +18,10 @@ package com.android.inputmethod.accessibility;
import android.content.Context;
import android.os.SystemClock;
-import android.support.v4.view.AccessibilityDelegateCompat;
-import android.support.v4.view.ViewCompat;
import android.support.v4.view.accessibility.AccessibilityEventCompat;
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat;
import android.util.SparseIntArray;
import android.view.MotionEvent;
-import android.view.View;
-import android.view.ViewParent;
-import android.view.accessibility.AccessibilityEvent;
import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.KeyDetector;
@@ -36,7 +31,8 @@ import com.android.inputmethod.keyboard.MainKeyboardView;
import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.utils.SubtypeLocaleUtils;
-public final class MainKeyboardAccessibilityDelegate extends AccessibilityDelegateCompat {
+public final class MainKeyboardAccessibilityDelegate
+ extends KeyboardAccessibilityDelegate<MainKeyboardView> {
/** Map of keyboard modes to resource IDs. */
private static final SparseIntArray KEYBOARD_MODE_RES_IDS = new SparseIntArray();
@@ -52,48 +48,26 @@ public final class MainKeyboardAccessibilityDelegate extends AccessibilityDelega
KEYBOARD_MODE_RES_IDS.put(KeyboardId.MODE_URL, R.string.keyboard_mode_url);
}
- private final MainKeyboardView mView;
- private Keyboard mKeyboard;
- private MainKeyboardAccessibilityNodeProvider mAccessibilityNodeProvider;
-
- private Key mLastHoverKey = null;
-
- /**
- * Inset in pixels to look for keys when the user's finger exits the keyboard area.
- */
- private int mEdgeSlop;
-
/** The most recently set keyboard mode. */
private int mLastKeyboardMode = KEYBOARD_IS_HIDDEN;
private static final int KEYBOARD_IS_HIDDEN = -1;
- public MainKeyboardAccessibilityDelegate(final MainKeyboardView view) {
- final Context context = view.getContext();
- mEdgeSlop = context.getResources().getDimensionPixelSize(
- R.dimen.config_accessibility_edge_slop);
- mView = view;
-
- // Ensure that the view has an accessibility delegate.
- ViewCompat.setAccessibilityDelegate(view, this);
+ public MainKeyboardAccessibilityDelegate(final MainKeyboardView mainKeyboardView,
+ final KeyDetector keyDetector) {
+ super(mainKeyboardView, keyDetector);
}
/**
- * Called when the keyboard layout changes.
- * <p>
- * <b>Note:</b> This method will be called even if accessibility is not
- * enabled.
- * @param keyboard The keyboard that is being set to the wrapping view.
+ * {@inheritDoc}
*/
+ @Override
public void setKeyboard(final Keyboard keyboard) {
if (keyboard == null) {
return;
}
- if (mAccessibilityNodeProvider != null) {
- mAccessibilityNodeProvider.setKeyboard(keyboard);
- }
- final Keyboard lastKeyboard = mKeyboard;
+ final Keyboard lastKeyboard = getKeyboard();
+ super.setKeyboard(keyboard);
final int lastKeyboardMode = mLastKeyboardMode;
- mKeyboard = keyboard;
mLastKeyboardMode = keyboard.mId.mMode;
// Since this method is called even when accessibility is off, make sure
@@ -144,7 +118,7 @@ public final class MainKeyboardAccessibilityDelegate extends AccessibilityDelega
* @param keyboard The new keyboard.
*/
private void announceKeyboardMode(final Keyboard keyboard) {
- final Context context = mView.getContext();
+ final Context context = mKeyboardView.getContext();
final int modeTextResId = KEYBOARD_MODE_RES_IDS.get(keyboard.mId.mMode);
if (modeTextResId == 0) {
return;
@@ -194,7 +168,7 @@ public final class MainKeyboardAccessibilityDelegate extends AccessibilityDelega
default:
return;
}
- final String text = mView.getContext().getString(resId);
+ final String text = mKeyboardView.getContext().getString(resId);
sendWindowStateChanged(text);
}
@@ -202,191 +176,9 @@ public final class MainKeyboardAccessibilityDelegate extends AccessibilityDelega
* Announces that the keyboard has been hidden.
*/
private void announceKeyboardHidden() {
- final Context context = mView.getContext();
+ final Context context = mKeyboardView.getContext();
final String text = context.getString(R.string.announce_keyboard_hidden);
sendWindowStateChanged(text);
}
-
- /**
- * Sends a window state change event with the specified text.
- *
- * @param text The text to send with the event.
- */
- private void sendWindowStateChanged(final String text) {
- final AccessibilityEvent stateChange = AccessibilityEvent.obtain(
- AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
- mView.onInitializeAccessibilityEvent(stateChange);
- stateChange.getText().add(text);
- stateChange.setContentDescription(null);
-
- final ViewParent parent = mView.getParent();
- if (parent != null) {
- parent.requestSendAccessibilityEvent(mView, stateChange);
- }
- }
-
- /**
- * Delegate method for View.getAccessibilityNodeProvider(). This method is called in SDK
- * version 15 (Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) and higher to obtain the virtual
- * node hierarchy provider.
- *
- * @param host The host view for the provider.
- * @return The accessibility node provider for the current keyboard.
- */
- @Override
- public MainKeyboardAccessibilityNodeProvider getAccessibilityNodeProvider(final View host) {
- return getAccessibilityNodeProvider();
- }
-
- /**
- * Receives hover events when touch exploration is turned on in SDK versions ICS and higher.
- *
- * @param event The hover event.
- * @param keyDetector The {@link KeyDetector} to determine on which key the <code>event</code>
- * is hovering.
- * @return {@code true} if the event is handled
- */
- public boolean dispatchHoverEvent(final MotionEvent event, final KeyDetector keyDetector) {
- final int x = (int) event.getX();
- final int y = (int) event.getY();
- final Key previousKey = mLastHoverKey;
- final Key key;
-
- if (pointInView(x, y)) {
- key = keyDetector.detectHitKey(x, y);
- } else {
- key = null;
- }
- mLastHoverKey = key;
-
- switch (event.getAction()) {
- case MotionEvent.ACTION_HOVER_EXIT:
- // Make sure we're not getting an EXIT event because the user slid
- // off the keyboard area, then force a key press.
- if (key != null) {
- final long downTime = simulateKeyPress(key);
- simulateKeyRelease(key, downTime);
- }
- //$FALL-THROUGH$
- case MotionEvent.ACTION_HOVER_ENTER:
- return onHoverKey(key, event);
- case MotionEvent.ACTION_HOVER_MOVE:
- if (key != previousKey) {
- return onTransitionKey(key, previousKey, event);
- }
- return onHoverKey(key, event);
- }
- return false;
- }
-
- /**
- * @return A lazily-instantiated node provider for this view delegate.
- */
- private MainKeyboardAccessibilityNodeProvider getAccessibilityNodeProvider() {
- // Instantiate the provide only when requested. Since the system
- // will call this method multiple times it is a good practice to
- // cache the provider instance.
- if (mAccessibilityNodeProvider == null) {
- mAccessibilityNodeProvider = new MainKeyboardAccessibilityNodeProvider(mView);
- }
- return mAccessibilityNodeProvider;
- }
-
- /**
- * Utility method to determine whether the given point, in local coordinates, is inside the
- * view, where the area of the view is contracted by the edge slop factor.
- *
- * @param localX The local x-coordinate.
- * @param localY The local y-coordinate.
- */
- private boolean pointInView(final int localX, final int localY) {
- return (localX >= mEdgeSlop) && (localY >= mEdgeSlop)
- && (localX < (mView.getWidth() - mEdgeSlop))
- && (localY < (mView.getHeight() - mEdgeSlop));
- }
-
- /**
- * Simulates a key press by injecting touch an event into the keyboard view.
- * This avoids the complexity of trackers and listeners within the keyboard.
- *
- * @param key The key to press.
- */
- private long simulateKeyPress(final Key key) {
- final int x = key.getHitBox().centerX();
- final int y = key.getHitBox().centerY();
- final long downTime = SystemClock.uptimeMillis();
- final MotionEvent downEvent = MotionEvent.obtain(
- downTime, downTime, MotionEvent.ACTION_DOWN, x, y, 0);
- mView.onTouchEvent(downEvent);
- downEvent.recycle();
- return downTime;
- }
-
- /**
- * Simulates a key release by injecting touch an event into the keyboard view.
- * This avoids the complexity of trackers and listeners within the keyboard.
- *
- * @param key The key to release.
- */
- private void simulateKeyRelease(final Key key, final long downTime) {
- final int x = key.getHitBox().centerX();
- final int y = key.getHitBox().centerY();
- final MotionEvent upEvent = MotionEvent.obtain(
- downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, x, y, 0);
- mView.onTouchEvent(upEvent);
- upEvent.recycle();
- }
-
- /**
- * Simulates a transition between two {@link Key}s by sending a HOVER_EXIT on the previous key,
- * a HOVER_ENTER on the current key, and a HOVER_MOVE on the current key.
- *
- * @param currentKey The currently hovered key.
- * @param previousKey The previously hovered key.
- * @param event The event that triggered the transition.
- * @return {@code true} if the event was handled.
- */
- private boolean onTransitionKey(final Key currentKey, final Key previousKey,
- final MotionEvent event) {
- final int savedAction = event.getAction();
- event.setAction(MotionEvent.ACTION_HOVER_EXIT);
- onHoverKey(previousKey, event);
- event.setAction(MotionEvent.ACTION_HOVER_ENTER);
- onHoverKey(currentKey, event);
- event.setAction(MotionEvent.ACTION_HOVER_MOVE);
- final boolean handled = onHoverKey(currentKey, event);
- event.setAction(savedAction);
- return handled;
- }
-
- /**
- * Handles a hover event on a key. If {@link Key} extended View, this would be analogous to
- * calling View.onHoverEvent(MotionEvent).
- *
- * @param key The currently hovered key.
- * @param event The hover event.
- * @return {@code true} if the event was handled.
- */
- private boolean onHoverKey(final Key key, final MotionEvent event) {
- // Null keys can't receive events.
- if (key == null) {
- return false;
- }
- final MainKeyboardAccessibilityNodeProvider provider = getAccessibilityNodeProvider();
-
- switch (event.getAction()) {
- case MotionEvent.ACTION_HOVER_ENTER:
- provider.sendAccessibilityEventForKey(
- key, AccessibilityEventCompat.TYPE_VIEW_HOVER_ENTER);
- provider.performActionForKey(
- key, AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS, null);
- break;
- case MotionEvent.ACTION_HOVER_EXIT:
- provider.sendAccessibilityEventForKey(
- key, AccessibilityEventCompat.TYPE_VIEW_HOVER_EXIT);
- break;
- }
- return true;
- }
}
diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
index 26b6dd06a..86036ccc1 100644
--- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
@@ -269,7 +269,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
mLanguageOnSpacebarHorizontalMargin = (int)getResources().getDimension(
R.dimen.config_language_on_spacebar_horizontal_margin);
- mAccessibilityDelegate = new MainKeyboardAccessibilityDelegate(this);
+ mAccessibilityDelegate = new MainKeyboardAccessibilityDelegate(this, mKeyDetector);
}
@Override
@@ -773,12 +773,11 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
*/
@Override
public boolean dispatchHoverEvent(final MotionEvent event) {
- if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {
- return mAccessibilityDelegate.dispatchHoverEvent(event, mKeyDetector);
+ if (!AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {
+ // Reflection doesn't support calling superclass methods.
+ return false;
}
-
- // Reflection doesn't support calling superclass methods.
- return false;
+ return mAccessibilityDelegate.dispatchHoverEvent(event);
}
public void updateShortcutKey(final boolean available) {
diff --git a/java/src/com/android/inputmethod/keyboard/emoji/EmojiCategory.java b/java/src/com/android/inputmethod/keyboard/emoji/EmojiCategory.java
index 495fa554b..859099110 100644
--- a/java/src/com/android/inputmethod/keyboard/emoji/EmojiCategory.java
+++ b/java/src/com/android/inputmethod/keyboard/emoji/EmojiCategory.java
@@ -18,6 +18,7 @@ package com.android.inputmethod.keyboard.emoji;
import android.content.SharedPreferences;
import android.content.res.Resources;
+import android.content.res.TypedArray;
import android.graphics.Rect;
import android.os.Build;
import android.util.Log;
@@ -69,17 +70,14 @@ final class EmojiCategory {
"symbols",
"emoticons" };
- private static final int[] sCategoryIcon = {
- R.drawable.ic_emoji_recent_holo_dark,
- R.drawable.ic_emoji_people_holo_dark,
- R.drawable.ic_emoji_objects_holo_dark,
- R.drawable.ic_emoji_nature_holo_dark,
- R.drawable.ic_emoji_places_holo_dark,
- R.drawable.ic_emoji_symbols_holo_dark,
- 0 };
-
- private static final String[] sCategoryLabel =
- { null, null, null, null, null, null, ":-)" };
+ private static final int[] sCategoryTabIconAttr = {
+ R.styleable.EmojiPalettesView_iconEmojiRecentsTab,
+ R.styleable.EmojiPalettesView_iconEmojiCategory1Tab,
+ R.styleable.EmojiPalettesView_iconEmojiCategory2Tab,
+ R.styleable.EmojiPalettesView_iconEmojiCategory3Tab,
+ R.styleable.EmojiPalettesView_iconEmojiCategory4Tab,
+ R.styleable.EmojiPalettesView_iconEmojiCategory5Tab,
+ R.styleable.EmojiPalettesView_iconEmojiCategory6Tab };
private static final int[] sAccessibilityDescriptionResourceIdsForCategories = {
R.string.spoken_descrption_emoji_category_recents,
@@ -104,6 +102,7 @@ final class EmojiCategory {
private final int mMaxPageKeyCount;
private final KeyboardLayoutSet mLayoutSet;
private final HashMap<String, Integer> mCategoryNameToIdMap = CollectionUtils.newHashMap();
+ private final int[] mCategoryTabIconId = new int[sCategoryName.length];
private final ArrayList<CategoryProperties> mShownCategories =
CollectionUtils.newArrayList();
private final ConcurrentHashMap<Long, DynamicGridKeyboard>
@@ -113,13 +112,15 @@ final class EmojiCategory {
private int mCurrentCategoryPageId = 0;
public EmojiCategory(final SharedPreferences prefs, final Resources res,
- final KeyboardLayoutSet layoutSet) {
+ final KeyboardLayoutSet layoutSet, final TypedArray emojiPaletteViewAttr) {
mPrefs = prefs;
mRes = res;
mMaxPageKeyCount = res.getInteger(R.integer.config_emoji_keyboard_max_page_key_count);
mLayoutSet = layoutSet;
for (int i = 0; i < sCategoryName.length; ++i) {
mCategoryNameToIdMap.put(sCategoryName[i], i);
+ mCategoryTabIconId[i] = emojiPaletteViewAttr.getResourceId(
+ sCategoryTabIconAttr[i], 0);
}
addShownCategoryId(EmojiCategory.ID_RECENTS);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2
@@ -158,12 +159,8 @@ final class EmojiCategory {
return mCategoryNameToIdMap.get(strings[0]);
}
- public int getCategoryIcon(final int categoryId) {
- return sCategoryIcon[categoryId];
- }
-
- public String getCategoryLabel(final int categoryId) {
- return sCategoryLabel[categoryId];
+ public int getCategoryTabIcon(final int categoryId) {
+ return mCategoryTabIconId[categoryId];
}
public String getAccessibilityDescription(final int categoryId) {
diff --git a/java/src/com/android/inputmethod/keyboard/emoji/EmojiCategoryPageIndicatorView.java b/java/src/com/android/inputmethod/keyboard/emoji/EmojiCategoryPageIndicatorView.java
index f5aa1079e..a6b089169 100644
--- a/java/src/com/android/inputmethod/keyboard/emoji/EmojiCategoryPageIndicatorView.java
+++ b/java/src/com/android/inputmethod/keyboard/emoji/EmojiCategoryPageIndicatorView.java
@@ -16,29 +16,36 @@
package com.android.inputmethod.keyboard.emoji;
-import com.android.inputmethod.latin.R;
-
import android.content.Context;
+import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
-import android.widget.LinearLayout;
+import android.view.View;
+
+import com.android.inputmethod.latin.R;
-public final class EmojiCategoryPageIndicatorView extends LinearLayout {
+public final class EmojiCategoryPageIndicatorView extends View {
private static final float BOTTOM_MARGIN_RATIO = 1.0f;
private final Paint mPaint = new Paint();
private int mCategoryPageSize = 0;
private int mCurrentCategoryPageId = 0;
private float mOffset = 0.0f;
- public EmojiCategoryPageIndicatorView(final Context context) {
- this(context, null /* attrs */);
+ public EmojiCategoryPageIndicatorView(final Context context, final AttributeSet attrs) {
+ this(context, attrs, R.attr.emojiCategoryPageIndicatorViewStyle);
}
- public EmojiCategoryPageIndicatorView(final Context context, final AttributeSet attrs) {
- super(context, attrs);
- mPaint.setColor(context.getResources().getColor(
- R.color.emoji_category_page_id_foreground_holo));
+ public EmojiCategoryPageIndicatorView(final Context context, final AttributeSet attrs,
+ final int defStyle) {
+ super(context, attrs, defStyle);
+ final TypedArray indicatorViewAttr = context.obtainStyledAttributes(attrs,
+ R.styleable.EmojiCategoryPageIndicatorView, defStyle,
+ R.style.EmojiCategoryPageIndicatorView);
+ final int indicatorColor = indicatorViewAttr.getColor(
+ R.styleable.EmojiCategoryPageIndicatorView_emojiCategoryPageIndicatorColor, 0);
+ indicatorViewAttr.recycle();
+ mPaint.setColor(indicatorColor);
}
public void setCategoryPageId(final int size, final int id, final float offset) {
diff --git a/java/src/com/android/inputmethod/keyboard/emoji/EmojiLayoutParams.java b/java/src/com/android/inputmethod/keyboard/emoji/EmojiLayoutParams.java
index 77c183a99..fbc12829f 100644
--- a/java/src/com/android/inputmethod/keyboard/emoji/EmojiLayoutParams.java
+++ b/java/src/com/android/inputmethod/keyboard/emoji/EmojiLayoutParams.java
@@ -16,14 +16,15 @@
package com.android.inputmethod.keyboard.emoji;
-import com.android.inputmethod.latin.R;
-import com.android.inputmethod.latin.utils.ResourceUtils;
-
import android.content.res.Resources;
import android.support.v4.view.ViewPager;
+import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
+import com.android.inputmethod.latin.R;
+import com.android.inputmethod.latin.utils.ResourceUtils;
+
final class EmojiLayoutParams {
private static final int DEFAULT_KEYBOARD_ROWS = 4;
@@ -67,10 +68,10 @@ final class EmojiLayoutParams {
vp.setLayoutParams(lp);
}
- public void setCategoryPageIdViewProperties(final LinearLayout ll) {
- final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) ll.getLayoutParams();
+ public void setCategoryPageIdViewProperties(final View v) {
+ final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) v.getLayoutParams();
lp.height = mEmojiCategoryPageIdViewHeight;
- ll.setLayoutParams(lp);
+ v.setLayoutParams(lp);
}
public int getActionBarHeight() {
diff --git a/java/src/com/android/inputmethod/keyboard/emoji/EmojiPageKeyboardView.java b/java/src/com/android/inputmethod/keyboard/emoji/EmojiPageKeyboardView.java
index d14ffeef9..48efa17ad 100644
--- a/java/src/com/android/inputmethod/keyboard/emoji/EmojiPageKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/emoji/EmojiPageKeyboardView.java
@@ -22,6 +22,8 @@ import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
+import com.android.inputmethod.accessibility.AccessibilityUtils;
+import com.android.inputmethod.accessibility.KeyboardAccessibilityDelegate;
import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.KeyDetector;
import com.android.inputmethod.keyboard.Keyboard;
@@ -53,6 +55,7 @@ final class EmojiPageKeyboardView extends KeyboardView implements
private OnKeyEventListener mListener = EMPTY_LISTENER;
private final KeyDetector mKeyDetector = new KeyDetector();
private final GestureDetector mGestureDetector;
+ private final KeyboardAccessibilityDelegate<EmojiPageKeyboardView> mAccessibilityDelegate;
public EmojiPageKeyboardView(final Context context, final AttributeSet attrs) {
this(context, attrs, R.attr.keyboardViewStyle);
@@ -64,6 +67,7 @@ final class EmojiPageKeyboardView extends KeyboardView implements
mGestureDetector = new GestureDetector(context, this);
mGestureDetector.setIsLongpressEnabled(false /* isLongpressEnabled */);
mHandler = new Handler();
+ mAccessibilityDelegate = new KeyboardAccessibilityDelegate<>(this, mKeyDetector);
}
public void setOnKeyEventListener(final OnKeyEventListener listener) {
@@ -79,6 +83,15 @@ final class EmojiPageKeyboardView extends KeyboardView implements
mKeyDetector.setKeyboard(keyboard, 0 /* correctionX */, 0 /* correctionY */);
}
+ @Override
+ public boolean dispatchHoverEvent(final MotionEvent event) {
+ if (!AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {
+ // Reflection doesn't support calling superclass methods.
+ return false;
+ }
+ return mAccessibilityDelegate.dispatchHoverEvent(event);
+ }
+
/**
* {@inheritDoc}
*/
diff --git a/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesView.java b/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesView.java
index 8e4595703..6b9e880b9 100644
--- a/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesView.java
+++ b/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesView.java
@@ -19,11 +19,9 @@ package com.android.inputmethod.keyboard.emoji;
import static com.android.inputmethod.latin.Constants.NOT_A_COORDINATE;
import android.content.Context;
-import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
-import android.graphics.Typeface;
import android.os.CountDownTimer;
import android.preference.PreferenceManager;
import android.support.v4.view.ViewPager;
@@ -56,7 +54,7 @@ import java.util.concurrent.TimeUnit;
/**
* View class to implement Emoji palettes.
- * The Emoji keyboard consists of group of views {@link R.layout#emoji_palettes_view}.
+ * The Emoji keyboard consists of group of views layout/emoji_palettes_view.
* <ol>
* <li> Emoji category tabs.
* <li> Delete button.
@@ -70,7 +68,6 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
EmojiPageKeyboardView.OnKeyEventListener {
private final int mFunctionalKeyBackgroundId;
private final int mSpacebarBackgroundId;
- private final ColorStateList mTabLabelColor;
private final DeleteKeyOnTouchListener mDeleteKeyOnTouchListener;
private EmojiPalettesAdapter mEmojiPalettesAdapter;
private final EmojiLayoutParams mEmojiLayoutParams;
@@ -103,11 +100,6 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
mSpacebarBackgroundId = keyboardViewAttr.getResourceId(
R.styleable.KeyboardView_spacebarBackground, keyBackgroundId);
keyboardViewAttr.recycle();
- final TypedArray emojiPalettesViewAttr = context.obtainStyledAttributes(attrs,
- R.styleable.EmojiPalettesView, defStyle, R.style.EmojiPalettesView);
- mTabLabelColor = emojiPalettesViewAttr.getColorStateList(
- R.styleable.EmojiPalettesView_emojiTabLabelColor);
- emojiPalettesViewAttr.recycle();
final KeyboardLayoutSet.Builder builder = new KeyboardLayoutSet.Builder(
context, null /* editorInfo */);
final Resources res = context.getResources();
@@ -117,8 +109,12 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
mEmojiLayoutParams.mEmojiKeyboardHeight);
builder.setOptions(false /* shortcutImeEnabled */, false /* showsVoiceInputKey */,
false /* languageSwitchKeyEnabled */);
+ final KeyboardLayoutSet layoutSet = builder.build();
+ final TypedArray emojiPalettesViewAttr = context.obtainStyledAttributes(attrs,
+ R.styleable.EmojiPalettesView, defStyle, R.style.EmojiPalettesView);
mEmojiCategory = new EmojiCategory(PreferenceManager.getDefaultSharedPreferences(context),
- context.getResources(), builder.build());
+ res, layoutSet, emojiPalettesViewAttr);
+ emojiPalettesViewAttr.recycle();
mDeleteKeyOnTouchListener = new DeleteKeyOnTouchListener(context);
}
@@ -139,24 +135,11 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
final String tabId = mEmojiCategory.getCategoryName(categoryId, 0 /* categoryPageId */);
final TabHost.TabSpec tspec = host.newTabSpec(tabId);
tspec.setContent(R.id.emoji_keyboard_dummy);
- if (mEmojiCategory.getCategoryIcon(categoryId) != 0) {
- final ImageView iconView = (ImageView)LayoutInflater.from(getContext()).inflate(
- R.layout.emoji_keyboard_tab_icon, null);
- iconView.setImageResource(mEmojiCategory.getCategoryIcon(categoryId));
- iconView.setContentDescription(mEmojiCategory.getAccessibilityDescription(categoryId));
- tspec.setIndicator(iconView);
- }
- if (mEmojiCategory.getCategoryLabel(categoryId) != null) {
- final TextView textView = (TextView)LayoutInflater.from(getContext()).inflate(
- R.layout.emoji_keyboard_tab_label, null);
- textView.setText(mEmojiCategory.getCategoryLabel(categoryId));
- textView.setTypeface(Typeface.DEFAULT_BOLD);
- textView.setContentDescription(mEmojiCategory.getAccessibilityDescription(categoryId));
- if (mTabLabelColor != null) {
- textView.setTextColor(mTabLabelColor);
- }
- tspec.setIndicator(textView);
- }
+ final ImageView iconView = (ImageView)LayoutInflater.from(getContext()).inflate(
+ R.layout.emoji_keyboard_tab_icon, null);
+ iconView.setImageResource(mEmojiCategory.getCategoryTabIcon(categoryId));
+ iconView.setContentDescription(mEmojiCategory.getAccessibilityDescription(categoryId));
+ tspec.setIndicator(iconView);
host.addTab(tspec);
}
@@ -353,7 +336,7 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
private static void setupAlphabetKey(final TextView alphabetKey, final String label,
final KeyDrawParams params) {
alphabetKey.setText(label);
- alphabetKey.setTextColor(params.mTextColor);
+ alphabetKey.setTextColor(params.mFunctionalTextColor);
alphabetKey.setTextSize(TypedValue.COMPLEX_UNIT_PX, params.mLabelSize);
alphabetKey.setTypeface(params.mTypeface);
}
diff --git a/java/src/com/android/inputmethod/latin/InputAttributes.java b/java/src/com/android/inputmethod/latin/InputAttributes.java
index 726b3d141..df4948322 100644
--- a/java/src/com/android/inputmethod/latin/InputAttributes.java
+++ b/java/src/com/android/inputmethod/latin/InputAttributes.java
@@ -46,6 +46,8 @@ public final class InputAttributes {
final int inputType = null != editorInfo ? editorInfo.inputType : 0;
final int inputClass = inputType & InputType.TYPE_MASK_CLASS;
mInputType = inputType;
+ mIsPasswordField = InputTypeUtils.isPasswordInputType(inputType)
+ || InputTypeUtils.isVisiblePasswordInputType(inputType);
if (inputClass != InputType.TYPE_CLASS_TEXT) {
// If we are not looking at a TYPE_CLASS_TEXT field, the following strange
// cases may arise, so we do a couple sanity checks for them. If it's a
@@ -61,7 +63,6 @@ public final class InputAttributes {
Log.w(TAG, String.format("Unexpected input class: inputType=0x%08x"
+ " imeOptions=0x%08x", inputType, editorInfo.imeOptions));
}
- mIsPasswordField = false;
mIsSettingsSuggestionStripOn = false;
mInputTypeNoAutoCorrect = false;
mApplicationSpecifiedCompletionOn = false;
@@ -79,8 +80,6 @@ public final class InputAttributes {
final boolean flagAutoComplete =
0 != (inputType & InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);
- mIsPasswordField = InputTypeUtils.isPasswordInputType(inputType)
- || InputTypeUtils.isVisiblePasswordInputType(inputType);
// TODO: Have a helper method in InputTypeUtils
// Make sure that passwords are not displayed in {@link SuggestionStripView}.
final boolean noSuggestionStrip = mIsPasswordField