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 Details

    • scanComponentView

      public static Collection<Pair<Integer,View>> scanComponentView(@NonNull ViewGroup container, @IdRes int viewId, @NonNull Class viewClass)
      Scans the given ViewGroup to find a View with the provided id. Such View must be of the indicated Class. Otherwise a IllegalArgumentException will be thrown.
      Parameters:
      container - the container where to look for the View
      viewId - the id the to-be-found View has
      viewClass - the Class of the View to find
      Returns:
      a Collection containing the View, or an empty one if not found.