-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
All I wanted is that it would fit into it boundaries.
Using the next XML will make it very slow and also truncate the text:
<com.omitneedlesscode.sizeadjustingtextview.SizeAdjustingTextView
android:layout_width="180dp"
android:layout_height="203dp"
android:layout_below="@+id/text_input"
android:maxLines="2"
android:text="content text sample"
android:textSize="1000dp"/>
And this is what I got :
plus it was very slow.
note that I've set 1000dp so that it will resize to the max that it can. a better way is to do it in code.
I think it should work this way:
using the current configurations of the TextView, if it failed to fit, try to find a font that will make it fit.
if failed with this, try to add a line (till reaching max lines that were set), and for each iteration there try to fit the font.
For the font checking, I think it should use binary search, instead of decreasing by 1 .
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
