GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — AutoFitTextView/README.md at master · AndroidDeveloperLB/AutoFitTextView

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
46 lines (32 loc) · 1.49 KB
/

README.md

Copy path

File metadata and controls

46 lines (32 loc) · 1.49 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Release

AutoFitTextView

A TextView that automatically fits its font and line count based on its available size and content.

This code is heavily based on this StackOverflow thread.

The sample shows how the library handles various parameters being changed on the TextView: width, height, number of lines allowed, and the content (text) itself. You can play with the various properties to see how the library handles them.

Note: The library is updated to use Kotlin DSL, modern AndroidX libraries, and has a minimum SDK requirement of 21.

Preview

preview animation

Import using Gradle (Kotlin DSL)

Add JitPack to your settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        ...
        maven { url = uri("https://jitpack.io") }
    }
}

Add the dependency to your module build.gradle.kts:

dependencies {
    implementation("com.github.AndroidDeveloperLB:AutoFitTextView:XXX")
}

You can find the recent version here (replace XXX):

https://jitpack.io/#AndroidDeveloperLB/AutoFitTextView

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.