Created
June 18, 2015 18:34
-
-
Save andersonleite/f6aef12b21abc3a625ba to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Created by andersonl on 6/18/15. | |
*/ | |
public class GridDecoration extends RecyclerView.ItemDecoration { | |
private int margin; | |
public GridDecoration(Context context) { | |
margin = context.getResources().getDimensionPixelSize(R.dimen.item_margin); | |
} | |
@Override | |
public void getItemOffsets( | |
Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { | |
outRect.set(margin, margin, margin, margin); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment