@@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.Box
8
8
import androidx.compose.foundation.layout.Column
9
9
import androidx.compose.foundation.layout.RowScope
10
10
import androidx.compose.foundation.layout.Spacer
11
- import androidx.compose.foundation.layout.defaultMinSize
12
11
import androidx.compose.foundation.layout.fillMaxHeight
13
12
import androidx.compose.foundation.layout.fillMaxSize
14
13
import androidx.compose.foundation.layout.fillMaxWidth
@@ -27,6 +26,7 @@ import androidx.compose.material3.MaterialTheme
27
26
import androidx.compose.material3.OutlinedButton
28
27
import androidx.compose.material3.Surface
29
28
import androidx.compose.material3.Text
29
+ import androidx.compose.material3.TextButton
30
30
import androidx.compose.runtime.Composable
31
31
import androidx.compose.runtime.DisposableEffect
32
32
import androidx.compose.runtime.remember
@@ -211,7 +211,7 @@ fun ActionsEditor(header: @Composable () -> Unit) {
211
211
}
212
212
}
213
213
is ActionEditorItem .Separator -> {
214
- ReorderableItem (reorderableLazyListState, key = it.toKey(), enabled = it.category != ActionCategory .entries[0 ]) { _ ->
214
+ ReorderableItem (reorderableLazyListState, modifier = Modifier .fillMaxWidth(), key = it.toKey(), enabled = it.category != ActionCategory .entries[0 ]) { _ ->
215
215
Column {
216
216
if (it.category == ActionCategory .entries[0 ]) {
217
217
header()
@@ -223,6 +223,24 @@ fun ActionsEditor(header: @Composable () -> Unit) {
223
223
}
224
224
}
225
225
Text (it.category.name(context), modifier = Modifier .padding(top = 24 .dp), style = CategoryTitleStyle , color = LocalContentColor .current.copy(alpha = 0.6f ))
226
+
227
+ if (actionMap[it.category]?.isEmpty() == true && it.category != ActionCategory .entries.last()) {
228
+ TextButton (onClick = {
229
+ val selfIdx = list.indexOf(it)
230
+ val itemToMove = list.subList(
231
+ selfIdx,
232
+ list.size
233
+ ).firstOrNull { v -> v is ActionEditorItem .Item }
234
+
235
+ if (itemToMove != null ) {
236
+ val idx = list.indexOf(itemToMove)
237
+
238
+ list.add(selfIdx + 1 , list.removeAt(idx))
239
+ }
240
+ }) {
241
+ Text (" Add next" )
242
+ }
243
+ }
226
244
}
227
245
}
228
246
}
0 commit comments