summaryrefslogtreecommitdiff
path: root/core/java/android/widget/TextView.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/widget/TextView.java')
-rw-r--r--core/java/android/widget/TextView.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 3c8fcb978fbd..836bbe8fa054 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -11458,7 +11458,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
// Show the IME, except when selecting in read-only text.
final InputMethodManager imm = getInputMethodManager();
viewClicked(imm);
- if (isTextEditable() && mEditor.mShowSoftInputOnFocus && imm != null) {
+ if (isTextEditable() && mEditor.mShowSoftInputOnFocus && imm != null
+ && !showAutofillDialog()) {
imm.showSoftInput(this, 0);
}
@@ -11476,6 +11477,22 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
return superResult;
}
+ /**
+ * The fill dialog UI is a more conspicuous and efficient interface than dropdown UI.
+ * If autofill suggestions are available when the user clicks on a field that supports filling
+ * the dialog UI, Autofill will pop up a fill dialog. The dialog will take up a larger area
+ * to display the datasets, so it is easy for users to pay attention to the datasets and
+ * selecting a dataset. The autofill dialog is shown as the bottom sheet, the better
+ * experience is not to show the IME if there is a fill dialog.
+ */
+ private boolean showAutofillDialog() {
+ final AutofillManager afm = mContext.getSystemService(AutofillManager.class);
+ if (afm != null) {
+ return afm.showAutofillDialog(this);
+ }
+ return false;
+ }
+
@Override
public boolean onGenericMotionEvent(MotionEvent event) {
if (mMovement != null && mText instanceof Spannable && mLayout != null) {