ufo22940268/android-justifiedtextview


android justified textview

Download


Step 1. Add the JitPack repository to your build file

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' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.ufo22940268:android-justifiedtextview:'
	}
	dependencies {
		implementation("com.github.ufo22940268:android-justifiedtextview:")
	}
	<dependency>
	    <groupId>com.github.ufo22940268</groupId>
	    <artifactId>android-justifiedtextview</artifactId>
	    <version></version>
	</dependency>

                            
    libraryDependencies += "com.github.ufo22940268" % "android-justifiedtextview" % ""
        
        

                            
    :dependencies [[com.github.ufo22940268/android-justifiedtextview ""]]
        
        

Readme


JustifiedTextView

Implement justified textview base on the native TextView. Let text displays fill the screen width without extra blanks in the end of line.

English

截了个图

Chinese

截了个图

Usage

You can import in build.gradle like this

compile 'me.biubiubiu.justifytext:library:1.1'

If you use maven, add this to pom.xml.

<dependency>
  <groupId>me.biubiubiu.justifytext</groupId>
  <artifactId>library</artifactId>
  <version>1.1</version>
  <type>aar</type>
</dependency>

Then add put this into layout file.

    <me.biubiubiu.justifytext.library.JustifyTextView
        android:id="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        />

demo

directly download

<a href="https://play.google.com/store/apps/details?id=me.biubiubiu.justifytext"> <img alt="Get it on Google Play" src="https://developer.android.com/images/brand/en_generic_rgb_wo_60.png" /> </a>

Change list

  • 1.1 Display ok when using custom font.

MIT License