@@ -28,8 +28,7 @@ public class AutoResizeTextView extends TextView {
2828 private int _widthLimit , _maxLines ;
2929 private boolean _initialized = false ;
3030 private TextPaint _paint ;
31- private boolean _allCaps = false ;
32-
31+
3332 private interface SizeTester {
3433 /**
3534 * @param suggestedSize Size of text to be tested
@@ -69,7 +68,13 @@ public AutoResizeTextView(final Context context, final AttributeSet attrs, final
6968 @ Override
7069 public int onTestSize (final int suggestedSize , final RectF availableSPace ) {
7170 _paint .setTextSize (suggestedSize );
72- final String text = getText ().toString ();
71+ final TransformationMethod transformationMethod = getTransformationMethod ();
72+ final String text ;
73+ if (transformationMethod != null )
74+ text = transformationMethod .getTransformation (getText (), AutoResizeTextView .this ).toString ();
75+ else
76+ text = getText ().toString ();
77+
7378 final boolean singleLine = getMaxLines () == 1 ;
7479 if (singleLine ) {
7580 textRect .bottom = _paint .getFontSpacing ();
@@ -97,18 +102,6 @@ public int onTestSize(final int suggestedSize, final RectF availableSPace) {
97102 _initialized = true ;
98103 }
99104
100- @ Override
101- public void setText (CharSequence text , BufferType type ) {
102- if ( _allCaps ) text = text .toString ().toUpperCase ();
103- super .setText (text , type );
104- }
105-
106- @ Override
107- public void setAllCaps (boolean allCaps ){
108- super .setAllCaps (allCaps );
109- _allCaps = allCaps ;
110- }
111-
112105 @ Override
113106 public void setTypeface (final Typeface tf ) {
114107 super .setTypeface (tf );
0 commit comments