Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 3 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# AutoFitTextView

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.grantland/autofittextview/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/me.grantland/autofittextview)

Fork from grantland/android-autofitexttextview
A TextView that automatically resizes text to fit perfectly within its bounds.

![Example Image](/website/static/autofittextview.gif?raw=true)
Expand All @@ -11,49 +10,11 @@ A TextView that automatically resizes text to fit perfectly within its bounds.

```cson
dependencies {
compile 'me.grantland:autofittextview:0.2.+'
implementation 'com.github.raquezha:android-autofittextview:0.2.2'
}
```

Enable any View extending TextView in code:

```java
AutofitHelper.create(textView);
```

Enable any View extending TextView in XML:

```xml
<me.grantland.widget.AutofitLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
/>
</me.grantland.widget.AutofitLayout>
```

Use the built in Widget in code or XML:
```xml
<RootElement
xmlns:autofit="http://schemas.android.com/apk/res-auto"
...
```

```xml
<me.grantland.widget.AutofitTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:maxLines="2"
android:textSize="40sp"
autofit:minTextSize="16sp"
/>
```

Updated to target version 28

## License

Expand Down
16 changes: 12 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
classpath "com.android.tools.build:gradle:3.2.1"
}
}

ext {
compileSdkVersion = 23
buildToolsVersion = "23.0.3"
compileSdkVersion = 28
buildToolsVersion = "28.0.3"

minSdkVersion = 14
targetSdkVersion = 23
targetSdkVersion = 28
}

allprojects {
repositories {
google()
jcenter()
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
4 changes: 2 additions & 2 deletions library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.grantland.widget"
android:versionCode="1"
android:versionName="1.0" >
android:versionCode="2"
android:versionName="1.2" >
</manifest>
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'

dependencies {
compile project (':library')
implementation project (':library')
}

android {
Expand Down