diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/res/values/attrs.xml | 15 | ||||
-rw-r--r-- | java/res/values/keyboard-icons-black.xml | 7 | ||||
-rw-r--r-- | java/res/values/keyboard-icons-ics.xml | 9 | ||||
-rw-r--r-- | java/res/values/keyboard-icons-white.xml | 8 | ||||
-rw-r--r-- | java/res/values/styles.xml | 11 | ||||
-rw-r--r-- | java/res/xml-sw600dp/kbd_key_styles.xml | 1 | ||||
-rw-r--r-- | java/res/xml-sw768dp/kbd_key_styles.xml | 1 | ||||
-rw-r--r-- | java/res/xml/kbd_key_styles.xml | 1 | ||||
-rw-r--r-- | java/res/xml/kbd_numkey_styles.xml | 2 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/Key.java | 7 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/Keyboard.java | 13 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java | 32 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java | 1 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java | 30 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/internal/KeyboardParams.java | 11 |
15 files changed, 56 insertions, 93 deletions
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 62d667878..cddf513a1 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -124,7 +124,6 @@ </declare-styleable> <declare-styleable name="LatinKeyboardView"> - <attr name="disabledShortcutIcon" format="reference" /> </declare-styleable> <declare-styleable name="SuggestionsView"> @@ -185,7 +184,9 @@ <attr name="iconTabKey" format="reference" /> <attr name="iconShortcutKey" format="reference" /> <attr name="iconShortcutForLabel" format="reference" /> - <attr name="iconShiftedShiftKey" format="reference" /> + <attr name="iconSpaceKeyForNumberLayout" format="reference" /> + <attr name="iconShortcutKeyDisabled" format="reference" /> + <attr name="iconShiftKeyShifted" format="reference" /> <attr name="iconPreviewTabKey" format="reference" /> </declare-styleable> @@ -248,16 +249,14 @@ <enum name="iconTabKey" value="7" /> <enum name="iconShortcutKey" value="8" /> <enum name="iconShortcutForLabel" value="9" /> - </attr> - <!-- Shift key icon for shifted state --> - <attr name="keyIconShifted" format="enum"> - <!-- This should be aligned with KeyboardIcons.ICON_SHIFTED_* --> - <enum name="iconShiftedShiftKey" value="10" /> + <enum name="iconShortcutKeyDisabled" value="10" /> + <enum name="iconSpaceKeyForNumberLayout" value="11" /> + <enum name="iconShiftKeyShifted" value="12" /> </attr> <!-- The icon to show in the popup preview. --> <attr name="keyIconPreview" format="enum"> <!-- This should be aligned with KeyboardIcons.ICON_PREVIEW_* --> - <enum name="iconPreviewTabKey" value="11" /> + <enum name="iconPreviewTabKey" value="13" /> </attr> <!-- The key style to specify a set of key attributes defined by <key_style/> --> <attr name="keyStyle" format="string" /> diff --git a/java/res/values/keyboard-icons-black.xml b/java/res/values/keyboard-icons-black.xml index f767cb349..1caa16a55 100644 --- a/java/res/values/keyboard-icons-black.xml +++ b/java/res/values/keyboard-icons-black.xml @@ -30,10 +30,9 @@ <item name="iconTabKey">@drawable/sym_bkeyboard_tab</item> <item name="iconShortcutKey">@drawable/sym_bkeyboard_mic</item> <item name="iconShortcutForLabel">@drawable/sym_bkeyboard_label_mic</item> - <item name="iconShiftedShiftKey">@drawable/sym_bkeyboard_shift_locked</item> + <item name="iconShortcutKeyDisabled">@drawable/sym_bkeyboard_voice_off</item> + <item name="iconSpaceKeyForNumberLayout">@drawable/sym_bkeyboard_space</item> + <item name="iconShiftKeyShifted">@drawable/sym_bkeyboard_shift_locked</item> <item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item> - <!-- LatinKeyboard icons --> - <item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led</item> - <item name="disabledShortcutIcon">@drawable/sym_bkeyboard_voice_off</item> </style> </resources> diff --git a/java/res/values/keyboard-icons-ics.xml b/java/res/values/keyboard-icons-ics.xml index f1021433d..0d4a3c758 100644 --- a/java/res/values/keyboard-icons-ics.xml +++ b/java/res/values/keyboard-icons-ics.xml @@ -23,16 +23,15 @@ <item name="iconShiftKey">@drawable/sym_keyboard_shift_holo</item> <item name="iconDeleteKey">@drawable/sym_keyboard_delete_holo</item> <item name="iconSettingsKey">@drawable/sym_keyboard_settings_holo</item> - <item name="iconSpaceKey">@drawable/sym_keyboard_space_holo</item> + <item name="iconSpaceKey">@null</item> <item name="iconReturnKey">@drawable/sym_keyboard_return_holo</item> <item name="iconSearchKey">@drawable/sym_keyboard_search_holo</item> <item name="iconTabKey">@drawable/sym_keyboard_tab_holo</item> <item name="iconShortcutKey">@drawable/sym_keyboard_voice_holo</item> <item name="iconShortcutForLabel">@drawable/sym_keyboard_label_mic_holo</item> - <item name="iconShiftedShiftKey">@drawable/sym_keyboard_shift_locked_holo</item> + <item name="iconShortcutKeyDisabled">@drawable/sym_keyboard_voice_off_holo</item> + <item name="iconSpaceKeyForNumberLayout">@drawable/sym_keyboard_space_holo</item> + <item name="iconShiftKeyShifted">@drawable/sym_keyboard_shift_locked_holo</item> <item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item> - <!-- LatinKeyboard icons --> - <item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led_holo</item> - <item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item> </style> </resources> diff --git a/java/res/values/keyboard-icons-white.xml b/java/res/values/keyboard-icons-white.xml index 07ece66b1..a3bb268a0 100644 --- a/java/res/values/keyboard-icons-white.xml +++ b/java/res/values/keyboard-icons-white.xml @@ -26,10 +26,10 @@ <item name="iconTabKey">@drawable/sym_keyboard_tab</item> <item name="iconShortcutKey">@drawable/sym_keyboard_mic</item> <item name="iconShortcutForLabel">@drawable/sym_keyboard_label_mic</item> - <item name="iconShiftedShiftKey">@drawable/sym_keyboard_shift_locked</item> + <!-- TODO: Needs non-holo disabled shortcut icon drawable --> + <item name="iconShortcutKeyDisabled">@drawable/sym_keyboard_voice_off_holo</item> + <item name="iconSpaceKeyForNumberLayout">@drawable/sym_keyboard_space</item> + <item name="iconShiftKeyShifted">@drawable/sym_keyboard_shift_locked</item> <item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item> - <!-- LatinKeyboard icons --> - <item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led</item> - <item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item> </style> </resources> diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml index b1b39088f..f77586559 100644 --- a/java/res/values/styles.xml +++ b/java/res/values/styles.xml @@ -33,6 +33,7 @@ </style> <style name="LatinKeyboard"> <item name="autoCorrectionSpacebarLedEnabled">true</item> + <item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led</item> <item name="spacebarTextRatio">@fraction/spacebar_text_ratio</item> <item name="spacebarTextColor">#FFC0C0C0</item> <item name="spacebarTextShadowColor">#80000000</item> @@ -74,8 +75,6 @@ <style name="LatinKeyboardView" parent="KeyboardView"> - <!-- TODO: Needs non-holo disabled shortcut icon drawable --> - <item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item> </style> <style name="MiniKeyboard" @@ -144,8 +143,6 @@ name="LatinKeyboardView.HighContrast" parent="KeyboardView.HighContrast" > - <!-- TODO: Needs non-holo disabled shortcut icon drawable --> - <item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item> </style> <!-- Theme "Stone" --> <style @@ -183,7 +180,6 @@ name="LatinKeyboardView.Stone" parent="KeyboardView.Stone" > - <item name="disabledShortcutIcon">@drawable/sym_bkeyboard_voice_off</item> </style> <style name="MiniKeyboard.Stone" @@ -218,7 +214,6 @@ name="LatinKeyboardView.Stone.Bold" parent="KeyboardView.Stone.Bold" > - <item name="disabledShortcutIcon">@drawable/sym_bkeyboard_voice_off</item> </style> <!-- Theme "Gingerbread" --> <style @@ -242,8 +237,6 @@ name="LatinKeyboardView.Gingerbread" parent="KeyboardView.Gingerbread" > - <!-- TODO: Needs non-holo disabled shortcut icon drawable --> - <item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item> </style> <style name="MiniKeyboard.Gingerbread" @@ -276,6 +269,7 @@ parent="LatinKeyboard" > <item name="autoCorrectionSpacebarLedEnabled">false</item> + <item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led_holo</item> </style> <style name="KeyboardView.IceCreamSandwich" @@ -304,7 +298,6 @@ name="LatinKeyboardView.IceCreamSandwich" parent="KeyboardView.IceCreamSandwich" > - <item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item> </style> <style name="MiniKeyboard.IceCreamSandwich" diff --git a/java/res/xml-sw600dp/kbd_key_styles.xml b/java/res/xml-sw600dp/kbd_key_styles.xml index e0171b030..275601090 100644 --- a/java/res/xml-sw600dp/kbd_key_styles.xml +++ b/java/res/xml-sw600dp/kbd_key_styles.xml @@ -43,7 +43,6 @@ latin:styleName="shiftKeyStyle" latin:code="@integer/key_shift" latin:keyIcon="iconShiftKey" - latin:keyIconShifted="iconShiftedShiftKey" latin:keyActionFlags="noKeyPreview" latin:backgroundType="sticky" /> <key-style diff --git a/java/res/xml-sw768dp/kbd_key_styles.xml b/java/res/xml-sw768dp/kbd_key_styles.xml index d9266508e..83de4dd24 100644 --- a/java/res/xml-sw768dp/kbd_key_styles.xml +++ b/java/res/xml-sw768dp/kbd_key_styles.xml @@ -25,7 +25,6 @@ latin:styleName="shiftKeyStyle" latin:code="@integer/key_shift" latin:keyIcon="iconShiftKey" - latin:keyIconShifted="iconShiftedShiftKey" latin:keyActionFlags="noKeyPreview" latin:backgroundType="sticky" /> <key-style diff --git a/java/res/xml/kbd_key_styles.xml b/java/res/xml/kbd_key_styles.xml index 5714e09c5..6fdb3f5e8 100644 --- a/java/res/xml/kbd_key_styles.xml +++ b/java/res/xml/kbd_key_styles.xml @@ -66,7 +66,6 @@ latin:styleName="shiftKeyStyle" latin:code="@integer/key_shift" latin:keyIcon="iconShiftKey" - latin:keyIconShifted="iconShiftedShiftKey" latin:keyActionFlags="noKeyPreview" latin:backgroundType="sticky" /> <key-style diff --git a/java/res/xml/kbd_numkey_styles.xml b/java/res/xml/kbd_numkey_styles.xml index c2ff4d50f..003165da8 100644 --- a/java/res/xml/kbd_numkey_styles.xml +++ b/java/res/xml/kbd_numkey_styles.xml @@ -124,6 +124,6 @@ <key-style latin:styleName="numSpaceKeyStyle" latin:code="@integer/key_space" - latin:keyIcon="iconSpaceKey" + latin:keyIcon="iconSpaceKeyForNumberLayout" latin:parentStyle="numKeyBaseStyle" /> </merge> diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index 8330c3127..5dc02c4a7 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -280,8 +280,6 @@ public class Key { R.styleable.Keyboard_Key_keyIconPreview, KeyboardIconsSet.ICON_UNDEFINED)); mIcon = iconsSet.getIcon(style.getInt(keyAttr, R.styleable.Keyboard_Key_keyIcon, KeyboardIconsSet.ICON_UNDEFINED)); - final int shiftedIconId = style.getInt(keyAttr, R.styleable.Keyboard_Key_keyIconShifted, - KeyboardIconsSet.ICON_UNDEFINED); mHintLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyHintLabel); mLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyLabel); @@ -308,11 +306,6 @@ public class Key { mHashCode = hashCode(this); keyAttr.recycle(); - - if (shiftedIconId != KeyboardIconsSet.ICON_UNDEFINED) { - final Drawable shiftedIcon = iconsSet.getIcon(shiftedIconId); - params.addShiftedIcon(this, shiftedIcon); - } } private static int hashCode(Key key) { diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java index b7dd302b7..8a4bb8ce1 100644 --- a/java/src/com/android/inputmethod/keyboard/Keyboard.java +++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java @@ -16,7 +16,6 @@ package com.android.inputmethod.keyboard; -import android.graphics.drawable.Drawable; import android.text.TextUtils; import android.util.Log; @@ -108,8 +107,6 @@ public class Keyboard { public final Set<Key> mKeys; public final Set<Key> mShiftKeys; public final Set<Key> mShiftLockKeys; - public final Map<Key, Drawable> mShiftedIcons; - public final Map<Key, Drawable> mUnshiftedIcons; public final KeyboardIconsSet mIconsSet; private final Map<Integer, Key> mKeyCache = new HashMap<Integer, Key>(); @@ -136,8 +133,6 @@ public class Keyboard { mKeys = Collections.unmodifiableSet(params.mKeys); mShiftKeys = Collections.unmodifiableSet(params.mShiftKeys); mShiftLockKeys = Collections.unmodifiableSet(params.mShiftLockKeys); - mShiftedIcons = Collections.unmodifiableMap(params.mShiftedIcons); - mUnshiftedIcons = Collections.unmodifiableMap(params.mUnshiftedIcons); mIconsSet = params.mIconsSet; mProximityInfo = new ProximityInfo( @@ -179,7 +174,9 @@ public class Keyboard { // To represent "shift locked" state. The highlight is handled by background image that // might be a StateListDrawable. key.setHighlightOn(newShiftLockState); - key.setIcon(newShiftLockState ? mShiftedIcons.get(key) : mUnshiftedIcons.get(key)); + final int iconId = newShiftLockState ? KeyboardIconsSet.ICON_SHIFT_KEY_SHIFTED + : KeyboardIconsSet.ICON_SHIFT_KEY; + key.setIcon(mIconsSet.getIcon(iconId)); } mShiftState.setShiftLocked(newShiftLockState); } @@ -193,7 +190,9 @@ public class Keyboard { void setShifted(boolean newShiftState) { if (!mShiftState.isShiftLocked()) { for (final Key key : mShiftKeys) { - key.setIcon(newShiftState ? mShiftedIcons.get(key) : mUnshiftedIcons.get(key)); + final int iconId = newShiftState ? KeyboardIconsSet.ICON_SHIFT_KEY_SHIFTED + : KeyboardIconsSet.ICON_SHIFT_KEY; + key.setIcon(mIconsSet.getIcon(iconId)); } } mShiftState.setShifted(newShiftState); diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java index 81f8640e9..ccea00f43 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java @@ -19,10 +19,8 @@ package com.android.inputmethod.keyboard; import android.content.Context; import android.content.pm.PackageManager; import android.content.res.Resources; -import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Paint; -import android.graphics.drawable.Drawable; import android.os.Message; import android.text.TextUtils; import android.util.AttributeSet; @@ -41,6 +39,7 @@ import com.android.inputmethod.accessibility.AccessibleKeyboardViewProxy; import com.android.inputmethod.deprecated.VoiceProxy; import com.android.inputmethod.keyboard.PointerTracker.DrawingProxy; import com.android.inputmethod.keyboard.PointerTracker.TimerProxy; +import com.android.inputmethod.keyboard.internal.KeyboardIconsSet; import com.android.inputmethod.latin.LatinIME; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; @@ -67,14 +66,6 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke private final boolean mIsSpacebarTriggeringPopupByLongPress; private boolean mMultipleEnabledIMEsOrSubtypes; - /* Shortcut key and its icons if available */ - private Key mShortcutKey; - // TODO: Remove this variable, use KeyboardIconsSet instead. - private Drawable mEnabledShortcutIcon; - // TODO: Remove this variable and LatinKeyboardView.disabledShortcutIcon attribute. - // This should be moved to KeyboardIconsSet. - private final Drawable mDisabledShortcutIcon; - private final SuddenJumpingTouchEventHandler mTouchScreenRegulator; // Timing constants @@ -266,11 +257,6 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke final int longPressSpaceKeyTimeout = res.getInteger(R.integer.config_long_press_space_key_timeout); mIsSpacebarTriggeringPopupByLongPress = (longPressSpaceKeyTimeout > 0); - - final TypedArray a = context.obtainStyledAttributes( - attrs, R.styleable.LatinKeyboardView, defStyle, R.style.LatinKeyboardView); - mDisabledShortcutIcon = a.getDrawable(R.styleable.LatinKeyboardView_disabledShortcutIcon); - a.recycle(); } public void startIgnoringDoubleTap() { @@ -325,9 +311,6 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke PointerTracker.setKeyDetector(mKeyDetector); mTouchScreenRegulator.setKeyboard(keyboard); mMoreKeysPanelCache.clear(); - - mShortcutKey = keyboard.getKey(Keyboard.CODE_SHORTCUT); - mEnabledShortcutIcon = (mShortcutKey != null) ? mShortcutKey.getIcon() : null; } /** @@ -714,10 +697,15 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke } public void updateShortcutKey(boolean available) { - if (mShortcutKey == null) return; - mShortcutKey.setEnabled(available); - mShortcutKey.setIcon(available ? mEnabledShortcutIcon : mDisabledShortcutIcon); - invalidateKey(mShortcutKey); + final Keyboard keyboard = getKeyboard(); + if (keyboard == null) return; + final Key shortcutKey = keyboard.getKey(Keyboard.CODE_SHORTCUT); + if (shortcutKey == null) return; + shortcutKey.setEnabled(available); + final int iconId = available ? KeyboardIconsSet.ICON_SHORTCUT_KEY + : KeyboardIconsSet.ICON_SHORTCUT_KEY_DISABLED; + shortcutKey.setIcon(keyboard.mIconsSet.getIcon(iconId)); + invalidateKey(shortcutKey); } public void updateSpacebar() { diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java index 3324fa6af..4e15ecf64 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java @@ -160,7 +160,6 @@ public class KeyStyles { readFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelFlags); readInt(keyAttr, R.styleable.Keyboard_Key_keyIcon); readInt(keyAttr, R.styleable.Keyboard_Key_keyIconPreview); - readInt(keyAttr, R.styleable.Keyboard_Key_keyIconShifted); readInt(keyAttr, R.styleable.Keyboard_Key_maxMoreKeysColumn); readInt(keyAttr, R.styleable.Keyboard_Key_backgroundType); readFlag(keyAttr, R.styleable.Keyboard_Key_keyActionFlags); diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java index faa5f86f2..c8a75a92a 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java @@ -28,22 +28,26 @@ public class KeyboardIconsSet { public static final int ICON_UNDEFINED = 0; + // TODO: Make all enums private // This should be aligned with Keyboard.keyIcon enum. - private static final int ICON_SHIFT_KEY = 1; + public static final int ICON_SHIFT_KEY = 1; private static final int ICON_DELETE_KEY = 2; - private static final int ICON_SETTINGS_KEY = 3; // This is also represented as "@icon/3" in XML. - private static final int ICON_SPACE_KEY = 4; + // This is also represented as "@icon/3" in keyboard layout XML. + private static final int ICON_SETTINGS_KEY = 3; + public static final int ICON_SPACE_KEY = 4; private static final int ICON_RETURN_KEY = 5; private static final int ICON_SEARCH_KEY = 6; - private static final int ICON_TAB_KEY = 7; // This is also represented as "@icon/7" in XML. - private static final int ICON_SHORTCUT_KEY = 8; + // This is also represented as "@icon/7" in keyboard layout XML. + private static final int ICON_TAB_KEY = 7; + public static final int ICON_SHORTCUT_KEY = 8; private static final int ICON_SHORTCUT_FOR_LABEL = 9; - // This should be aligned with Keyboard.keyIconShifted enum. - private static final int ICON_SHIFTED_SHIFT_KEY = 10; + public static final int ICON_SHORTCUT_KEY_DISABLED = 10; + private static final int ICON_SPACE_KEY_FOR_NUMBER_LAYOUT = 11; + public static final int ICON_SHIFT_KEY_SHIFTED = 12; // This should be aligned with Keyboard.keyIconPreview enum. - private static final int ICON_PREVIEW_TAB_KEY = 11; + private static final int ICON_PREVIEW_TAB_KEY = 13; - private static final int ICON_LAST = 11; + private static final int ICON_LAST = 13; private final Drawable mIcons[] = new Drawable[ICON_LAST + 1]; @@ -67,8 +71,12 @@ public class KeyboardIconsSet { return ICON_SHORTCUT_KEY; case R.styleable.Keyboard_iconShortcutForLabel: return ICON_SHORTCUT_FOR_LABEL; - case R.styleable.Keyboard_iconShiftedShiftKey: - return ICON_SHIFTED_SHIFT_KEY; + case R.styleable.Keyboard_iconShortcutKeyDisabled: + return ICON_SHORTCUT_KEY_DISABLED; + case R.styleable.Keyboard_iconSpaceKeyForNumberLayout: + return ICON_SPACE_KEY_FOR_NUMBER_LAYOUT; + case R.styleable.Keyboard_iconShiftKeyShifted: + return ICON_SHIFT_KEY_SHIFTED; case R.styleable.Keyboard_iconPreviewTabKey: return ICON_PREVIEW_TAB_KEY; default: diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardParams.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardParams.java index 5248016f1..3e345c42a 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardParams.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardParams.java @@ -16,8 +16,6 @@ package com.android.inputmethod.keyboard.internal; -import android.graphics.drawable.Drawable; - import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardId; @@ -60,8 +58,6 @@ public class KeyboardParams { public final Set<Key> mKeys = new HashSet<Key>(); public final Set<Key> mShiftKeys = new HashSet<Key>(); public final Set<Key> mShiftLockKeys = new HashSet<Key>(); - public final Map<Key, Drawable> mShiftedIcons = new HashMap<Key, Drawable>(); - public final Map<Key, Drawable> mUnshiftedIcons = new HashMap<Key, Drawable>(); public final KeyboardIconsSet mIconsSet = new KeyboardIconsSet(); public int mMostCommonKeyHeight = 0; @@ -128,8 +124,6 @@ public class KeyboardParams { mKeys.clear(); mShiftKeys.clear(); mShiftLockKeys.clear(); - mShiftedIcons.clear(); - mUnshiftedIcons.clear(); clearHistogram(); } @@ -144,11 +138,6 @@ public class KeyboardParams { } } - public void addShiftedIcon(Key key, Drawable icon) { - mUnshiftedIcons.put(key, key.getIcon()); - mShiftedIcons.put(key, icon); - } - private int mMaxHeightCount = 0; private int mMaxWidthCount = 0; private final Map<Integer, Integer> mHeightHistogram = new HashMap<Integer, Integer>(); |