I want to show text dynamically in a TextView. The text will come from the server dynamically. This may be a single word or a single line or a paragraph. The text is displaying the view with size as 56sp based on customer requirement.
My issue here is, the application displaying the text in a huge size. In the case of word break at the end of the line, OS is not showing a hyphen("-") automatically in below Marshmallow devices.
eg: Text: "Carryover data now available" It's showing in the UI as
Carryover
data now ava
ilable
I want to show this as
Carryover
data now ava-
ilable.
But this is properly working in Marshmallow or above devices.
TextView property is given below
<TextView
android:id="@+id/tv_primary_headline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:fontFamily="sans-serif-black"
android:lineSpacingExtra="@dimen/promo_primarytext_line_spacing"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/navigation_selection_color"
android:textSize="@dimen/promo_primary_headline_size"
android:textStyle="bold"
android:visibility="visible" />
TextView mTvPrimaryHeadline = (TextView) view.
findViewById(R.id.tv_primary_headline);
this.mTvPrimaryHeadline.setText(Html.fromHtml(title));