Class MarginDecoration


  • public class MarginDecoration
    extends androidx.recyclerview.widget.RecyclerView.ItemDecoration
    The RecyclerView.ItemDecoration class for adding spaces between grid items
    • Constructor Summary

      Constructors 
      Constructor Description
      MarginDecoration​(int margin)
      Simple constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void getItemOffsets​(android.graphics.Rect outRect, android.view.View view, androidx.recyclerview.widget.RecyclerView parent, androidx.recyclerview.widget.RecyclerView.State state)  
      • Methods inherited from class androidx.recyclerview.widget.RecyclerView.ItemDecoration

        getItemOffsets, onDraw, onDraw, onDrawOver, onDrawOver
      • Methods inherited from class java.lang.Object

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

      • MarginDecoration

        public MarginDecoration​(int margin)
        Simple constructor
        Parameters:
        margin - value in pixels
    • Method Detail

      • getItemOffsets

        public void getItemOffsets​(android.graphics.Rect outRect,
                                   android.view.View view,
                                   androidx.recyclerview.widget.RecyclerView parent,
                                   androidx.recyclerview.widget.RecyclerView.State state)
        Overrides:
        getItemOffsets in class androidx.recyclerview.widget.RecyclerView.ItemDecoration