Created
July 26, 2018 22:06
-
-
Save fcaldarelli/9f6fb10d759a8ba5a93f27bc509de178 to your computer and use it in GitHub Desktop.
RecyclerView Vertical Space 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 VerticalSpaceItemDecoration extends RecyclerView.ItemDecoration { | |
private final int verticalSpaceHeight; | |
public VerticalSpaceItemDecoration(int verticalSpaceHeight) { | |
this.verticalSpaceHeight = verticalSpaceHeight; | |
} | |
@Override | |
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, | |
RecyclerView.State state) { | |
outRect.bottom = verticalSpaceHeight; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment