Skip to content

Commit 9dcf3f4

Browse files
updated sdks versions
1 parent 2305303 commit 9dcf3f4

File tree

9 files changed

+23
-25
lines changed

9 files changed

+23
-25
lines changed

.idea/gradle.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

AutoFitTextViewLibrary/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ apply plugin: 'com.android.library'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion "23.0.1"
5+
buildToolsVersion "23.0.3"
66

77
defaultConfig {
8-
minSdkVersion 15
8+
minSdkVersion 9
99
targetSdkVersion 23
1010
versionCode 1
1111
versionName "1.0"
@@ -31,4 +31,5 @@ android {
3131
}
3232

3333
dependencies {
34+
compile 'com.android.support:appcompat-v7:23.3.0'
3435
}

AutoFitTextViewLibrary/src/com/lb/auto_fit_textview/AutoResizeTextView.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
import android.graphics.RectF;
77
import android.graphics.Typeface;
88
import android.os.Build;
9+
import android.support.v7.widget.AppCompatTextView;
910
import android.text.Layout.Alignment;
1011
import android.text.StaticLayout;
1112
import android.text.TextPaint;
13+
import android.text.method.TransformationMethod;
1214
import android.util.AttributeSet;
1315
import android.util.TypedValue;
14-
import android.widget.TextView;
15-
import android.text.method.TransformationMethod;
1616

1717
/**
1818
* a textView that is able to self-adjust its font size depending on the min and max size of the font, and its own size.<br/>
@@ -21,11 +21,11 @@
2121
* It should work fine with most Android versions, but might have some issues on Android 3.1 - 4.04, as setTextSize will only work for the first time. <br/>
2222
* More info here: https://code.google.com/p/android/issues/detail?id=22493 and here in case you wish to fix it: http://stackoverflow.com/a/21851239/878126
2323
*/
24-
public class AutoResizeTextView extends TextView {
24+
public class AutoResizeTextView extends AppCompatTextView {
2525
private static final int NO_LINE_LIMIT = -1;
2626
private final RectF _availableSpaceRect = new RectF();
2727
private final SizeTester _sizeTester;
28-
private float _maxTextSize,_spacingMult = 1.0f, _spacingAdd = 0.0f, _minTextSize;
28+
private float _maxTextSize, _spacingMult = 1.0f, _spacingAdd = 0.0f, _minTextSize;
2929
private int _widthLimit, _maxLines;
3030
private boolean _initialized = false;
3131
private TextPaint _paint;
@@ -70,10 +70,10 @@ public int onTestSize(final int suggestedSize, final RectF availableSPace) {
7070
final TransformationMethod transformationMethod = getTransformationMethod();
7171
final String text;
7272
if (transformationMethod != null)
73-
text = transformationMethod.getTransformation(getText(), AutoResizeTextView.this).toString();
74-
else
75-
text = getText().toString();
76-
73+
text = transformationMethod.getTransformation(getText(), AutoResizeTextView.this).toString();
74+
else
75+
text = getText().toString();
76+
7777
final boolean singleLine = getMaxLines() == 1;
7878
if (singleLine) {
7979
textRect.bottom = _paint.getFontSpacing();

AutoFitTextViewSample/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 22
5-
buildToolsVersion "23.0.1"
4+
compileSdkVersion 23
5+
buildToolsVersion "23.0.3"
66

77
defaultConfig {
88
applicationId "com.example.autofittextviewsample"

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.3.1'
8+
classpath 'com.android.tools.build:gradle:2.1.0'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sun Dec 07 23:08:08 PST 2014
1+
#Sat Apr 30 14:20:31 IDT 2016
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

0 commit comments

Comments
 (0)