diff options
| author | Ralston Da Silva <ralu@google.com> | 2019-03-11 15:11:01 -0700 |
|---|---|---|
| committer | Ralston Da Silva <ralu@google.com> | 2019-03-12 16:22:59 -0700 |
| commit | f954e23bab266617a7dc4255c29444b12654eb10 (patch) | |
| tree | 63f7be02c48393d5d39c19bbf132d082297c5827 /core/java/android/widget/AutoCompleteTextView.java | |
| parent | 01830d9498fd99d4dd94e8b13f1dc09f375be562 (diff) | |
Addressing API review comments for AutoCompleteTextView
Bug: 126376225
Test: Ran android.widget.cts.AutoCompleteTextViewTest
Change-Id: I3c665debb29a82075a39ddaef493dea288f0507c
Diffstat (limited to 'core/java/android/widget/AutoCompleteTextView.java')
| -rw-r--r-- | core/java/android/widget/AutoCompleteTextView.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java index 89e205caa693..8785251b0a64 100644 --- a/core/java/android/widget/AutoCompleteTextView.java +++ b/core/java/android/widget/AutoCompleteTextView.java @@ -17,6 +17,7 @@ package android.widget; import android.annotation.DrawableRes; +import android.annotation.IntDef; import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.res.Resources.Theme; @@ -44,6 +45,8 @@ import android.view.inspector.InspectableProperty; import com.android.internal.R; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; import java.lang.ref.WeakReference; /** @@ -1259,9 +1262,20 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe } /** + * The valid input method modes for the {@link AutoCompleteTextView}: + * + * {@hide} + */ + @IntDef({ListPopupWindow.INPUT_METHOD_FROM_FOCUSABLE, + ListPopupWindow.INPUT_METHOD_NEEDED, + ListPopupWindow.INPUT_METHOD_NOT_NEEDED}) + @Retention(RetentionPolicy.SOURCE) + public @interface InputMethodMode {} + + /** * Returns the input method mode used by the auto complete dropdown. */ - public int getInputMethodMode() { + public @InputMethodMode int getInputMethodMode() { return mPopup.getInputMethodMode(); } @@ -1277,7 +1291,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe * {@link ListPopupWindow#INPUT_METHOD_NOT_NEEDED}. The auto-complete suggestions are always * displayed, even if the suggestions cover/hide the input method. */ - public void setInputMethodMode(int mode) { + public void setInputMethodMode(@InputMethodMode int mode) { mPopup.setInputMethodMode(mode); } |
