Package com.castlabs.android.utils
Class ViewScanner
java.lang.Object
com.castlabs.android.utils.ViewScanner
Utility class to scan views in a ViewGroup
- Since:
- 4.2.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Pair<Integer, View>> scanComponentView(ViewGroup container, int viewId, Class viewClass) Scans the given ViewGroup to find aViewwith the provided id.
-
Method Details
-
scanComponentView
public static Collection<Pair<Integer,View>> scanComponentView(@NonNull ViewGroup container, @IdRes int viewId, @NonNull Class viewClass) Scans the given ViewGroup to find aViewwith the provided id. Such View must be of the indicated Class. Otherwise aIllegalArgumentExceptionwill be thrown.- Parameters:
container- the container where to look for the ViewviewId- the id the to-be-found View hasviewClass- theClassof the View to find- Returns:
- a
Collectioncontaining the View, or an empty one if not found.
-