Package com.castlabs.android.utils
Class ViewScanner
- java.lang.Object
-
- com.castlabs.android.utils.ViewScanner
-
public class ViewScanner extends Object
Utility class to scan views in a ViewGroup- Since:
- 4.2.2
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Collection<Pair<Integer,View>>
scanComponentView(ViewGroup container, int viewId, Class viewClass)
Scans the given ViewGroup to find aView
with the provided id.
-
-
-
Method Detail
-
scanComponentView
public static Collection<Pair<Integer,View>> scanComponentView(@NonNull ViewGroup container, @IdRes int viewId, @NonNull Class viewClass)
Scans the given ViewGroup to find aView
with the provided id. Such View must be of the indicated Class. Otherwise aIllegalArgumentException
will be thrown.- Parameters:
container
- the container where to look for the ViewviewId
- the id the to-be-found View hasviewClass
- theClass
of the View to find- Returns:
- a
Collection
containing the View, or an empty one if not found.
-
-