I have a textview and the text is loaded dynamically.
<TextView
android:id="@+id/txt_song_title"
style="?attr/txtcolorHightlight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignTop="@id/frlyt_img_cover"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_toLeftOf="@id/img_audio_source_icon"
android:ellipsize="end"
android:fontFamily="@string/roboto_light"
android:maxLines="3"
android:text=""
android:textSize="@dimen/font_36" />
The textview has to show the entire text which is set (10 to 100+)characters. Based on text length, the font size should be changed inorder to fit the entire text. How to calculate num of words in the textview to change font size and display entire text without clipping dynamically?