Created
February 15, 2019 11:49
-
-
Save shihabmi7/e0f956de59571a5c04838ed37e4b190b to your computer and use it in GitHub Desktop.
Recyclerview Item Decoration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyDividerItemDecoration extends RecyclerView.ItemDecoration { | |
private static final int[] ATTRS = new int[]{ | |
android.R.attr.listDivider | |
}; | |
public static final int HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL; | |
public static final int VERTICAL_LIST = LinearLayoutManager.VERTICAL; | |
private Drawable mDivider; | |
private int mOrientation; | |
private Context context; | |
private |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
recycler_service_sub_category.setLayoutManager(new LinearLayoutManager(this));
recycler_service_sub_category.setItemAnimator(new DefaultItemAnimator());
recycler_service_sub_category.addItemDecoration(new MyDividerItemDecoration(this,
DividerItemDecoration.VERTICAL, 36));