We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6506d62 commit 81c12acCopy full SHA for 81c12ac
1 file changed
app/src/main/java/org/schabi/newpipe/ui/components/menu/LongPressMenuEditor.kt
@@ -168,9 +168,9 @@ fun LongPressMenuEditor(modifier: Modifier = Modifier) {
168
} else {
169
var i = rawItem.index
170
// make sure it is not possible to move items in between a *Caption and a HeaderBox
171
- val offsetForRemovingPrev = if (prevDragMarkerIndex < rawItem.index) 1 else 0
172
- if (!items[i - offsetForRemovingPrev].isDraggable) i += 1
173
- if (items[i - offsetForRemovingPrev] == ItemInList.HeaderBox) i += 1
+ if (!items[i].isDraggable) i += 1
+ if (i < items.size && items[i] == ItemInList.HeaderBox) i += 1
+ if (i > rawItem.index && prevDragMarkerIndex < rawItem.index) i -= 1
174
i
175
}
176
0 commit comments