diff options
author | 2010-10-17 14:19:39 +0900 | |
---|---|---|
committer | 2010-10-17 18:27:48 +0900 | |
commit | a2de8f0f835399dfd6c6732235839481a6bfb620 (patch) | |
tree | 030ffa08b8cb5b597475b4adb955da6f0633cf41 /java/src | |
parent | cd7b7d3e8febcfbcab4628d1fc5b87e809ce56cc (diff) | |
download | latinime-a2de8f0f835399dfd6c6732235839481a6bfb620.tar.gz latinime-a2de8f0f835399dfd6c6732235839481a6bfb620.tar.xz latinime-a2de8f0f835399dfd6c6732235839481a6bfb620.zip |
Save default enter key attributes and restore these if needed
Bug: 3103016
Change-Id: Id8128d5b685ac040afd2c248e1ad17e9aaf1fdf0
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinKeyboard.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java index 246df5fc4..31a9acc71 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java @@ -83,6 +83,12 @@ public class LatinKeyboard extends BaseKeyboard { private int mPrefLetterY; private int mPrefDistance; + // Default Enter key attributes + private final Drawable mDefaultEnterIcon; + private final Drawable mDefaultEnterPreview; + private final CharSequence mDefaultEnterLabel; + private final CharSequence mDefaultEnterText; + // TODO: generalize for any keyboardId private boolean mIsBlackSym; @@ -139,6 +145,15 @@ public class LatinKeyboard extends BaseKeyboard { mSpaceKeyIndex = indexOf(LatinIME.KEYCODE_SPACE); // TODO remove this initialization after cleanup mVerticalGap = super.getVerticalGap(); + if (mEnterKey != null) { + mDefaultEnterIcon = mEnterKey.icon; + mDefaultEnterPreview = mEnterKey.iconPreview; + mDefaultEnterLabel = mEnterKey.label; + mDefaultEnterText = mEnterKey.text; + } else { + mDefaultEnterIcon = mDefaultEnterPreview = null; + mDefaultEnterLabel = mDefaultEnterText = null; + } } @Override @@ -195,6 +210,12 @@ public class LatinKeyboard extends BaseKeyboard { 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); |