Skip to content

Commit 0a8e581

Browse files
committed
Make it clearer when items are being dragged under the finger
UI of the active drag item could still be improved a bit, by adding proper padding, but it's not so important
1 parent 1096f7b commit 0a8e581

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/src/main/java/org/schabi/newpipe/ui/components/menu/LongPressMenuEditor.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package org.schabi.newpipe.ui.components.menu
2121
import android.util.Log
2222
import androidx.annotation.StringRes
2323
import androidx.compose.foundation.BorderStroke
24+
import androidx.compose.foundation.background
2425
import androidx.compose.foundation.border
2526
import androidx.compose.foundation.gestures.scrollBy
2627
import androidx.compose.foundation.layout.BoxWithConstraints
@@ -431,16 +432,21 @@ fun LongPressMenuEditor(modifier: Modifier = Modifier) {
431432
}
432433
}
433434
if (activeDragItem != null) {
435+
// draw it the same size as the selected item,
434436
val size = with(LocalDensity.current) {
435-
remember(activeDragSize) { activeDragSize.toSize().toDpSize() }
437+
remember(activeDragSize) { (activeDragSize.toSize() * 1.3f).toDpSize() }
436438
}
437439
ItemInListUi(
438440
item = activeDragItem!!,
439441
selected = false,
440442
modifier = Modifier
441443
.size(size)
442444
.offset { activeDragPosition }
443-
.offset(-size.width / 2, -size.height / 2),
445+
.offset(-size.width / 2, -size.height / 2)
446+
.background(
447+
color = MaterialTheme.colorScheme.surfaceContainerHighest,
448+
shape = MaterialTheme.shapes.large,
449+
),
444450
)
445451
}
446452
}

0 commit comments

Comments
 (0)