aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-10-12 20:23:08 +0900
committerTadashi G. Takaoka <takaoka@google.com>2010-10-13 00:02:28 +0900
commited3443ebd7af6ecd803c53201687d8c0e5e57d29 (patch)
tree90eb7a442f925e424ec076a3948c1d3584921b9a /java/src
parent50a61083d3231e2f56b640c06686381de73aedc6 (diff)
downloadlatinime-ed3443ebd7af6ecd803c53201687d8c0e5e57d29.tar.gz
latinime-ed3443ebd7af6ecd803c53201687d8c0e5e57d29.tar.xz
latinime-ed3443ebd7af6ecd803c53201687d8c0e5e57d29.zip
Follow up change of I4c6df819
This change is follow up of I4c6df8197b734feb998da78478a4d9a41f6d92b2 Change-Id: I3b8a82dd71305f34afb2e8b6a705efabdc2bc0cf
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboard.java38
1 files changed, 14 insertions, 24 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
index 11e7ef936..e10346570 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
@@ -158,46 +158,36 @@ 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.label = label;
+ }
+
public void setImeOptions(Resources res, int mode, int options) {
if (mEnterKey != null) {
- // Reset some of the rarely used attributes.
- mEnterKey.popupCharacters = null;
- mEnterKey.popupResId = 0;
- mEnterKey.text = null;
switch (options & (EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
case EditorInfo.IME_ACTION_GO:
- mEnterKey.iconPreview = null;
- mEnterKey.icon = null;
- mEnterKey.label = res.getText(R.string.label_go_key);
+ resetKeyAttributes(mEnterKey, res.getText(R.string.label_go_key));
break;
case EditorInfo.IME_ACTION_NEXT:
- mEnterKey.iconPreview = null;
- mEnterKey.icon = null;
- mEnterKey.label = res.getText(R.string.label_next_key);
+ resetKeyAttributes(mEnterKey, res.getText(R.string.label_next_key));
break;
case EditorInfo.IME_ACTION_DONE:
- mEnterKey.iconPreview = null;
- mEnterKey.icon = null;
- mEnterKey.label = res.getText(R.string.label_done_key);
+ 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 = res.getDrawable(mIsBlackSym ?
R.drawable.sym_bkeyboard_search : R.drawable.sym_keyboard_search);
- mEnterKey.label = null;
break;
case EditorInfo.IME_ACTION_SEND:
- mEnterKey.iconPreview = null;
- mEnterKey.icon = null;
- mEnterKey.label = res.getText(R.string.label_send_key);
- break;
- default:
- mEnterKey.iconPreview = res.getDrawable(
- R.drawable.sym_keyboard_feedback_return);
- mEnterKey.icon = res.getDrawable(mIsBlackSym ?
- R.drawable.sym_bkeyboard_return : R.drawable.sym_keyboard_return);
- mEnterKey.label = null;
+ resetKeyAttributes(mEnterKey, res.getText(R.string.label_send_key));
break;
}
// Set the initial size of the preview icon