-
Notifications
You must be signed in to change notification settings - Fork 73
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 determine if need expand the text? #2
Comments
Hi the ExpandableTextView currently doesn't have support for the described behaviour. I'll look into it and get back to you soon. Thanks for using ExpandableTextView and reporting this feature request! |
Hi, To determine if you have to expand or not , I use that code , and I was a copy paste of a set of tips, if not the best way, I am a newbie in Android
|
thanks for the tip! I'll take a look at it and try to integrate it in ExpandableTextView |
just letting you know that I'm finally started working on this feature. I'll keep you posted! |
I liked the suggestion by @webserveis . I wrapped the widget in a widget of my own, cleverly called ExpandableTextView :) I set the global listener right before setting the text.
|
Thanks for the solution provided above, but it works only if text contains "\n". It is better to use ellipsize attribute on ExpandableTextView and check for it in OnGlobalLayoutListener like this:
|
If someone is still looking for this feature Please see this answer |
…do not show the expand button .
Hi @Cliffus |
@vkdinventor isn't this the same library you forked? I couldn't see any method which determines the need to expand. If there is some, please give me the snippet. |
@manish-poddar In my version of this library, you can set maximum line count. So if text takes less than max line count, expand button would be disabled. |
An even easier way is to just check if the ExpandableTextView is ellipsized.
|
If anyone has problem getting this done properly in recyclerView, simply set value first in onBind and then in handler, check line count and execute your logic based on line count... |
How can you get if you need to expand the text? ie when the text takes up very little , so as not to show the expand button .
The text was updated successfully, but these errors were encountered: