I'm trying to resize the wrapping text in a TextView
to fit within its bounds.
I've created a new class with the source from here and I've added it inside my layout:
<com.util.AutoResizeTextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_alignLeft="@id/ivBulb"
android:layout_marginTop="5dp"
android:layout_marginBottom="80dp"
android:layout_below="@id/ivBulb"
android:layout_marginRight="10dp"
android:id="@+id/textP"
android:ellipsize="none"
android:fontFamily="sans-serif"
android:textColor="#000"
android:textSize="100sp"/> <!--maximum size -->
The text that should be displayed inside the TextView
is something like:
The sunset filled the entire sky with the deep color of rubies, setting the clouds ablaze. The waves crashed and danced along the shore, moving up and down in a graceful and gentle rhythm like they were dancing.
Some texts can be a multiline but some don't.
My problem is that the text font size is small (about 35dp) and it's always the same :(
I've added a ScrollView
in order to be able to display all the text but I want to keep just the TextView
and the text to resize
I'm new in Android development so please be gentle.