Skip to content

Commit ce834ac

Browse files
some typos fixed
1 parent 9dcf3f4 commit ce834ac

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public AutoResizeTextView(final Context context, final AttributeSet attrs) {
5151

5252
public AutoResizeTextView(final Context context, final AttributeSet attrs, final int defStyle) {
5353
super(context, attrs, defStyle);
54-
5554
// using the minimal recommended font size
5655
_minTextSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 12, getResources().getDisplayMetrics());
5756
_maxTextSize = getTextSize();
@@ -62,18 +61,16 @@ public AutoResizeTextView(final Context context, final AttributeSet attrs, final
6261
// prepare size tester:
6362
_sizeTester = new SizeTester() {
6463
final RectF textRect = new RectF();
65-
6664
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
6765
@Override
68-
public int onTestSize(final int suggestedSize, final RectF availableSPace) {
66+
public int onTestSize(final int suggestedSize, final RectF availableSpace) {
6967
_paint.setTextSize(suggestedSize);
7068
final TransformationMethod transformationMethod = getTransformationMethod();
7169
final String text;
7270
if (transformationMethod != null)
7371
text = transformationMethod.getTransformation(getText(), AutoResizeTextView.this).toString();
7472
else
7573
text = getText().toString();
76-
7774
final boolean singleLine = getMaxLines() == 1;
7875
if (singleLine) {
7976
textRect.bottom = _paint.getFontSpacing();
@@ -91,7 +88,7 @@ public int onTestSize(final int suggestedSize, final RectF availableSPace) {
9188
textRect.right = maxWidth;
9289
}
9390
textRect.offsetTo(0, 0);
94-
if (availableSPace.contains(textRect))
91+
if (availableSpace.contains(textRect))
9592
// may be too small, don't worry we will find the best match
9693
return -1;
9794
// else, too big
@@ -120,9 +117,9 @@ public void setTextSize(final float size) {
120117
}
121118

122119
@Override
123-
public void setMaxLines(final int maxlines) {
124-
super.setMaxLines(maxlines);
125-
_maxLines = maxlines;
120+
public void setMaxLines(final int maxLines) {
121+
super.setMaxLines(maxLines);
122+
_maxLines = maxLines;
126123
adjustTextSize();
127124
}
128125

0 commit comments

Comments
 (0)