Skip to content

Instantly share code, notes, and snippets.

@shihabmi7
Created February 15, 2019 11:49
Show Gist options
  • Save shihabmi7/e0f956de59571a5c04838ed37e4b190b to your computer and use it in GitHub Desktop.
Save shihabmi7/e0f956de59571a5c04838ed37e4b190b to your computer and use it in GitHub Desktop.
Recyclerview Item Decoration
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
@shihabmi7
Copy link
Author

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));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment