Skip to content

Commit 93f4021

Browse files
committed
#2027 make the sorting bottom sheet clearer to use
1 parent 0a29daa commit 93f4021

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
## [4.0.4](https://github.com/sds100/KeyMapper/releases/tag/v4.0.4)
22

3-
#### 11 February 2026
3+
#### TO BE RELEASED
44

55
## Added
66

77
- #2024 support Expert mode on all Android versions supported by Key Mapper (8.0+).
88
- #2025 add report bug button to home screen menu.
9+
- #2027 Make the key map sorting feature easier to understand.
910

1011
## Fixed
12+
1113
- #2030 do not filter out unknown evdev key events.
1214

1315
## [4.0.3](https://github.com/sds100/KeyMapper/releases/tag/v4.0.3)

base/src/main/java/io/github/sds100/keymapper/base/sorting/SortBottomSheetContent.kt

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import androidx.compose.material.icons.Icons
3333
import androidx.compose.material.icons.rounded.ArrowDownward
3434
import androidx.compose.material.icons.rounded.ArrowUpward
3535
import androidx.compose.material.icons.rounded.DragHandle
36+
import androidx.compose.material.icons.rounded.HorizontalRule
3637
import androidx.compose.material3.Button
3738
import androidx.compose.material3.ButtonDefaults
3839
import androidx.compose.material3.Card
@@ -62,14 +63,14 @@ import androidx.compose.ui.geometry.Offset
6263
import androidx.compose.ui.layout.onSizeChanged
6364
import androidx.compose.ui.res.painterResource
6465
import androidx.compose.ui.res.stringResource
65-
import androidx.compose.ui.text.font.FontWeight
6666
import androidx.compose.ui.text.style.TextAlign
6767
import androidx.compose.ui.tooling.preview.Preview
6868
import androidx.compose.ui.unit.IntOffset
6969
import androidx.compose.ui.unit.dp
7070
import androidx.lifecycle.compose.collectAsStateWithLifecycle
7171
import io.github.sds100.keymapper.base.R
7272
import io.github.sds100.keymapper.base.compose.KeyMapperTheme
73+
import io.github.sds100.keymapper.base.compose.LocalCustomColorsPalette
7374
import io.github.sds100.keymapper.base.utils.ui.compose.DraggableItem
7475
import io.github.sds100.keymapper.base.utils.ui.compose.rememberDragDropState
7576
import kotlinx.coroutines.CoroutineScope
@@ -368,7 +369,11 @@ private fun SortFieldListItem(
368369
Text(
369370
text = sortFieldText(sortField),
370371
style = if (sortOrder == SortOrder.NONE) {
371-
MaterialTheme.typography.titleMedium.copy(fontWeight = FontWeight.Normal)
372+
MaterialTheme.typography.bodyLarge.copy(
373+
color = MaterialTheme.colorScheme.onSurface.copy(
374+
alpha = 0.5f,
375+
),
376+
)
372377
} else {
373378
MaterialTheme.typography.titleMedium
374379
},
@@ -389,20 +394,23 @@ private fun SortFieldListItem(
389394
},
390395
label = "$sortField Sort Order",
391396
) { sortOrder ->
392-
if (sortOrder == SortOrder.NONE) {
393-
Spacer(Modifier.size(24.dp))
394-
return@AnimatedContent
395-
}
396-
397397
val imageVector = when (sortOrder) {
398-
SortOrder.NONE -> return@AnimatedContent
398+
SortOrder.NONE -> Icons.Rounded.HorizontalRule
399399
SortOrder.ASCENDING -> Icons.Rounded.ArrowUpward
400400
SortOrder.DESCENDING -> Icons.Rounded.ArrowDownward
401401
}
402+
val tint = when (sortOrder) {
403+
SortOrder.NONE -> LocalCustomColorsPalette.current.red
404+
405+
SortOrder.ASCENDING,
406+
SortOrder.DESCENDING,
407+
-> LocalCustomColorsPalette.current.green
408+
}
402409

403410
Icon(
404411
imageVector = imageVector,
405412
contentDescription = null,
413+
tint = tint,
406414
)
407415
}
408416
}

base/src/main/res/values/strings.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@
482482
<string name="dialog_message_fix_dnd_trigger_error">You will be taken to your device\'s settings page to manage which apps can modify the Do Not Disturb state. This is <b>not present on some devices</b> so tap don\'t show again if you do not see Key Mapper in the list.</string>
483483

484484
<string name="dialog_message_sort_sort_by">Sort by</string>
485-
<string name="sorting_drag_and_drop_list_help">Drag the handles to adjust priorities. The item at the top is the most important. You can also tap any item to reverse its sort order.</string>
486-
<string name="sorting_drag_and_drop_list_help_example">Example: To sort key maps primarily by their Actions in ascending order and secondarily by their Triggers in descending order, move Actions to the first position and Triggers to the second.</string>
485+
<string name="sorting_drag_and_drop_list_help">Drag the handles to adjust priorities. The item at the top is the most important. You must tap the item to enable sorting and toggle ascending/descending.</string>
486+
<string name="sorting_drag_and_drop_list_help_example">Example: To sort by Actions (ascending) first and Triggers (descending) second: tap and drag Actions to the first position and set it to ascending, then tap and drag Triggers to the second position and set it to descending.</string>
487487
<string name="drag_handle_for">Drag handle for %1$s</string>
488488
<string name="show_example">Show example</string>
489489

0 commit comments

Comments
 (0)