zawadz88/MaterialPopupMenu

How to override popup width with the width of anchor view?

NapasPayu opened this issue · 3 comments

I would like to show a Popup Menu with the same width of anchor view. Is it possible to do so?

Hi,
The library does not support it currently. According to the Material spec it uses increments of 56dp instead.
However, I can see that having a custom width can be sometimes useful so this would be a nice enhancement.
I'll gladly accept any PRs regarding this if anyone wants to contribute :)

Hi @NapasPayu,
I've created a proof of concept for this behaviour:
fixed-width

Is that what you had in mind?

Please note that this is just a proposal - I haven't updated unit tests and only tested this on API 27. There's still more work to be done ;)

Sample added in 4.0.0 together with new APIs to make this happen.