@@ -21,7 +21,6 @@ package org.schabi.newpipe.ui.components.menu
2121import android.util.Log
2222import androidx.annotation.StringRes
2323import androidx.compose.foundation.BorderStroke
24- import androidx.compose.foundation.background
2524import androidx.compose.foundation.border
2625import androidx.compose.foundation.gestures.scrollBy
2726import androidx.compose.foundation.layout.BoxWithConstraints
@@ -97,7 +96,20 @@ import kotlin.math.min
9796
9897internal const val TAG = " LongPressMenuEditor"
9998
100- // TODO padding doesn't seem to work as expected when the list becomes scrollable?
99+ /* *
100+ * When making changes to this composable, make sure to test the following use cases still work:
101+ * - both the actions and the header can be dragged around
102+ * - the header can only be dragged to the first position in each section
103+ * - when a section is empty the None marker will appear
104+ * - actions and header are loaded from and stored to settings properly
105+ * - it is possible to move items around using DPAD on Android TVs, and there are no strange bugs
106+ * - when dragging items around, a Drag marker appears at the would-be position of the item being
107+ * dragged, and the item being dragged is "picked up" and shown below the user's finger (at an
108+ * offset to ensure the user can see the thing being dragged under their finger)
109+ * - when the view does not fit the page, it is possible to scroll without moving any item, and
110+ * dragging an item towards the top/bottom of the page scrolls up/down
111+ * @author This composable was originally copied from FlorisBoard.
112+ */
101113@Composable
102114fun LongPressMenuEditor (modifier : Modifier = Modifier ) {
103115 // We get the current arrangement once and do not observe on purpose
@@ -604,9 +616,9 @@ private fun ItemInListUi(
604616 modifier = modifier,
605617 selected = selected,
606618 icon = Icons .Default .ArtTrack ,
607- text = R .string.header ,
619+ text = R .string.long_press_menu_header ,
608620 contentColor = MaterialTheme .colorScheme.onSurfaceVariant,
609- backgroundColor = MaterialTheme .colorScheme.surfaceVariant ,
621+ backgroundColor = MaterialTheme .colorScheme.surfaceContainer ,
610622 horizontalPadding = 12 .dp,
611623 )
612624 }
@@ -633,6 +645,7 @@ private fun ItemInListUi(
633645}
634646
635647@Preview
648+ @Preview(device = " spec:width=1080px,height=1000px,dpi=440" )
636649@Composable
637650private fun LongPressMenuEditorPreview () {
638651 AppTheme {
0 commit comments