diff options
| author | TYM Tsai <tymtsai@google.com> | 2022-03-22 14:54:39 +0800 |
|---|---|---|
| committer | TYM Tsai <tymtsai@google.com> | 2022-03-24 07:47:34 +0800 |
| commit | 95732390640308e05b31ea22d01aafeb18d10a2e (patch) | |
| tree | ae1f471593facd9d048a2d91f9f885a9b27ef534 /core/java/android | |
| parent | 3c5b9738c7058201a806a622445d265a767c2b95 (diff) | |
API feedback: Modify javadoc for showAutofillDialog
Bug: 220079814
Test: make sdk
Change-Id: Id31459e91e119ed4443a7411f89468d5ed6859c7
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/autofill/AutofillManager.java | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java index 2c81eb1ae306..73b8d642c91f 100644 --- a/core/java/android/view/autofill/AutofillManager.java +++ b/core/java/android/view/autofill/AutofillManager.java @@ -3152,11 +3152,26 @@ public final class AutofillManager { } /** - * Like {@link #showAutofillDialog(View)} but for virtual views. + * If autofill suggestions for a + * <a href="{@docRoot}reference/android/service/autofill/Dataset.html#FillDialogUI"> + * dialog-style UI</a> are available for virtual {@code view}, shows a dialog allowing the user + * to select a suggestion and returns {@code true}. + * <p> + * The dialog may not be shown if the autofill service does not support it, if the autofill + * request has not returned a response yet, if the dialog was shown previously, or if the + * input method is already shown. + * <p> + * It is recommended apps to call this method the first time a user focuses on + * an autofill-able form, and to avoid showing the input method if the dialog is shown. If + * this method returns {@code false}, you should then instead show the input method (assuming + * that is how the view normally handles the focus event). If the user re-focuses on the view, + * you should not call this method again so as to not disrupt usage of the input method. * - * @param virtualId id identifying the virtual child inside the parent view. + * @param view the view hosting the virtual view hierarchy which is used to show autofill + * suggestions. + * @param virtualId id identifying the virtual view inside the host view. + * @return {@code true} if the autofill dialog is being shown */ - // TODO(b/210926084): Consider whether to include the one-time show logic within this method. public boolean showAutofillDialog(@NonNull View view, int virtualId) { Objects.requireNonNull(view); if (shouldShowAutofillDialog(getAutofillId(view, virtualId))) { |
