Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## [4.2.0](https://github.com/sds100/KeyMapper/releases/tag/v4.2.0)

## Fixed

- #2074 Scrolling the action or trigger list no longer accidentally moves items; reordering by drag now only activates from the drag handle or via long-press.

## Changed

- #1369 Add content descriptions to drag handles and custom "Move up"/"Move down" accessibility actions for trigger and action list items, improving TalkBack support for reordering.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ fun ActionListItem(
.heightIn(min = 48.dp)
.height(IntrinsicSize.Min)
.padding(start = 16.dp, end = 16.dp)
.draggable(
state = draggableState,
enabled = isDraggingEnabled,
orientation = Orientation.Vertical,
startDragImmediately = false,
onDragStarted = { offset ->
dragDropState?.onDragStart(index, offset)
},
onDragStopped = { dragDropState?.onDragInterrupted() },
)
.semantics {
if (isReorderingEnabled) {
customActions = buildList {
Expand Down Expand Up @@ -130,7 +120,18 @@ fun ActionListItem(

if (isReorderingEnabled) {
Icon(
modifier = Modifier.size(24.dp),
modifier = Modifier
.size(24.dp)
.draggable(
state = draggableState,
enabled = isDraggingEnabled,
orientation = Orientation.Vertical,
startDragImmediately = true,
onDragStarted = { offset ->
dragDropState?.onDragStart(index, offset)
},
onDragStopped = { dragDropState?.onDragInterrupted() },
),
imageVector = Icons.Rounded.DragHandle,
contentDescription = stringResource(R.string.drag_handle_for, model.text),
tint = MaterialTheme.colorScheme.onSurface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ fun TriggerKeyListItem(
.heightIn(min = 48.dp)
.height(IntrinsicSize.Min)
.padding(start = 16.dp, end = 16.dp)
.draggable(
state = draggableState,
enabled = isDraggingEnabled,
orientation = Orientation.Vertical,
startDragImmediately = false,
onDragStarted = { offset ->
dragDropState?.onDragStart(index, offset)
},
onDragStopped = { dragDropState?.onDragInterrupted() },
)
.semantics {
if (isReorderingEnabled) {
customActions = buildList {
Expand Down Expand Up @@ -130,7 +120,18 @@ fun TriggerKeyListItem(

if (isReorderingEnabled) {
Icon(
modifier = Modifier.size(24.dp),
modifier = Modifier
.size(24.dp)
.draggable(
state = draggableState,
enabled = isDraggingEnabled,
orientation = Orientation.Vertical,
startDragImmediately = true,
onDragStarted = { offset ->
dragDropState?.onDragStart(index, offset)
},
onDragStopped = { dragDropState?.onDragInterrupted() },
),
imageVector = Icons.Rounded.DragHandle,
contentDescription = stringResource(R.string.drag_handle_for, primaryText),
tint = MaterialTheme.colorScheme.onSurface,
Expand Down
Loading