Material Divider Item Decoration
MaterialDividerItemDecoration is a RecyclerView.ItemDecoration, similar to a , that can be used as a divider between items of a LinearLayoutManager. It supports both HORIZONTAL and VERTICAL orientations.
dividerItemDecoration = new MaterialDividerItemDecoration(recyclerView.getContext(),
layoutManager.getOrientation());
recyclerView.addItemDecoration(dividerItemDecoration);
Content copied to clipboard
For more information, see the component developer guidance and design guidelines.
Functions
Link copied to clipboard
Returns the divider color.
Link copied to clipboard
Returns the divider's end inset.
Link copied to clipboard
Returns the divider's start inset.
Link copied to clipboard
Returns the thickness set on the divider.
Link copied to clipboard
open fun getItemOffsets(@NonNull outRect: Rect, @NonNull view: View, @NonNull parent: RecyclerView, @NonNull state: RecyclerView.State)
Link copied to clipboard
Whether there's a divider after the last item of a RecyclerView.
Link copied to clipboard
open fun onDraw(@NonNull canvas: Canvas, @NonNull parent: RecyclerView, @NonNull state: RecyclerView.State)
Link copied to clipboard
Sets the color of the divider.
Link copied to clipboard
Sets the color of the divider.
Link copied to clipboard
Sets the end inset of the divider.
Link copied to clipboard
Sets the end inset of the divider.
Link copied to clipboard
Sets the start inset of the divider.
Link copied to clipboard
Sets the start inset of the divider.
Link copied to clipboard
Sets the thickness of the divider.
Link copied to clipboard
Sets the thickness of the divider.
Link copied to clipboard
Sets whether the class should draw a divider after the last item of a RecyclerView.