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.7k stars 289 forks source link

Height of ballon is not calculated properly #372

Closed MandeepDaffo closed 1 year ago

MandeepDaffo commented 1 year ago

. Library Version : 1.4.5 . Affected Device(s) : All

Describe the Bug:

Buttons are clipped at end

When we are using a custom layout as view of dialog and in the custom designed layout if two items are constrained horizontally i.e one is textview and that is aligned to ImageView(Close icon). Height of layout and ballon library params is wrap_content. When we set the text on the textview and if we try to support multiple languages the height of Dialog is not calculated by library and it will crop the items from bottom.

Expected Behavior:

If height is set to wrap_content and items are aligned horizontally and textview is used with expect to support multiple languages, in these cases height should be calculated properly by library and shouldn't cutoff the views from bottom.

MandeepDaffo commented 1 year ago

@skydoves Does the library support multi language text while calculating height?

skydoves commented 1 year ago

@MandeepDaffo hey, could you expand on what is the multiple language supports? Do you mean, if the issue occurs if you change the language on the device settings?

MandeepDaffo commented 1 year ago

@skydoves Yes, change in language from the device settings. I am using constraint layout for designing this. This happens more in Samsung S21, moto g4, oneplus etc

skydoves commented 1 year ago

@MandeepDaffo Thanks for the details. This is a very interesting use case. I think the measured size of the balloon must be changed by calling the update method when the language setting has been changed.

I'm curious to know if it works well when you call the balloon.update(anchor) method on the OnResume().

MandeepDaffo commented 1 year ago

@skydoves In some devices I face this issue on fresh show of ballon means device language has been already setup and then app is launched and then on button click ballon is shown. Could this be due to nested constraint layout also?

skydoves commented 1 year ago

@MandeepDaffo That makes sense. Could you build with a single constraint layout? But I'm guessing the measuring text that provided by Android SDK does not work well in different languages. 🤔