AutoFitTextView icon indicating copy to clipboard operation
AutoFitTextView copied to clipboard

Allow the text to grow to fit the space imposed by its parent

Open Klox opened this issue 3 years ago • 2 comments

If the view's dimensions grow, the text size did not grow because AutoFitTextView was using its existing dimensions as a maximum size. Now it retains the maximum dimensions set by its parent during the measure pass.

A sample activity is included to show the AutoFitTextView adjusting to the size constraints imposed by its parent. Without the above change, the text size would shrink but never grow.

While testing, I noticed that setting the text size to X would result in an actual text size of X-1 if there were no size constraints, so I fixed binarySearch.

Klox avatar Feb 08 '22 00:02 Klox

I can't see the sample. Please show before&after the change (meaning 2 samples and 2 screenshots/videos), to make it clear what was fixed.

AndroidDeveloperLB avatar Feb 09 '22 09:02 AndroidDeveloperLB

Why can't you see the sample? What have you tried? If you run the sample activity with your existing library you will see the text size shrink and never grow. The library with my change will grow as the view's size increases.

Klox avatar Feb 09 '22 22:02 Klox