@@ -50,6 +50,7 @@ public AutoResizeTextView(final Context context, final AttributeSet attrs) {
50
50
51
51
public AutoResizeTextView (final Context context , final AttributeSet attrs , final int defStyle ) {
52
52
super (context , attrs , defStyle );
53
+
53
54
// using the minimal recommended font size
54
55
_minTextSize = TypedValue .applyDimension (TypedValue .COMPLEX_UNIT_SP , 12 , getResources ().getDisplayMetrics ());
55
56
_maxTextSize = getTextSize ();
@@ -65,7 +66,13 @@ public AutoResizeTextView(final Context context, final AttributeSet attrs, final
65
66
@ Override
66
67
public int onTestSize (final int suggestedSize , final RectF availableSPace ) {
67
68
_paint .setTextSize (suggestedSize );
68
- final String text = getText ().toString ();
69
+ final TransformationMethod transformationMethod = getTransformationMethod ();
70
+ final String text ;
71
+ if (transformationMethod != null )
72
+ text = transformationMethod .getTransformation (getText (), AutoResizeTextView .this ).toString ();
73
+ else
74
+ text = getText ().toString ();
75
+
69
76
final boolean singleLine = getMaxLines () == 1 ;
70
77
if (singleLine ) {
71
78
textRect .bottom = _paint .getFontSpacing ();
@@ -93,6 +100,12 @@ public int onTestSize(final int suggestedSize, final RectF availableSPace) {
93
100
_initialized = true ;
94
101
}
95
102
103
+ @ Override
104
+ public void setAllCaps (boolean allCaps ) {
105
+ super .setAllCaps (allCaps );
106
+ adjustTextSize ();
107
+ }
108
+
96
109
@ Override
97
110
public void setTypeface (final Typeface tf ) {
98
111
super .setTypeface (tf );
0 commit comments