saket / cascade

Nested popup menus with smooth height animations for Android
https://saket.github.io/cascade
Apache License 2.0
2.02k stars 67 forks source link

When there is insufficient space on the screen, the Popup is displayed incompletely or even becomes invisible. #50

Closed Merpyzf closed 8 months ago

Merpyzf commented 8 months ago

When there is a button at the bottom of the screen and clicking on it triggers a Popup, the Popup is not fully displayed. In some extreme cases, the Popup is even invisible. I have confirmed that this issue is caused by setting the Popup height to WRAP_CONTENT.

Screenshot_20240103_201714

when I specified the exact height for the Popup, the issue was resolved. (I manually measured the height of each item in the RecyclerView).

   popup.width = fixedWidth
   popup.height = **measureHeightOfChildrenCompat(maxHeight)** + context.dip(4) // Doesn't work on API 21 without this.

   popup.showAsDropDown(anchor, 0, 0, gravity)

Screenshot_20240103_202253

saket commented 8 months ago

Was this accidentally closed?