diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 24c9855ae..28ea6fccc 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -155,6 +155,17 @@ + + + + + + + + + + + diff --git a/java/res/xml/kbd_key_styles.xml b/java/res/xml/kbd_key_styles.xml index ec813d741..b80bb9ff4 100644 --- a/java/res/xml/kbd_key_styles.xml +++ b/java/res/xml/kbd_key_styles.xml @@ -21,6 +21,7 @@ + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and in XML to load search icon - mSearchIcon = res.getDrawable(R.drawable.sym_bkeyboard_search); mShiftedIcon = res.getDrawable(R.drawable.sym_bkeyboard_shift_locked); mSpaceBarTextShadowColor = res.getColor( R.color.latinkeyboard_bar_language_shadow_black); } else { // default color scheme is BaseKeyboardView.COLOR_SCHEME_WHITE - // TODO: use and in XML to load search icon - mSearchIcon = res.getDrawable(R.drawable.sym_keyboard_search); mShiftedIcon = res.getDrawable(R.drawable.sym_keyboard_shift_locked); mSpaceBarTextShadowColor = res.getColor( R.color.latinkeyboard_bar_language_shadow_white); @@ -118,16 +105,6 @@ public class LatinKeyboard extends BaseKeyboard { sSpacebarVerticalCorrection = res.getDimensionPixelOffset( R.dimen.spacebar_vertical_correction); mSpaceKeyIndex = indexOf(LatinIME.KEYCODE_SPACE); - - if (mEnterKey != null) { - mDefaultEnterIcon = mEnterKey.icon; - mDefaultEnterPreview = mEnterKey.iconPreview; - mDefaultEnterLabel = mEnterKey.label; - mDefaultEnterText = mEnterKey.text; - } else { - mDefaultEnterIcon = mDefaultEnterPreview = null; - mDefaultEnterLabel = mDefaultEnterText = null; - } } @Override @@ -135,9 +112,6 @@ public class LatinKeyboard extends BaseKeyboard { XmlResourceParser parser, KeyStyles keyStyles) { Key key = new LatinKey(res, parent, x, y, parser, keyStyles); switch (key.codes[0]) { - case LatinIME.KEYCODE_ENTER: - mEnterKey = key; - break; case LatinIME.KEYCODE_SPACE: mSpaceKey = key; mSpaceIcon = key.icon; @@ -148,53 +122,6 @@ public class LatinKeyboard extends BaseKeyboard { return key; } - private static void resetKeyAttributes(Key key, CharSequence label) { - key.popupCharacters = null; - key.popupResId = 0; - key.text = null; - key.iconPreview = null; - key.icon = null; - key.hintIcon = null; - key.label = label; - } - - // TODO: remove this method and use in XML - public void setImeOptions(Resources res, int mode, int options) { - if (mEnterKey == null) - return; - final boolean configDynamicKeyTopEnterKey = res.getBoolean( - R.bool.config_dynamic_key_top_enter_key); - if (configDynamicKeyTopEnterKey) { - switch (options & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION)) { - case EditorInfo.IME_ACTION_GO: - resetKeyAttributes(mEnterKey, res.getText(R.string.label_go_key)); - break; - case EditorInfo.IME_ACTION_NEXT: - resetKeyAttributes(mEnterKey, res.getText(R.string.label_next_key)); - break; - case EditorInfo.IME_ACTION_DONE: - resetKeyAttributes(mEnterKey, res.getText(R.string.label_done_key)); - break; - case EditorInfo.IME_ACTION_SEARCH: - resetKeyAttributes(mEnterKey, null); - mEnterKey.iconPreview = res.getDrawable(R.drawable.sym_keyboard_feedback_search); - mEnterKey.icon = mSearchIcon; - break; - case EditorInfo.IME_ACTION_SEND: - resetKeyAttributes(mEnterKey, res.getText(R.string.label_send_key)); - break; - default: - resetKeyAttributes(mEnterKey, mDefaultEnterLabel); - mEnterKey.text = mDefaultEnterText; - mEnterKey.icon = mDefaultEnterIcon; - mEnterKey.iconPreview = mDefaultEnterPreview; - break; - } - } - // Set the initial size of the preview icon - setDefaultBounds(mEnterKey.iconPreview); - } - public void enableShiftLock() { for (final Key key : getShiftKeys()) { if (key instanceof LatinKey) {