Balloon: Balloon does not adapt to the height of a custom View
Please complete the following information:
- Library version:
com.github.skydoves:balloon:1.2.7
- Affected Device: Samsung Galaxy s9 with Android 9.0
Describe the Bug:
We have implemented Balloon with a custom layout. Although the height has specified, some of the text will be cut out if the user adjusts the system font-size.
Expected Behavior: The library adapts the height of the custom view automatically.
I have checked https://github.com/skydoves/Balloon/issues/112 but it does not work for me.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 23 (10 by maintainers)
@cooltey @epool
Finally, released a new
1.3.3
stable version.Thanks for helping to fix this issue! I hope your projects will be going well and I will more appreciate adding this library on the
Librareis used
orOpen source license
pages. πThanks, @skydoves, the SNAPSHOT version looks pretty good to me! It fixes all the issues π― π
Looking forward to seeing the latest release, and thanks again for your hard works!
@skydoves v1.3.3 fixed the issue on our side, thank you so much!!! ππΌ
@skydoves Thanks and I will absolutely add it to the license page π
Hi @skydoves, thanks for the new release.
Not sure if we did the configuration incorrectly or something else, the existing code for the plain text Balloon also has the issue that the text is being cut off on the right side, should we update the current configuration? https://github.com/wikimedia/apps-android-wikipedia/blob/62a4accee6823a888d0be49b86ffd709b2b8f9c1/app/src/main/java/org/wikipedia/util/FeedbackUtil.kt#L199-L215
Screenshot:
Hi, @epool. I just found the issue and I will check soon! And I just solved the issue using
.setPadding(8)
for right now.Makes sense. Thanks for checking π
Thanks for your details!
I just found the problem is
Drawable
on theTextView
. It seems the measuring is not properly executed ifTextView
has a (left or right) drawable. So we can check the balloonβs height will be created correctly or not without using theapp:drawableStartCompat="@drawable/ic_star_24"
.And I just pushed a commit for testing the measuring is being correct. The solution is just creating an
ImageView
instead of using the drawable on theTextView
.If we want to use the
drawableStartCompat
on theTextView
, it should be calculated using the height size of the drawable internally when theTextVIew
has a single line. I will check out more details about this issue πThanks!
Hi @skydoves, thanks for the quick fixes π
But unfortunately, looks like the issue is still there, here are the screenshots in different font-sizes:
You may notice that the right edge is cutting off and maybe thatβs the cause of the issue.
Here is the PR I have created: https://github.com/wikimedia/apps-android-wikipedia/pull/1998