Package com.cheetahdigital.uikit.widget
Class DividerItemDecoration
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.ItemDecoration
-
- com.cheetahdigital.uikit.widget.DividerItemDecoration
-
public class DividerItemDecoration extends androidx.recyclerview.widget.RecyclerView.ItemDecorationClass for adding a stylized divider to the RecyclerView.
-
-
Constructor Summary
Constructors Constructor Description DividerItemDecoration(android.content.Context context)DividerItemDecoration(android.content.Context context, int resId)Custom divider will be used
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrawHorizontal(android.graphics.Canvas c, androidx.recyclerview.widget.RecyclerView parent)Draws the decorations following a horizontal orientation.voiddrawVertical(android.graphics.Canvas c, androidx.recyclerview.widget.RecyclerView parent)Draws the decorations following a vertical orientation.voidgetItemOffsets(android.graphics.Rect outRect, android.view.View view, androidx.recyclerview.widget.RecyclerView parent, androidx.recyclerview.widget.RecyclerView.State state)voidonDraw(android.graphics.Canvas c, androidx.recyclerview.widget.RecyclerView parent, androidx.recyclerview.widget.RecyclerView.State state)
-
-
-
Constructor Detail
-
DividerItemDecoration
public DividerItemDecoration(android.content.Context context)
-
DividerItemDecoration
public DividerItemDecoration(android.content.Context context, int resId)Custom divider will be used- Parameters:
context- use to get resource idresId- resource id of the drawable for the dividers
-
-
Method Detail
-
onDraw
public void onDraw(android.graphics.Canvas c, androidx.recyclerview.widget.RecyclerView parent, androidx.recyclerview.widget.RecyclerView.State state)- Overrides:
onDrawin classandroidx.recyclerview.widget.RecyclerView.ItemDecoration
-
getItemOffsets
public void getItemOffsets(android.graphics.Rect outRect, android.view.View view, androidx.recyclerview.widget.RecyclerView parent, androidx.recyclerview.widget.RecyclerView.State state)- Overrides:
getItemOffsetsin classandroidx.recyclerview.widget.RecyclerView.ItemDecoration
-
drawVertical
public void drawVertical(android.graphics.Canvas c, androidx.recyclerview.widget.RecyclerView parent)Draws the decorations following a vertical orientation.- Parameters:
c- Canvas to draw intoparent- RecyclerView this ItemDecoration is drawing into
-
drawHorizontal
public void drawHorizontal(android.graphics.Canvas c, androidx.recyclerview.widget.RecyclerView parent)Draws the decorations following a horizontal orientation.- Parameters:
c- Canvas to draw intoparent- RecyclerView this ItemDecoration is drawing into
-
-