Table keyboard should always show return icon on enter key

Bug: 3122750
Change-Id: I75d2b5adff3a349d29d8a56e7b761c26b04683c0
main
Tadashi G. Takaoka 2010-10-22 17:19:17 +09:00
parent 503797ae0e
commit 4f6060b8b7
3 changed files with 31 additions and 25 deletions

View File

@ -21,4 +21,5 @@
<!-- Whether or not Popup on key press is enabled by default --> <!-- Whether or not Popup on key press is enabled by default -->
<bool name="default_popup_preview">false</bool> <bool name="default_popup_preview">false</bool>
<bool name="config_enable_show_settings_key_option">false</bool> <bool name="config_enable_show_settings_key_option">false</bool>
<bool name="config_dynamic_key_top_enter_key">false</bool>
</resources> </resources>

View File

@ -31,4 +31,5 @@
<bool name="default_recorrection_enabled">true</bool> <bool name="default_recorrection_enabled">true</bool>
<bool name="config_long_press_comma_for_settings_enabled">true</bool> <bool name="config_long_press_comma_for_settings_enabled">true</bool>
<bool name="config_enable_show_settings_key_option">true</bool> <bool name="config_enable_show_settings_key_option">true</bool>
<bool name="config_dynamic_key_top_enter_key">true</bool>
</resources> </resources>

View File

@ -192,31 +192,35 @@ public class LatinKeyboard extends BaseKeyboard {
mMode = mode; mMode = mode;
if (mEnterKey == null) if (mEnterKey == null)
return; return;
switch (options & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION)) { final boolean configDynamicKeyToEnterKey = res.getBoolean(
case EditorInfo.IME_ACTION_GO: R.bool.config_dynamic_key_top_enter_key);
resetKeyAttributes(mEnterKey, res.getText(R.string.label_go_key)); if (configDynamicKeyToEnterKey) {
break; switch (options & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
case EditorInfo.IME_ACTION_NEXT: case EditorInfo.IME_ACTION_GO:
resetKeyAttributes(mEnterKey, res.getText(R.string.label_next_key)); resetKeyAttributes(mEnterKey, res.getText(R.string.label_go_key));
break; break;
case EditorInfo.IME_ACTION_DONE: case EditorInfo.IME_ACTION_NEXT:
resetKeyAttributes(mEnterKey, res.getText(R.string.label_done_key)); resetKeyAttributes(mEnterKey, res.getText(R.string.label_next_key));
break; break;
case EditorInfo.IME_ACTION_SEARCH: case EditorInfo.IME_ACTION_DONE:
resetKeyAttributes(mEnterKey, null); resetKeyAttributes(mEnterKey, res.getText(R.string.label_done_key));
mEnterKey.iconPreview = res.getDrawable(R.drawable.sym_keyboard_feedback_search); break;
mEnterKey.icon = res.getDrawable(mIsBlackSym ? R.drawable.sym_bkeyboard_search case EditorInfo.IME_ACTION_SEARCH:
: R.drawable.sym_keyboard_search); resetKeyAttributes(mEnterKey, null);
break; mEnterKey.iconPreview = res.getDrawable(R.drawable.sym_keyboard_feedback_search);
case EditorInfo.IME_ACTION_SEND: mEnterKey.icon = res.getDrawable(mIsBlackSym ? R.drawable.sym_bkeyboard_search
resetKeyAttributes(mEnterKey, res.getText(R.string.label_send_key)); : R.drawable.sym_keyboard_search);
break; break;
default: case EditorInfo.IME_ACTION_SEND:
resetKeyAttributes(mEnterKey, mDefaultEnterLabel); resetKeyAttributes(mEnterKey, res.getText(R.string.label_send_key));
mEnterKey.text = mDefaultEnterText; break;
mEnterKey.icon = mDefaultEnterIcon; default:
mEnterKey.iconPreview = mDefaultEnterPreview; resetKeyAttributes(mEnterKey, mDefaultEnterLabel);
break; mEnterKey.text = mDefaultEnterText;
mEnterKey.icon = mDefaultEnterIcon;
mEnterKey.iconPreview = mDefaultEnterPreview;
break;
}
} }
// Set the initial size of the preview icon // Set the initial size of the preview icon
setDefaultBounds(mEnterKey.iconPreview); setDefaultBounds(mEnterKey.iconPreview);