Skip to content

Bug: very slow , truncates text and puts characters on next line #6

@AndroidDeveloperLB

Description

@AndroidDeveloperLB

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 :

device-2016-02-09-162003

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 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions