Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gravity doesn't appear to work? #21

Open
Kev1000000 opened this issue Nov 9, 2020 · 9 comments
Open

Gravity doesn't appear to work? #21

Kev1000000 opened this issue Nov 9, 2020 · 9 comments
Assignees

Comments

@Kev1000000
Copy link

I am using Cascade as a means to show a menu in a scrolling list that takes up the entire vertical space of the device. For items at the very end, I'd prefer if the menu anchors at the bottom and and then draws upward rather than achor at the top of the view, draw downward, and then get cutoff by the screen.

I've tried setting Cascade to use various Gravities, but changing the value seems to have no effect.

image

@saket
Copy link
Owner

saket commented Nov 9, 2020

Hmm it shouldn't be getting cut-off. Can you check if this works with the native PopupMenu?

@waseefakhtar
Copy link
Contributor

Hmm it shouldn't be getting cut-off. Can you check if this works with the native PopupMenu?

I believe it's the same issue as #15. I tried investigating why that is but I haven't yet figured it out. Yes, it works well with PopupMenu.

@Kev1000000
Copy link
Author

Ah, yes, it does appear to be the same as #15. The native PopupMenu does handle which direction it should draw automatically based on the view position of the anchor.

Note, in my screenshot you can scroll the list, but whatever PopupMenu is doing to figure out which direction to draw in would be much preferred.

Great library, btw!

@cannizarro
Copy link

@Kev1000000 have you found some workaround for this?

@Kev1000000
Copy link
Author

Nope, was hoping for a proper fix :(

@gsrathoreniks
Copy link

@Kev1000000 @saket is this issue already fixed ?

@saket
Copy link
Owner

saket commented Oct 25, 2023

Sorry I never got enough time to make this work. From what I understand, PopupWindow does not position popups within the window bounds on its own. PopupMenu does not suffer from this because it calculates its height manually to adjust its position. cascade may have to do the same:

https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/widget/ListPopupWindow.java;l=1298;drc=2d32eb61db0bd7de6bce09dd1549271d5479f8dc

Does anyone want to help me out with this? I haven't been able to find enough time to fix this bug. 🙂

Alternatively, are you able to use Compose UI? cascade-compose does not suffer from this problem and has screenshot tests to back this claim.

@gsrathoreniks
Copy link

Can you assign this one as well to me ?

@saket
Copy link
Owner

saket commented Oct 26, 2023

Sure go ahead!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants