Package 

Class FlexibleLayoutManager

  • All Implemented Interfaces:
    eu.davidea.flexibleadapter.common.IFlexibleLayoutManager

    
    public class FlexibleLayoutManager
     implements IFlexibleLayoutManager
                        

    Internal wrapper class for all conventional LayoutManagers.

    • Method Summary

      Modifier and Type Method Description
      int getOrientation() Finds the layout orientation of the RecyclerView, no matter which LayoutManager is in use.
      int getSpanCount() Helper method to retrieve the number of the columns (span count) of the given LayoutManager.
      int findFirstCompletelyVisibleItemPosition() Helper method to find the adapter position of the first completely visible view[for each span], no matter which Layout is.
      int findFirstVisibleItemPosition() Helper method to find the adapter position of the first partially visible view[for each span], no matter which Layout is.
      int findLastCompletelyVisibleItemPosition() Helper method to find the adapter position of the last completely visible view[for each span], no matter which Layout is.
      int findLastVisibleItemPosition() Helper method to find the adapter position of the last partially visible view[for each span], no matter which Layout is.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FlexibleLayoutManager

        FlexibleLayoutManager(RecyclerView recyclerView)
        Providing RecyclerView is preferable for when the LayoutManager swaps.
        Parameters:
        recyclerView - the RecyclerView with LayoutManager in use
      • FlexibleLayoutManager

        FlexibleLayoutManager(RecyclerView.LayoutManager layoutManager)
        Directly rely on the current instance of LayoutManager.Using this constructor it won't update the internal instance on LayoutManager swapping.
        Parameters:
        layoutManager - the current instance of LayoutManager
    • Method Detail

      • getOrientation

         int getOrientation()

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

      • getSpanCount

         int getSpanCount()

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

        All Layouts are supported.

      • findFirstCompletelyVisibleItemPosition

         int findFirstCompletelyVisibleItemPosition()

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

      • findFirstVisibleItemPosition

         int findFirstVisibleItemPosition()

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

      • findLastCompletelyVisibleItemPosition

         int findLastCompletelyVisibleItemPosition()

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

      • findLastVisibleItemPosition

         int findLastVisibleItemPosition()

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