summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodService.java
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2016-04-09 15:24:02 -0700
committerYohei Yukawa <yukawa@google.com>2016-04-09 15:24:02 -0700
commit757224008e6187bbb04c89fadbe6921bf8ceda9f (patch)
treed487d45f63e8d43bacbe26ee76c88f3fd43b2664 /core/java/android/inputmethodservice/InputMethodService.java
parent6f3934ea1ce9845be4a19f6e451d222f591c5fa2 (diff)
Revert "Customizes input extract edit view for Wear"
This reverts commit 880602eb640f1f0f7f77f8d17c4ad34aca8b751d [1], which was committed with a wrong author email address and lacked license notice in some files. To avoid confusion, this we decided to temporarily revert that CL so that we can commit it with proper license notice and author address again. [1]: I16226ce393f2d15065d08e66a36d008eb1a0c8a1 Bug: 22512982 Bug: 28098677 Change-Id: I3dd3c7bf0ee9634fc4f3bf433bf5023675873e46
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
-rw-r--r--core/java/android/inputmethodservice/InputMethodService.java53
1 files changed, 7 insertions, 46 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 085b97cc0f6d..cc201bc78bb5 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -68,10 +68,9 @@ import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethod;
import android.view.inputmethod.InputMethodManager;
import android.view.inputmethod.InputMethodSubtype;
+import android.widget.Button;
import android.widget.FrameLayout;
-import android.widget.ImageButton;
import android.widget.LinearLayout;
-import android.widget.TextView;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -303,7 +302,7 @@ public class InputMethodService extends AbstractInputMethodService {
boolean mExtractViewHidden;
ExtractEditText mExtractEditText;
ViewGroup mExtractAccessories;
- View mExtractAction;
+ Button mExtractAction;
ExtractedText mExtractedText;
int mExtractedToken;
@@ -1345,7 +1344,7 @@ public class InputMethodService extends AbstractInputMethodService {
mExtractEditText = (ExtractEditText)view.findViewById(
com.android.internal.R.id.inputExtractEditText);
mExtractEditText.setIME(this);
- mExtractAction = view.findViewById(
+ mExtractAction = (Button)view.findViewById(
com.android.internal.R.id.inputExtractAction);
if (mExtractAction != null) {
mExtractAccessories = (ViewGroup)view.findViewById(
@@ -2409,35 +2408,7 @@ public class InputMethodService extends AbstractInputMethodService {
return getText(com.android.internal.R.string.ime_action_default);
}
}
-
- /**
- * Return a drawable resource id that can be used as a button icon for the given
- * {@link EditorInfo#imeOptions EditorInfo.imeOptions}.
- *
- * @param imeOptions The value from @link EditorInfo#imeOptions EditorInfo.imeOptions}.
- *
- * @return Returns a drawable resource id to use.
- */
- @DrawableRes
- private int getIconForImeAction(int imeOptions) {
- switch (imeOptions&EditorInfo.IME_MASK_ACTION) {
- case EditorInfo.IME_ACTION_GO:
- return com.android.internal.R.drawable.ic_input_extract_action_go;
- case EditorInfo.IME_ACTION_SEARCH:
- return com.android.internal.R.drawable.ic_input_extract_action_search;
- case EditorInfo.IME_ACTION_SEND:
- return com.android.internal.R.drawable.ic_input_extract_action_send;
- case EditorInfo.IME_ACTION_NEXT:
- return com.android.internal.R.drawable.ic_input_extract_action_next;
- case EditorInfo.IME_ACTION_DONE:
- return com.android.internal.R.drawable.ic_input_extract_action_done;
- case EditorInfo.IME_ACTION_PREVIOUS:
- return com.android.internal.R.drawable.ic_input_extract_action_previous;
- default:
- return com.android.internal.R.drawable.ic_input_extract_action_return;
- }
- }
-
+
/**
* Called when the fullscreen-mode extracting editor info has changed,
* to determine whether the extracting (extract text and candidates) portion
@@ -2488,20 +2459,10 @@ public class InputMethodService extends AbstractInputMethodService {
if (hasAction) {
mExtractAccessories.setVisibility(View.VISIBLE);
if (mExtractAction != null) {
- if (mExtractAction instanceof ImageButton) {
- ((ImageButton) mExtractAction)
- .setImageResource(getIconForImeAction(ei.imeOptions));
- if (ei.actionLabel != null) {
- mExtractAction.setContentDescription(ei.actionLabel);
- } else {
- mExtractAction.setContentDescription(getTextForImeAction(ei.imeOptions));
- }
+ if (ei.actionLabel != null) {
+ mExtractAction.setText(ei.actionLabel);
} else {
- if (ei.actionLabel != null) {
- ((TextView) mExtractAction).setText(ei.actionLabel);
- } else {
- ((TextView) mExtractAction).setText(getTextForImeAction(ei.imeOptions));
- }
+ mExtractAction.setText(getTextForImeAction(ei.imeOptions));
}
mExtractAction.setOnClickListener(mActionClickListener);
}