I am trying to use textview autosizing. My app needs to support Android 6.0 forward, so I needed to use the Support library because the autosize textview was not added until 8.0. I need to do it programatically. I tried following this answer. Right now my code looks like this:
val label = TextView(context)
label.text = i.label
val value = TextView(context)
value.text = i.valueFormatted
value.textSize = 48f
label.textSize = 36f
TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(value, 1, 48, 1, TypedValue.COMPLEX_UNIT_DIP)
TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(label, 1, 24, 1, TypedValue.COMPLEX_UNIT_DIP)
In newer Android versions it looks like how I want it:
But in old versions it's messed up: