Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

AutoScaleTextView is a custom Android TextView that automatically adjusts the font size based on the available width. It ensures optimal text readability without manual adjustments, making it ideal for dynamic UI layouts.

License

Notifications You must be signed in to change notification settings

SssJC123/AutoScaleTextView

Repository files navigation

English 中文

Usage

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" />

Screenshots

About

AutoScaleTextView is a custom Android TextView that automatically adjusts the font size based on the available width. It ensures optimal text readability without manual adjustments, making it ideal for dynamic UI layouts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /