Make it clearer when items are being dragged under the finger

This commit is contained in:
Stypox 2025-12-30 22:37:53 +01:00
parent b9485488f8
commit cf4bfa522e
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -21,6 +21,7 @@ package org.schabi.newpipe.ui.components.menu
import android.util.Log
import androidx.annotation.StringRes
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.gestures.scrollBy
import androidx.compose.foundation.layout.BoxWithConstraints
@ -431,16 +432,18 @@ fun LongPressMenuEditor(modifier: Modifier = Modifier) {
}
}
if (activeDragItem != null) {
// draw it the same size as the selected item,
val size = with(LocalDensity.current) {
remember(activeDragSize) { activeDragSize.toSize().toDpSize() }
}
ItemInListUi(
item = activeDragItem!!,
selected = false,
selected = true,
modifier = Modifier
.size(size)
.offset { activeDragPosition }
.offset(-size.width / 2, -size.height / 2),
.offset(-size.width / 2, -size.height / 2)
.offset((-24).dp, (-24).dp),
)
}
}