Fix chat color selection context menu positioning.

This commit is contained in:
Alex Hart 2021-05-26 11:13:25 -03:00
parent 03c19f54c2
commit 6866b7a277

View file

@ -56,8 +56,10 @@ class ChatSelectionContextMenu(val context: Context) : PopupWindow(context) {
anchor.getDrawingRect(rect) anchor.getDrawingRect(rect)
root.offsetDescendantRectToMyCoords(anchor, rect) root.offsetDescendantRectToMyCoords(anchor, rect)
if (rect.bottom + contentView.height > root.bottom) { contentView.measure(0, 0)
showAsDropDown(anchor, 0, -(contentView.height + anchor.height))
if (rect.bottom + contentView.measuredHeight > root.bottom) {
showAsDropDown(anchor, 0, -(contentView.measuredHeight + anchor.height))
} else { } else {
showAsDropDown(anchor, 0, 0) showAsDropDown(anchor, 0, 0)
} }