aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java8
-rw-r--r--java/src/com/android/inputmethod/latin/CandidateView.java15
-rw-r--r--java/src/com/android/inputmethod/latin/SubtypeSwitcher.java2
3 files changed, 19 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java
index 3e433361a..e35db8955 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java
@@ -236,10 +236,10 @@ public class KeyboardParser {
R.styleable.Keyboard_Key_maxPopupKeyboardColumn, 5));
mKeyboard.mIconsSet.loadIcons(keyboardAttr);
- mKeyboardTopPadding = keyboardAttr.getDimensionPixelSize(
- R.styleable.Keyboard_keyboardTopPadding, 0);
- mKeyboardBottomPadding = keyboardAttr.getDimensionPixelSize(
- R.styleable.Keyboard_keyboardBottomPadding, 0);
+ mKeyboardTopPadding = getDimensionOrFraction(keyboardAttr,
+ R.styleable.Keyboard_keyboardTopPadding, height, 0);
+ mKeyboardBottomPadding = getDimensionOrFraction(keyboardAttr,
+ R.styleable.Keyboard_keyboardBottomPadding, height, 0);
} finally {
keyAttr.recycle();
keyboardAttr.recycle();
diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java
index 1ab7c6d42..7ec18b38a 100644
--- a/java/src/com/android/inputmethod/latin/CandidateView.java
+++ b/java/src/com/android/inputmethod/latin/CandidateView.java
@@ -21,6 +21,7 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Typeface;
+import android.graphics.drawable.Drawable;
import android.os.Message;
import android.text.Spannable;
import android.text.SpannableString;
@@ -330,9 +331,18 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
mInvertedForegroundColorSpan = new ForegroundColorSpan(mColorTypedWord ^ 0x00ffffff);
mInvertedBackgroundColorSpan = new BackgroundColorSpan(mColorTypedWord);
+ final TypedArray keyboardViewAttr = context.obtainStyledAttributes(
+ attrs, R.styleable.KeyboardView, R.attr.keyboardViewStyle, R.style.KeyboardView);
+ final Drawable keyBackground = keyboardViewAttr.getDrawable(
+ R.styleable.KeyboardView_keyBackground);
+ final int keyTextColor = keyboardViewAttr.getColor(
+ R.styleable.KeyboardView_keyTextColor, 0xFF000000);
+ keyboardViewAttr.recycle();
+
mCandidatesPaneControl = (ViewGroup)findViewById(R.id.candidates_pane_control);
mExpandCandidatesPane = (TextView)findViewById(R.id.expand_candidates_pane);
- mExpandCandidatesPane.getBackground().setAlpha(180);
+ mExpandCandidatesPane.setBackgroundDrawable(keyBackground);
+ mExpandCandidatesPane.setTextColor(keyTextColor);
mExpandCandidatesPane.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
@@ -340,7 +350,8 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
}
});
mCloseCandidatesPane = (TextView)findViewById(R.id.close_candidates_pane);
- mCloseCandidatesPane.getBackground().setAlpha(180);
+ mCloseCandidatesPane.setBackgroundDrawable(keyBackground);
+ mCloseCandidatesPane.setTextColor(keyTextColor);
mCloseCandidatesPane.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
index 6ca12c0c5..8fc19ae87 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java
@@ -188,6 +188,8 @@ public class SubtypeSwitcher {
// TODO: Update an icon for shortcut IME
final Map<InputMethodInfoCompatWrapper, List<InputMethodSubtypeCompatWrapper>> shortcuts =
mImm.getShortcutInputMethodsAndSubtypes();
+ mShortcutInputMethodInfo = null;
+ mShortcutSubtype = null;
for (InputMethodInfoCompatWrapper imi : shortcuts.keySet()) {
List<InputMethodSubtypeCompatWrapper> subtypes = shortcuts.get(imi);
// TODO: Returns the first found IMI for now. Should handle all shortcuts as