I have a TextView
that is used in a RemoteView
. But the text in there varies and so sometimes it is simply too long and is partially cut off. I want my text to automatically scale so that it fits into the TextView
. I am using the Support Library, but app:autoSizeTextType="uniform"
won't work in a RemoteView
. Is there another way?
Here's the xml-code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="256dp">
<TextView
android:id="@+id/myTextView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:gravity="center_vertical|center_horizontal"
android:text="Some long text here."
android:textSize="26sp" />
</RelativeLayout>