@@ -230,7 +230,7 @@ public static void setSearchViewOnClickListener(View v, OnClickListener listener
230
230
}
231
231
}
232
232
}
233
-
233
+
234
234
/**
235
235
* get descended views from parent.
236
236
*
@@ -240,19 +240,19 @@ public static void setSearchViewOnClickListener(View v, OnClickListener listener
240
240
* @return
241
241
*/
242
242
public static <T extends View > List <T > getDescendants (ViewGroup parent , Class <T > filter , boolean includeSubClass ) {
243
- List <T > allDescendedView = new ArrayList <T >();
244
-
243
+ List <T > descendedViewList = new ArrayList <T >();
245
244
int childCount = parent .getChildCount ();
246
245
for (int i = 0 ; i < childCount ; i ++) {
247
246
View child = parent .getChildAt (i );
248
247
Class <? extends View > childsClass = child .getClass ();
249
- if (includeSubClass && filter .isAssignableFrom (childsClass ) || !includeSubClass && childsClass == filter ) {
250
- allDescendedView .add (filter .cast (child ));
248
+ if ((includeSubClass && filter .isAssignableFrom (childsClass ))
249
+ || (!includeSubClass && childsClass == filter )) {
250
+ descendedViewList .add (filter .cast (child ));
251
251
}
252
252
if (child instanceof ViewGroup ) {
253
- allDescendedView .addAll (getDescendants ((ViewGroup ) child , filter , includeSubClass ));
253
+ descendedViewList .addAll (getDescendants ((ViewGroup )child , filter , includeSubClass ));
254
254
}
255
255
}
256
- return allDescendedView ;
256
+ return descendedViewList ;
257
257
}
258
258
}
0 commit comments