diff options
author | Scott Jackson <daneren2005@gmail.com> | 2016-08-22 15:43:34 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2016-08-22 15:43:34 -0700 |
commit | 1c72aa2607fa23f4a2b7253825ec88468afe1141 (patch) | |
tree | 1a14c54e8f7c8ddf006f32f01a44c8938069d583 /app/src/main | |
parent | 2a5a8314dc373788f5f596c835b0e5ccb06818af (diff) | |
download | dsub-1c72aa2607fa23f4a2b7253825ec88468afe1141.tar.gz dsub-1c72aa2607fa23f4a2b7253825ec88468afe1141.tar.bz2 dsub-1c72aa2607fa23f4a2b7253825ec88468afe1141.zip |
Fixes #709: Fix spacing on grids with starting header
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java b/app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java index a33746c4..45b34b9f 100644 --- a/app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java +++ b/app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java @@ -78,7 +78,7 @@ public class GridSpacingDecoration extends RecyclerView.ItemDecoration { outRect.left = halfSpacing - margins; outRect.right = halfSpacing - margins; - if (isTopEdge(childIndex, spanCount)) { + if (isTopEdge(childIndex, spanIndex, spanCount)) { outRect.top = spacing - doubleMargins; } @@ -123,8 +123,8 @@ public class GridSpacingDecoration extends RecyclerView.ItemDecoration { return spanIndex == spanCount - 1; } - protected boolean isTopEdge(int childIndex, int spanCount) { - return childIndex < spanCount; + protected boolean isTopEdge(int childIndex, int spanIndex, int spanCount) { + return childIndex < spanCount && childIndex == spanIndex; } protected boolean isBottomEdge(int childIndex, int childCount, int spanCount) { |