Package 

Class LayoutUtils

    • Method Detail

      • getOrientation

         static int getOrientation(RecyclerView recyclerView)

        Finds the layout orientation of the RecyclerView, no matter which LayoutManager is in use.

        Parameters:
        recyclerView - the RecyclerView with LayoutManager instance in use
      • getSpanCount

         static int getSpanCount(RecyclerView recyclerView)

        Helper method to retrieve the number of the columns (span count) of the given LayoutManager.

        All Layouts are supported.

        Parameters:
        recyclerView - the RecyclerView with LayoutManager instance in use
      • findFirstCompletelyVisibleItemPosition

         static int findFirstCompletelyVisibleItemPosition(RecyclerView recyclerView)

        Helper method to find the adapter position of the first completely visible view[for each span], no matter which Layout is.

        Parameters:
        recyclerView - the RecyclerView with LayoutManager instance in use
      • findFirstVisibleItemPosition

         static int findFirstVisibleItemPosition(RecyclerView recyclerView)

        Helper method to find the adapter position of the first partially visible view[for each span], no matter which Layout is.

        Parameters:
        recyclerView - the RecyclerView with LayoutManager instance in use
      • findLastCompletelyVisibleItemPosition

         static int findLastCompletelyVisibleItemPosition(RecyclerView recyclerView)

        Helper method to find the adapter position of the last completely visible view[for each span], no matter which Layout is.

        Parameters:
        recyclerView - the RecyclerView with LayoutManager instance in use
      • findLastVisibleItemPosition

         static int findLastVisibleItemPosition(RecyclerView recyclerView)

        Helper method to find the adapter position of the last partially visible view[for each span], no matter which Layout is.

        Parameters:
        recyclerView - the RecyclerView with LayoutManager instance in use