skydoves / Balloon

:balloon: Modernized and sophisticated tooltips, fully customizable with an arrow and animations for Android.
https://skydoves.github.io/libraries/balloon/html/balloon/com.skydoves.balloon/index.html
Apache License 2.0
3.69k stars 289 forks source link

Support padding instead of height/width dp #1

Closed LithiumSheep closed 4 years ago

LithiumSheep commented 5 years ago

Is your feature request related to a problem?

For a balloon with multiple lines of text, having the balloon container scale with its height would be very useful.

Describe the solution you'd like:

At the moment the layout_balloon.xml file uses dp values instead of "wrap_content". If the layout uses "wrap_content" for height, the builder can drop builder.setHeight() and builder.setWidth(), and instead have something like builder.setPaddingVert() and builder.setPaddingHoriz().

Thoughts?

skydoves commented 5 years ago

@lolsheeplol It seems a good way to scaling container.

I will try to implement to scale container size using padding and "wrap_content" layout attribute on the next version.

Thank you for giving a good issue! :)

rgocal commented 5 years ago

I was just going to ask about this. The problem i have right now is i have a list that changes size vertical depending on options available for the action. What i have to currently do is set a default height and add to that height when the listview has so many objects (1 action + add x height, 2 actions add xy height). I've even tried getting the view group height from tree observer to set that as the height but it adds to that value every time its calculated. Having a height option to wrap around the xml would be good.

skydoves commented 5 years ago

Hi, is there a better way to implement having a height option to wrap around the xml with keeping functionalities like showAlignTop? It uses a fixed height with bodyWindow.showAsDropDown. If the layout uses "wrap_content" option, we can't measure the specific height values. Because of the popupWindow shows firstly and inflates the popupWindow 's content view.

rgocal commented 5 years ago

https://github.com/rgocal/Material_PopUp_Menu

You can check and see if there's anything helpful, you could use from my popup menu library. (im actually replacing my library with yours for my project)

rustyhamsterr commented 4 years ago

@skydoves Hi, I am using your library right now and want to improve it. I think using wrap content is a very important function and I wanted to start with this. Did you make progress since this issue was opened? Greetings rusty

skydoves commented 4 years ago

20

skydoves commented 4 years ago

It has been a long time! The first issue is resolved in the new release 1.1.2. 🎉