├── .gitignore ├── .idea ├── caches │ └── build_file_checksums.ser ├── codeStyles │ └── Project.xml ├── compiler.xml ├── encodings.xml ├── gradle.xml ├── jarRepositories.xml ├── kotlinc.xml ├── misc.xml ├── modules.xml └── vcs.xml ├── AutoFitTextViewLibrary ├── .classpath ├── .gitignore ├── .project ├── AndroidManifest.xml ├── build.gradle ├── proguard-project.txt ├── project.properties └── src │ └── com │ └── lb │ └── auto_fit_textview │ └── AutoResizeTextView.kt ├── AutoFitTextViewSample ├── .classpath ├── .gitignore ├── .project ├── AndroidManifest.xml ├── build.gradle ├── lint.xml ├── proguard-project.txt ├── project.properties ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── drawable-xxhdpi │ │ └── ic_launcher.png │ ├── layout │ │ ├── activity_main.xml │ │ ├── activity_main2.xml │ │ └── item.xml │ ├── menu │ │ └── main.xml │ ├── values-w820dp │ │ └── dimens.xml │ └── values │ │ ├── dimens.xml │ │ └── strings.xml └── src │ └── com │ └── example │ └── autofittextviewsample │ ├── Main2Activity.kt │ └── MainActivity.kt ├── LICENSE ├── README.md ├── animationPreview.gif ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | /AutoFitTextViewLibrary/gen 2 | /AutoFitTextViewLibrary/bin 3 | /AutoFitTextViewSample/bin 4 | /AutoFitTextViewSample/gen 5 | *.iml 6 | .gradle 7 | /local.properties 8 | /.idea/workspace.xml 9 | /.idea/libraries 10 | .DS_Store 11 | /build 12 | -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidDeveloperLB/AutoFitTextView/fe3caf418d2aab5dc2171ac0cecf59643675adee/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | 34 | 35 | 39 | 40 | 44 | 45 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AutoFitTextViewLibrary/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /AutoFitTextViewLibrary/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /AutoFitTextViewLibrary/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AutoFitTextViewLibrary 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /AutoFitTextViewLibrary/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /AutoFitTextViewLibrary/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion 33 6 | 7 | defaultConfig { 8 | minSdkVersion 14 9 | targetSdkVersion 33 10 | } 11 | 12 | sourceSets { 13 | main { 14 | manifest.srcFile 'AndroidManifest.xml' 15 | java.srcDirs = ['src'] 16 | resources.srcDirs = ['src'] 17 | aidl.srcDirs = ['src'] 18 | renderscript.srcDirs = ['src'] 19 | res.srcDirs = ['res'] 20 | assets.srcDirs = ['assets'] 21 | } 22 | } 23 | 24 | buildTypes { 25 | release { 26 | minifyEnabled false 27 | } 28 | } 29 | compileOptions { 30 | sourceCompatibility JavaVersion.VERSION_11 31 | targetCompatibility JavaVersion.VERSION_11 32 | } 33 | kotlinOptions { 34 | jvmTarget = "11" 35 | } 36 | } 37 | 38 | dependencies { 39 | implementation 'androidx.appcompat:appcompat:1.5.1' 40 | implementation "androidx.core:core-ktx:1.9.0" 41 | } 42 | repositories { 43 | mavenCentral() 44 | } 45 | -------------------------------------------------------------------------------- /AutoFitTextViewLibrary/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /AutoFitTextViewLibrary/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | # Project target. 13 | -------------------------------------------------------------------------------- /AutoFitTextViewLibrary/src/com/lb/auto_fit_textview/AutoResizeTextView.kt: -------------------------------------------------------------------------------- 1 | package com.lb.auto_fit_textview 2 | 3 | import android.annotation.TargetApi 4 | import android.content.Context 5 | import android.content.res.Resources 6 | import android.graphics.RectF 7 | import android.graphics.Typeface 8 | import android.os.Build 9 | import android.text.Layout.Alignment 10 | import android.text.StaticLayout 11 | import android.text.TextPaint 12 | import android.util.AttributeSet 13 | import android.util.TypedValue 14 | import androidx.appcompat.widget.AppCompatTextView 15 | 16 | /** 17 | * a textView that is able to self-adjust its font size depending on the min and max size of the font, and its own size.

