1616
1717package android .graphics .drawable ;
1818
19+ import com .android .internal .R ;
20+
1921import org .xmlpull .v1 .XmlPullParser ;
2022import org .xmlpull .v1 .XmlPullParserException ;
2123
@@ -116,32 +118,27 @@ protected boolean onStateChange(int[] stateSet) {
116118 public void inflate (Resources r , XmlPullParser parser , AttributeSet attrs , Theme theme )
117119 throws XmlPullParserException , IOException {
118120
119- TypedArray a = r .obtainAttributes (attrs ,
120- com .android .internal .R .styleable .StateListDrawable );
121+ final TypedArray a = r .obtainAttributes (attrs , R .styleable .StateListDrawable );
121122
122123 super .inflateWithAttributes (r , parser , a ,
123- com . android . internal . R .styleable .StateListDrawable_visible );
124+ R .styleable .StateListDrawable_visible );
124125
125126 mStateListState .setVariablePadding (a .getBoolean (
126- com . android . internal . R .styleable .StateListDrawable_variablePadding , false ));
127+ R .styleable .StateListDrawable_variablePadding , false ));
127128 mStateListState .setConstantSize (a .getBoolean (
128- com . android . internal . R .styleable .StateListDrawable_constantSize , false ));
129+ R .styleable .StateListDrawable_constantSize , false ));
129130 mStateListState .setEnterFadeDuration (a .getInt (
130- com . android . internal . R .styleable .StateListDrawable_enterFadeDuration , 0 ));
131+ R .styleable .StateListDrawable_enterFadeDuration , 0 ));
131132 mStateListState .setExitFadeDuration (a .getInt (
132- com .android .internal .R .styleable .StateListDrawable_exitFadeDuration , 0 ));
133-
134- setDither (a .getBoolean (com .android .internal .R .styleable .StateListDrawable_dither ,
135- DEFAULT_DITHER ));
133+ R .styleable .StateListDrawable_exitFadeDuration , 0 ));
136134
137- setAutoMirrored (a .getBoolean (
138- com . android . internal . R .styleable .StateListDrawable_autoMirrored , false ));
135+ setDither (a .getBoolean (R . styleable . StateListDrawable_dither , DEFAULT_DITHER ));
136+ setAutoMirrored ( a . getBoolean ( R .styleable .StateListDrawable_autoMirrored , false ));
139137
140138 a .recycle ();
141139
142- int type ;
143-
144140 final int innerDepth = parser .getDepth () + 1 ;
141+ int type ;
145142 int depth ;
146143 while ((type = parser .next ()) != XmlPullParser .END_DOCUMENT
147144 && ((depth = parser .getDepth ()) >= innerDepth
@@ -163,7 +160,7 @@ public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme
163160 for (i = 0 ; i < numAttrs ; i ++) {
164161 final int stateResId = attrs .getAttributeNameResource (i );
165162 if (stateResId == 0 ) break ;
166- if (stateResId == com . android . internal . R .attr .drawable ) {
163+ if (stateResId == R .attr .drawable ) {
167164 drawableRes = attrs .getAttributeResourceValue (i , 0 );
168165 } else {
169166 states [j ++] = attrs .getAttributeBooleanValue (i , false )
@@ -173,9 +170,9 @@ public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme
173170 }
174171 states = StateSet .trimStateSet (states , j );
175172
176- Drawable dr ;
173+ final Drawable dr ;
177174 if (drawableRes != 0 ) {
178- dr = r .getDrawable (drawableRes );
175+ dr = r .getDrawable (drawableRes , theme );
179176 } else {
180177 while ((type = parser .next ()) == XmlPullParser .TEXT ) {
181178 }
0 commit comments