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

How can adjust custom layout height accoring to text length. #91

Closed
Gopinatha-L opened this issue Aug 14, 2020 · 6 comments
Closed

How can adjust custom layout height accoring to text length. #91

Gopinatha-L opened this issue Aug 14, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request Released Released already on the latest version.

Comments

@Gopinatha-L
Copy link

Please complete the following information:

  • Library Version - latest
  • Affected Device(s) NA

Describe the Bug:

I"m using a custom layout that would contain a two text view's and it grows according to text length. I'm setting the text after the balllon was created by default height & width.

Expected Behavior:

I want a dynamic height for ballon based on text size or context size in custom layout.

@skydoves
Copy link
Owner

skydoves commented Aug 14, 2020

Hi, could you test using maxWidth parameter to your TextViews?

val myTextView = customProfileBalloon.getContentView().findViewById<TextView>(R.id.myTextView)
myTextView.maxWidth = customProfileBalloon.getMeasureWidth()

@skydoves skydoves self-assigned this Aug 15, 2020
@skydoves skydoves added the Release Next This feature will be released on next version label Aug 15, 2020
@skydoves
Copy link
Owner

This measuring width & height size of the TextViews function will be included in the next release.

@Gopinatha-L
Copy link
Author

Please make sure that text-view dynamic size applies for custom layout as well.

@skydoves
Copy link
Owner

#71

@Gopinatha-L
Copy link
Author

Gopinatha-L commented Aug 17, 2020

Yep. It works for now. Thanks

@skydoves
Copy link
Owner

skydoves commented Sep 3, 2020

Hi, @Gopinatha-L!
It is released in a new version 1.2.2.

Added measureTextWidth function for measuring the exact text size in the custom layout.
measures the width of a TextView and set the measured with. If the width of the parent XML layout is wrapped content, and also the widths of TextViews in the parent layout is wrapped content, this functionality will measure the width exactly.
We can use this method below way.

val myTextView = customProfileBalloon.getContentView().findViewById<TextView>(R.id.myTextView)
customProfileBalloon.measureTextWidth(myTextView)

Thanks for your issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Released Released already on the latest version.
Projects
None yet
Development

No branches or pull requests

2 participants