18 | * code is heavily based on this StackOverflow thread: 19 | * http://stackoverflow.com/questions/16017165/auto-fit-textview-for-android/21851239#21851239

20 | * It should work fine with most Android versions, but might have some issues on Android 3.1 - 4.04, as setTextSize will only work for the first time.

21 | * More info here: https://code.google.com/p/android/issues/detail?id=22493 and here in case you wish to fix it: http://stackoverflow.com/a/21851239/878126 22 | */ 23 | class AutoResizeTextView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = android.R.attr.textViewStyle) : AppCompatTextView(context, attrs, defStyle) { 24 | private val availableSpaceRect = RectF() 25 | private val sizeTester: SizeTester 26 | private var maxTextSize: Float = 0.toFloat() 27 | private var spacingMult = 1.0f 28 | private var spacingAdd = 0.0f 29 | private var minTextSize: Float = 0.toFloat() 30 | private var widthLimit: Int = 0 31 | private var maxLines: Int = 0 32 | private var initialized = false 33 | private var textPaint: TextPaint 34 | 35 | private interface SizeTester { 36 | /** 37 | * @param suggestedSize Size of text to be tested 38 | * @param availableSpace available space in which text must fit 39 | * @return an integer < 0 if after applying `suggestedSize` to 40 | * text, it takes less space than `availableSpace`, > 0 41 | * otherwise 42 | */ 43 | fun onTestSize(suggestedSize: Int, availableSpace: RectF): Int 44 | } 45 | 46 | 47 | 48 | init { 49 | // using the minimal recommended font size 50 | minTextSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 12f, resources.displayMetrics) 51 | maxTextSize = textSize 52 | textPaint = TextPaint(paint) 53 | if (maxLines == 0) 54 | // no value was assigned during construction 55 | maxLines = NO_LINE_LIMIT 56 | // prepare size tester: 57 | sizeTester = object : SizeTester { 58 | val textRect = RectF() 59 | 60 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) 61 | override fun onTestSize(suggestedSize: Int, availableSpace: RectF): Int { 62 | textPaint.textSize = suggestedSize.toFloat() 63 | val transformationMethod = transformationMethod 64 | val text: String = transformationMethod?.getTransformation(text, this@AutoResizeTextView) 65 | ?.toString() 66 | ?: text.toString() 67 | val singleLine = maxLines == 1 68 | if (singleLine) { 69 | textRect.bottom = textPaint.fontSpacing 70 | textRect.right = textPaint.measureText(text) 71 | } else { 72 | val layout: StaticLayout = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 73 | StaticLayout.Builder.obtain(text, 0, text.length, textPaint, widthLimit).setLineSpacing(spacingAdd, spacingMult).setAlignment(Alignment.ALIGN_NORMAL).setIncludePad(true).build() 74 | } else StaticLayout(text, textPaint, widthLimit, Alignment.ALIGN_NORMAL, spacingMult, spacingAdd, true) 75 | // return early if we have more lines 76 | if (maxLines != NO_LINE_LIMIT && layout.lineCount > maxLines) 77 | return 1 78 | textRect.bottom = layout.height.toFloat() 79 | var maxWidth = -1 80 | val lineCount = layout.lineCount 81 | for (i in 0 until lineCount) { 82 | val end = layout.getLineEnd(i) 83 | if (i < lineCount - 1 && end > 0 && !isValidWordWrap(text[end - 1])) 84 | return 1 85 | if (maxWidth < layout.getLineRight(i) - layout.getLineLeft(i)) 86 | maxWidth = layout.getLineRight(i).toInt() - layout.getLineLeft(i).toInt() 87 | } 88 | //for (int i = 0; i < layout.getLineCount(); i++) 89 | // if (maxWidth < layout.getLineRight(i) - layout.getLineLeft(i)) 90 | // maxWidth = (int) layout.getLineRight(i) - (int) layout.getLineLeft(i); 91 | textRect.right = maxWidth.toFloat() 92 | } 93 | textRect.offsetTo(0f, 0f) 94 | return if (availableSpace.contains(textRect)) -1 else 1 95 | // else, too big 96 | } 97 | } 98 | initialized = true 99 | } 100 | 101 | fun isValidWordWrap(c: Char): Boolean { 102 | return c == ' ' || c == '-' 103 | } 104 | 105 | override fun setAllCaps(allCaps: Boolean) { 106 | super.setAllCaps(allCaps) 107 | adjustTextSize() 108 | } 109 | 110 | override fun setTypeface(tf: Typeface?) { 111 | super.setTypeface(tf) 112 | adjustTextSize() 113 | } 114 | 115 | override fun setTextSize(size: Float) { 116 | maxTextSize = size 117 | adjustTextSize() 118 | } 119 | 120 | override fun setMaxLines(maxLines: Int) { 121 | super.setMaxLines(maxLines) 122 | this.maxLines = maxLines 123 | adjustTextSize() 124 | } 125 | 126 | override fun getMaxLines(): Int { 127 | return maxLines 128 | } 129 | 130 | override fun setSingleLine() { 131 | super.setSingleLine() 132 | maxLines = 1 133 | adjustTextSize() 134 | } 135 | 136 | override fun setSingleLine(singleLine: Boolean) { 137 | super.setSingleLine(singleLine) 138 | maxLines = if (singleLine) 139 | 1 140 | else 141 | NO_LINE_LIMIT 142 | adjustTextSize() 143 | } 144 | 145 | override fun setLines(lines: Int) { 146 | super.setLines(lines) 147 | maxLines = lines 148 | adjustTextSize() 149 | } 150 | 151 | override fun setTextSize(unit: Int, size: Float) { 152 | val c = context 153 | val r: Resources = if (c == null) 154 | Resources.getSystem() 155 | else 156 | c.resources 157 | maxTextSize = TypedValue.applyDimension(unit, size, r.displayMetrics) 158 | adjustTextSize() 159 | } 160 | 161 | override fun setLineSpacing(add: Float, mult: Float) { 162 | super.setLineSpacing(add, mult) 163 | spacingMult = mult 164 | spacingAdd = add 165 | } 166 | 167 | /** 168 | * Set the lower text size limit and invalidate the view 169 | */ 170 | @Suppress("unused") 171 | fun setMinTextSize(minTextSize: Float) { 172 | this.minTextSize = minTextSize 173 | adjustTextSize() 174 | } 175 | 176 | private fun adjustTextSize() { 177 | // This is a workaround for truncated text issue on ListView, as shown here: https://github.com/AndroidDeveloperLB/AutoFitTextView/pull/14 178 | // TODO think of a nicer, elegant solution. 179 | // post(new Runnable() 180 | // { 181 | // @Override 182 | // public void run() 183 | // { 184 | if (!initialized) 185 | return 186 | val startSize = minTextSize.toInt() 187 | val heightLimit = measuredHeight - compoundPaddingBottom - compoundPaddingTop 188 | widthLimit = measuredWidth - compoundPaddingLeft - compoundPaddingRight 189 | if (widthLimit <= 0) 190 | return 191 | textPaint = TextPaint(paint) 192 | availableSpaceRect.right = widthLimit.toFloat() 193 | availableSpaceRect.bottom = heightLimit.toFloat() 194 | superSetTextSize(startSize) 195 | // } 196 | // }); 197 | } 198 | 199 | private fun superSetTextSize(startSize: Int) { 200 | val textSize = binarySearch(startSize, maxTextSize.toInt(), sizeTester, availableSpaceRect) 201 | super.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize.toFloat()) 202 | } 203 | 204 | private fun binarySearch(start: Int, end: Int, sizeTester: SizeTester, availableSpace: RectF): Int { 205 | var lastBest = start 206 | var lo = start 207 | var hi = end - 1 208 | var mid: Int 209 | while (lo <= hi) { 210 | mid = (lo + hi).ushr(1) 211 | val midValCmp = sizeTester.onTestSize(mid, availableSpace) 212 | if (midValCmp < 0) { 213 | lastBest = lo 214 | lo = mid + 1 215 | } else if (midValCmp > 0) { 216 | hi = mid - 1 217 | lastBest = hi 218 | } else 219 | return mid 220 | } 221 | // make sure to return last best 222 | // this is what should always be returned 223 | return lastBest 224 | } 225 | 226 | override fun onTextChanged(text: CharSequence, start: Int, before: Int, after: Int) { 227 | super.onTextChanged(text, start, before, after) 228 | adjustTextSize() 229 | } 230 | 231 | override fun onSizeChanged(width: Int, height: Int, oldwidth: Int, oldheight: Int) { 232 | super.onSizeChanged(width, height, oldwidth, oldheight) 233 | if (width != oldwidth || height != oldheight) 234 | adjustTextSize() 235 | } 236 | 237 | companion object { 238 | private const val NO_LINE_LIMIT = -1 239 | } 240 | } 241 | -------------------------------------------------------------------------------- /AutoFitTextViewSample/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /AutoFitTextViewSample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /AutoFitTextViewSample/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AutoFitTextViewSample 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /AutoFitTextViewSample/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /AutoFitTextViewSample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion 33 6 | 7 | defaultConfig { 8 | applicationId "com.example.autofittextviewsample" 9 | minSdkVersion 17 10 | targetSdkVersion 33 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | 15 | buildTypes { 16 | release { 17 | } 18 | } 19 | 20 | sourceSets { 21 | main { 22 | manifest.srcFile 'AndroidManifest.xml' 23 | java.srcDirs = ['src'] 24 | resources.srcDirs = ['src'] 25 | aidl.srcDirs = ['src'] 26 | renderscript.srcDirs = ['src'] 27 | res.srcDirs = ['res'] 28 | assets.srcDirs = ['assets'] 29 | } 30 | } 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_11 33 | targetCompatibility JavaVersion.VERSION_11 34 | } 35 | kotlinOptions { 36 | jvmTarget = "11" 37 | } 38 | buildFeatures { 39 | viewBinding true 40 | } 41 | } 42 | 43 | dependencies { 44 | implementation fileTree(dir: 'libs', include: ['*.jar']) 45 | implementation 'androidx.appcompat:appcompat:1.5.1' 46 | implementation 'androidx.recyclerview:recyclerview:1.2.1' 47 | implementation project(':AutoFitTextViewLibrary') 48 | implementation 'androidx.core:core-ktx:1.9.0' 49 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' 50 | } 51 | repositories { 52 | mavenCentral() 53 | } 54 | -------------------------------------------------------------------------------- /AutoFitTextViewSample/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /AutoFitTextViewSample/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /AutoFitTextViewSample/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | # Project target. 13 | -------------------------------------------------------------------------------- /AutoFitTextViewSample/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidDeveloperLB/AutoFitTextView/fe3caf418d2aab5dc2171ac0cecf59643675adee/AutoFitTextViewSample/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /AutoFitTextViewSample/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidDeveloperLB/AutoFitTextView/fe3caf418d2aab5dc2171ac0cecf59643675adee/AutoFitTextViewSample/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /AutoFitTextViewSample/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidDeveloperLB/AutoFitTextView/fe3caf418d2aab5dc2171ac0cecf59643675adee/AutoFitTextViewSample/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /AutoFitTextViewSample/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndroidDeveloperLB/AutoFitTextView/fe3caf418d2aab5dc2171ac0cecf59643675adee/AutoFitTextViewSample/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /AutoFitTextViewSample/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 | 13 | 14 |