I tried using autoSizeTextType
.
My minSdk is 24, all the tools are 26 and compat ist 26-beta2 as well.
Making them adjustable was tried through code:
dialogWeight.touchables.filterIsInstance<Button>().forEach {
TextViewCompat.setAutoSizeTextTypeWithDefaults(it,
TextViewCompat.AUTO_SIZE_TEXT_TYPE_UNIFORM) }
And xml:
<android.support.v7.widget.AppCompatTextView
android:layout_height="match_parent"
android:text="7"
android:autoSizeTextType="uniform"/>
Any ideas ? I'm starting to believe that it's currently bugged
To use preset sizes to set up the autosizing of TextView in XML, use the android namespace and set the following attributes: Set the autoSizeText attribute to either none or uniform. none is a default value and uniform lets TextView scale uniformly on horizontal and vertical axes.
Go to File -> Settings, a new setting dialogue box will appear. Then go to Editor -> General. Now mark the checkbox Change font size with Ctrl + Mouse wheel and click on Apply button. Now to change your editor font size, you just have to press and hold Ctrl and rotate the Mouse wheel.
AppCompatTextView widget enhanced with emoji capability by using EmojiTextViewHelper . A TextView which supports compatible features on older versions of the platform, including: Allows dynamic tint of its background via the background tint methods in androidx. core.
Okay, so the combination of settings that worked :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.v7.widget.AppCompatTextView
android:text="7"
app:autoSizeTextType="uniform"/>
You also need the appcompat-v7 library as a dependency in your module build.gradle file.
dependencies {
implementation 'com.android.support:appcompat-v7:27.1.1'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With