aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/res/color/emoji_tab_label_color_lmp.xml33
-rw-r--r--java/res/values/themes-lmp.xml2
-rw-r--r--java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java29
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java3
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java4
5 files changed, 58 insertions, 13 deletions
diff --git a/java/res/color/emoji_tab_label_color_lmp.xml b/java/res/color/emoji_tab_label_color_lmp.xml
new file mode 100644
index 000000000..5789d569d
--- /dev/null
+++ b/java/res/color/emoji_tab_label_color_lmp.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 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.
+** 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_inactive_color_lmp" />
+</selector>
diff --git a/java/res/values/themes-lmp.xml b/java/res/values/themes-lmp.xml
index a9b8a93cc..823155b23 100644
--- a/java/res/values/themes-lmp.xml
+++ b/java/res/values/themes-lmp.xml
@@ -88,7 +88,7 @@
name="EmojiPalettesView.LMP"
parent="MainKeyboardView.LMP"
>
- <item name="emojiTabLabelColor">@color/emoji_tab_label_color_holo</item>
+ <item name="emojiTabLabelColor">@color/emoji_tab_label_color_lmp</item>
</style>
<style
name="MoreKeysKeyboard.LMP"
diff --git a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
index 2012d34c4..a02ff1175 100644
--- a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
+++ b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
@@ -33,6 +33,7 @@ import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
+import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TabHost;
@@ -45,6 +46,7 @@ import com.android.inputmethod.keyboard.internal.EmojiPageKeyboardView;
import com.android.inputmethod.keyboard.internal.EmojiPalettesAdapter;
import com.android.inputmethod.keyboard.internal.KeyDrawParams;
import com.android.inputmethod.keyboard.internal.KeyVisualAttributes;
+import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
import com.android.inputmethod.latin.Constants;
import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.SubtypeSwitcher;
@@ -74,8 +76,10 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
private EmojiPalettesAdapter mEmojiPalettesAdapter;
private final EmojiLayoutParams mEmojiLayoutParams;
+ private ImageButton mDeleteKey;
private TextView mAlphabetKeyLeft;
private TextView mAlphabetKeyRight;
+ private ImageButton mSpacebar;
private TabHost mTabHost;
private ViewPager mEmojiPager;
private int mCurrentPagerPosition = 0;
@@ -147,6 +151,7 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
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));
textView.setTextColor(mTabLabelColor);
tspec.setIndicator(textView);
@@ -184,10 +189,10 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
mEmojiLayoutParams.setActionBarProperties(actionBar);
// deleteKey depends only on OnTouchListener.
- final ImageView deleteKey = (ImageView)findViewById(R.id.emoji_keyboard_delete);
- deleteKey.setBackgroundResource(mFunctionalKeyBackgroundId);
- deleteKey.setTag(Constants.CODE_DELETE);
- deleteKey.setOnTouchListener(mDeleteKeyOnTouchListener);
+ mDeleteKey = (ImageButton)findViewById(R.id.emoji_keyboard_delete);
+ mDeleteKey.setBackgroundResource(mFunctionalKeyBackgroundId);
+ mDeleteKey.setTag(Constants.CODE_DELETE);
+ mDeleteKey.setOnTouchListener(mDeleteKeyOnTouchListener);
// {@link #mAlphabetKeyLeft}, {@link #mAlphabetKeyRight, and spaceKey depend on
// {@link View.OnClickListener} as well as {@link View.OnTouchListener}.
@@ -206,12 +211,12 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
mAlphabetKeyRight.setTag(Constants.CODE_ALPHA_FROM_EMOJI);
mAlphabetKeyRight.setOnTouchListener(this);
mAlphabetKeyRight.setOnClickListener(this);
- final ImageView spaceKey = (ImageView)findViewById(R.id.emoji_keyboard_space);
- spaceKey.setBackgroundResource(mSpacebarBackgroundId);
- spaceKey.setTag(Constants.CODE_SPACE);
- spaceKey.setOnTouchListener(this);
- spaceKey.setOnClickListener(this);
- mEmojiLayoutParams.setKeyProperties(spaceKey);
+ mSpacebar = (ImageButton)findViewById(R.id.emoji_keyboard_space);
+ mSpacebar.setBackgroundResource(mSpacebarBackgroundId);
+ mSpacebar.setTag(Constants.CODE_SPACE);
+ mSpacebar.setOnTouchListener(this);
+ mSpacebar.setOnClickListener(this);
+ mEmojiLayoutParams.setKeyProperties(mSpacebar);
}
@Override
@@ -353,7 +358,9 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
}
public void startEmojiPalettes(final String switchToAlphaLabel,
- final KeyVisualAttributes keyVisualAttr) {
+ final KeyVisualAttributes keyVisualAttr, final KeyboardIconsSet iconSet) {
+ mDeleteKey.setImageDrawable(iconSet.getIconDrawable(KeyboardIconsSet.NAME_DELETE_KEY));
+ mSpacebar.setImageDrawable(iconSet.getIconDrawable(KeyboardIconsSet.NAME_SPACE_KEY));
final KeyDrawParams params = new KeyDrawParams();
params.updateParams(mEmojiLayoutParams.getActionBarHeight(), keyVisualAttr);
setupAlphabetKey(mAlphabetKeyLeft, switchToAlphaLabel, params);
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 4a46a4a46..ad8fc7344 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -253,10 +253,11 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
// Implements {@link KeyboardState.SwitchActions}.
@Override
public void setEmojiKeyboard() {
+ final Keyboard keyboard = mKeyboardView.getKeyboard();
mMainKeyboardFrame.setVisibility(View.GONE);
mEmojiPalettesView.startEmojiPalettes(
mKeyboardTextsSet.getText(KeyboardTextsSet.SWITCH_TO_ALPHA_KEY_LABEL),
- mKeyboardView.getKeyVisualAttribute());
+ mKeyboardView.getKeyVisualAttribute(), keyboard.mIconsSet);
mEmojiPalettesView.setVisibility(View.VISIBLE);
}
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java
index 65d6a5633..b5a94807e 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java
@@ -138,6 +138,10 @@ public final class KeyboardIconsSet {
throw new RuntimeException("unknown icon name: " + name);
}
+ public Drawable getIconDrawable(final String name) {
+ return getIconDrawable(getIconId(name));
+ }
+
public Drawable getIconDrawable(final int iconId) {
if (isValidIconId(iconId)) {
return mIcons[iconId];