public class

KeylineDividerItemDecoration

extends RecyclerView.ItemDecoration
java.lang.Object
   ↳ androidx.recyclerview.widget.RecyclerView.ItemDecoration
     ↳ com.sap.cloud.mobile.fiori.object.KeylineDividerItemDecoration

Class Overview

Copy of Android androidx.recyclerview.widget.DividerItemDecoration with key line support. KeylineDividerItemDecoration is a RecyclerView.ItemDecoration that can be used as a divider between items of a LinearLayoutManager. It supports both HORIZONTAL and VERTICAL orientations. When the item is an instance of KeylineProvider and orientation is VERTICAL, getKeylineStart() will be called to determine the divider position.

     mDividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(),
             mLayoutManager.getOrientation());
     recyclerView.addItemDecoration(mDividerItemDecoration);
 

Summary

Constants
int HORIZONTAL
int VERTICAL
Public Constructors
KeylineDividerItemDecoration(Context context, int orientation)
Creates a divider RecyclerView.ItemDecoration that can be used with a LinearLayoutManager.
Public Methods
void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state)
void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state)
void setDrawable(Drawable drawable)
Sets the Drawable for this divider.
void setOrientation(int orientation)
Sets the orientation for this divider.
[Expand]
Inherited Methods
From class androidx.recyclerview.widget.RecyclerView.ItemDecoration
From class java.lang.Object

Constants

public static final int HORIZONTAL

Constant Value: 0 (0x00000000)

public static final int VERTICAL

Constant Value: 1 (0x00000001)

Public Constructors

public KeylineDividerItemDecoration (Context context, int orientation)

Creates a divider RecyclerView.ItemDecoration that can be used with a LinearLayoutManager.

Parameters
context Current context, it will be used to access resources.
orientation Divider orientation. Should be HORIZONTAL or VERTICAL.

Public Methods

public void getItemOffsets (Rect outRect, View view, RecyclerView parent, RecyclerView.State state)

public void onDraw (Canvas c, RecyclerView parent, RecyclerView.State state)

public void setDrawable (Drawable drawable)

Sets the Drawable for this divider.

Parameters
drawable Drawable that should be used as a divider.

public void setOrientation (int orientation)

Sets the orientation for this divider. This should be called if RecyclerView.LayoutManager changes orientation.

Parameters
orientation HORIZONTAL or VERTICAL