From 916fe403810a3a7e2431aa3e7a7bce215b7d55f7 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 13 Mar 2025 10:36:45 +0100 Subject: [PATCH] Fix a crash with threads and decorations --- .../fedilab/android/mastodon/helper/DividerDecoration.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/mastodon/helper/DividerDecoration.java b/app/src/main/java/app/fedilab/android/mastodon/helper/DividerDecoration.java index 4d7d0df2..0f2a89a5 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/helper/DividerDecoration.java +++ b/app/src/main/java/app/fedilab/android/mastodon/helper/DividerDecoration.java @@ -107,12 +107,7 @@ public class DividerDecoration extends RecyclerView.ItemDecoration { startPx = c.getWidth() - startPx; float bottomPx = view.getBottom(); - int color; - if (j >= colorList.size()) { - color = colorList.get(j - colorList.size()); - } else { - color = colorList.get(j); - } + int color = colorList.get(j%(colorList.size()-1)); paint.setColor(ResourcesCompat.getColor(_mContext.getResources(), color, _mContext.getTheme())); if (j == indentationMax - 1) { paint.setPathEffect(new DashPathEffect(