diff options
| author | 2022-06-08 23:10:17 +0800 | |
|---|---|---|
| committer | 2022-09-19 22:51:25 +0000 | |
| commit | fc5f2a60d360a47e4e852bdc474d83bceb13f83d (patch) | |
| tree | 13d0a883be9c8c2bcf144ad81d8938f155f79f30 | |
| parent | ae90aad610077fe3ae00bd0d6294bc3fbd39d622 (diff) | |
Fix view does not show fill dialog
Sometimes, views may not be visible for the user immediately after
laid out, so add flag for do the evaluation once the view is visible.
Bug: 234429643
Test: Manual, check the fill dialog is appeared
Change-Id: I6b96b68ffc4a4b1ee5f5056848c5c4996d21ae73
| -rw-r--r-- | core/java/android/view/View.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index ba6ba63e4ed0..4fa9b5b8a3c8 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -8207,7 +8207,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, // We have not been laid out yet, hence cannot evaluate // whether this view is visible to the user, we will do // the evaluation once layout is complete. - if (!isLaidOut()) { + // Sometimes, views are already laid out, but it's still + // not visible to the user, we also do the evaluation once + // the view is visible. ex: There is a fade-in animation + // for the activity, the view will be laid out when the + // animation beginning. On the time, the view is not visible + // to the user. And then as the animation progresses, the view + // becomes visible to the user. + if (!isLaidOut() || !isVisibleToUser()) { mPrivateFlags3 |= PFLAG3_NOTIFY_AUTOFILL_ENTER_ON_LAYOUT; } else if (isVisibleToUser()) { if (isFocused()) { |