diff options
author | 2014-05-16 10:32:04 +0900 | |
---|---|---|
committer | 2014-05-19 23:11:39 +0900 | |
commit | 27ca9f1bf17c1d275faed939d529f07bb57e28f3 (patch) | |
tree | 9daf81b259973dd209a8955d7a9c12eee60ee4db | |
parent | d7bef2bee16b6e529d55b505764a79821fe3c825 (diff) | |
download | latinime-27ca9f1bf17c1d275faed939d529f07bb57e28f3.tar.gz latinime-27ca9f1bf17c1d275faed939d529f07bb57e28f3.tar.xz latinime-27ca9f1bf17c1d275faed939d529f07bb57e28f3.zip |
Remove Emoji label tab
Change-Id: Ia2f3482363b462c16a51f2baac59d6bcae96ffab
27 files changed, 64 insertions, 120 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/ic_emoji_emoticons_activated_holo_dark.png b/java/res/drawable-hdpi/ic_emoji_emoticons_activated_holo_dark.png Binary files differnew file mode 100644 index 000000000..1c937c9ef --- /dev/null +++ b/java/res/drawable-hdpi/ic_emoji_emoticons_activated_holo_dark.png 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 Binary files differnew file mode 100644 index 000000000..3508d242a --- /dev/null +++ b/java/res/drawable-hdpi/ic_emoji_emoticons_normal_holo_dark.png 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differnew file mode 100644 index 000000000..c7394e1b0 --- /dev/null +++ b/java/res/drawable-mdpi/ic_emoji_emoticons_activated_holo_dark.png 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 Binary files differnew file mode 100644 index 000000000..eb4dab4c7 --- /dev/null +++ b/java/res/drawable-mdpi/ic_emoji_emoticons_normal_holo_dark.png 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differnew file mode 100644 index 000000000..997c9b700 --- /dev/null +++ b/java/res/drawable-xhdpi/ic_emoji_emoticons_activated_holo_dark.png 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 Binary files differnew file mode 100644 index 000000000..23a519c5d --- /dev/null +++ b/java/res/drawable-xhdpi/ic_emoji_emoticons_normal_holo_dark.png 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differnew file mode 100644 index 000000000..a217269cb --- /dev/null +++ b/java/res/drawable-xxhdpi/ic_emoji_emoticons_activated_holo_dark.png 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 Binary files differnew file mode 100644 index 000000000..dfa43cd5b --- /dev/null +++ b/java/res/drawable-xxhdpi/ic_emoji_emoticons_normal_holo_dark.png 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 Binary files differindex 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 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 Binary files differindex 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 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/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..d764caa91 100644 --- a/java/res/layout/emoji_palettes_view.xml +++ b/java/res/layout/emoji_palettes_view.xml @@ -70,7 +70,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 diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index b90e82b53..80bb6f244 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -172,7 +172,13 @@ </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="SuggestionStripView"> diff --git a/java/res/values/themes-ics.xml b/java/res/values/themes-ics.xml index 22fb2c822..00a4de54b 100644 --- a/java/res/values/themes-ics.xml +++ b/java/res/values/themes-ics.xml @@ -87,7 +87,13 @@ 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="MoreKeysKeyboard.ICS" diff --git a/java/res/values/themes-klp.xml b/java/res/values/themes-klp.xml index 212f5db01..b206560e0 100644 --- a/java/res/values/themes-klp.xml +++ b/java/res/values/themes-klp.xml @@ -87,7 +87,13 @@ 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="MoreKeysKeyboard.KLP" diff --git a/java/res/values/themes-lxx-dark.xml b/java/res/values/themes-lxx-dark.xml index ace5fe9c6..05dd6596b 100644 --- a/java/res/values/themes-lxx-dark.xml +++ b/java/res/values/themes-lxx-dark.xml @@ -88,7 +88,14 @@ 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="MoreKeysKeyboard.LXX_Dark" 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/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); } |