aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java4
1 files changed, 4 insertions, 0 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 3bb3e8a1..2d7f4c44 100644
--- a/app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java
+++ b/app/src/main/java/github/daneren2005/dsub/view/GridSpacingDecoration.java
@@ -32,6 +32,10 @@ public class GridSpacingDecoration extends RecyclerView.ItemDecoration {
int childCount = parent.getChildCount();
int childIndex = parent.getChildPosition(view);
+ // Not an actual child (ie: during delete event)
+ if(childIndex == -1) {
+ return;
+ }
int spanCount = getTotalSpan(view, parent);
int spanIndex = childIndex % spanCount;
int spanSize = getSpanSize(parent, childIndex);