Chromium Code Reviews
DescriptionFix DropdownPopupWindow's position in Android N.
In Android N, the framework will read view.getLeft() and view.getTop() to
determine where to put the drop down, and if the anchor view is not on screen,
the parent view will be scrolled to make it on screen (by means of
requestChildRectangleOnScreen).
setLayoutParams() is not enough to change left and top values of the anchorView
immediately. Show()ing the ListPopupWindow immediately after setLayoutParams()
will show the popup window in the wrong location, and also cause the parent view
to be improperly scrolled.
Call postShow() to put show() after when the layout of the anchor view is
changed.
Initial selection has to be set after show() is actually called,
because getListView() is null until the ListPopupWindow is shown.
BUG=614746
Review-Url: https://codereview.chromium.org/2049523005
Cr-Commit-Position: refs/heads/master@{#399274}
(cherry picked from commit 87634341cb230c465a1d2c5cdb09f79c0a97bc08)
Committed: https://chromium.googlesource.com/chromium/src/+/80a41c4e6e833c56f88ba2a4ed755be308e6a66a
Patch Set 1 #
Messages
Total messages: 2 (1 generated)
|
||||||||||||||||||||||||||||