From 60ccf5cf0a765751265fa58d5a84fe62d477d5c2 Mon Sep 17 00:00:00 2001 From: sk Date: Sun, 4 Jun 2023 04:15:15 +0200 Subject: [PATCH] only shift selection box if footer is present --- .../android/fragments/BaseStatusListFragment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java index 1af939d60..96480351e 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java @@ -34,6 +34,7 @@ import org.joinmastodon.android.model.Relationship; import org.joinmastodon.android.model.Status; import org.joinmastodon.android.ui.BetterItemAnimator; import org.joinmastodon.android.ui.displayitems.ExtendedFooterStatusDisplayItem; +import org.joinmastodon.android.ui.displayitems.FooterStatusDisplayItem; import org.joinmastodon.android.ui.displayitems.GapStatusDisplayItem; import org.joinmastodon.android.ui.displayitems.HeaderStatusDisplayItem; import org.joinmastodon.android.ui.displayitems.MediaGridStatusDisplayItem; @@ -384,7 +385,9 @@ public abstract class BaseStatusListFragment exten } // shifting the selection box down // see also: FooterStatusDisplayItem#onBind (setMargins) - if (isWarning || firstIndex < 0 || lastIndex < 0) return; + if (isWarning || firstIndex < 0 || lastIndex < 0 || + !(list.getChildViewHolder(list.getChildAt(lastIndex)) + instanceof FooterStatusDisplayItem.Holder)) return; int prevIndex = firstIndex - 1, nextIndex = lastIndex + 1; boolean prevIsWarning = prevIndex > 0 && prevIndex < list.getChildCount() && list.getChildViewHolder(list.getChildAt(prevIndex))