English 中文
Step1: Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}Step2: Add the dependency
dependencies {
implementation 'tech.qingge:AutoScaleTextView:1.3'
}Step3: Use in xml
<tech.qingge.lib.astv.AutoScaleTextView android:layout_width="200dp" android:layout_height="wrap_content" android:text="Width200dp: This is a test text" app:maxTextSize="24dp" app:minTextSize="12dp" />