Skip to content

Commit 7f0d1df

Browse files
committed
reduce padding in selection bottom sheet
1 parent e8a50ff commit 7f0d1df

2 files changed

Lines changed: 42 additions & 10 deletions

File tree

app/src/main/java/io/github/sds100/keymapper/groups/GroupRow.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,17 @@ fun GroupRow(
6666
},
6767
overflow = FlowRowOverflow.expandOrCollapseIndicator(
6868
expandIndicator = {
69+
// Some padding is required on the end to stop it overflowing the screen.
6970
ViewAllButton(
71+
modifier = Modifier.padding(end = 16.dp),
7072
onClick = { viewAllState = true },
7173
text = stringResource(R.string.home_new_view_all_groups_button),
7274
enabled = enabled,
7375
)
7476
},
7577
collapseIndicator = {
7678
ViewAllButton(
79+
modifier = Modifier.padding(end = 16.dp),
7780
onClick = { viewAllState = false },
7881
text = stringResource(R.string.home_new_hide_groups_button),
7982
enabled = enabled,

app/src/main/java/io/github/sds100/keymapper/home/SelectionBottomSheet.kt

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fun SelectionBottomSheet(
7070
tonalElevation = BottomSheetDefaults.Elevation,
7171
color = BottomSheetDefaults.ContainerColor,
7272
) {
73-
Column(Modifier.padding(16.dp)) {
73+
Column {
7474
Row(
7575
modifier = Modifier
7676
.height(intrinsicSize = IntrinsicSize.Min),
@@ -80,6 +80,8 @@ fun SelectionBottomSheet(
8080
.weight(1f)
8181
.horizontalScroll(state = rememberScrollState()),
8282
) {
83+
Spacer(Modifier.width(16.dp))
84+
8385
SelectionButton(
8486
text = stringResource(R.string.home_multi_select_duplicate),
8587
icon = Icons.Rounded.ContentCopy,
@@ -100,17 +102,18 @@ fun SelectionBottomSheet(
100102
enabled = enabled,
101103
onClick = onExportClick,
102104
)
105+
106+
Spacer(Modifier.width(16.dp))
103107
}
104108

105109
VerticalDivider(
106-
modifier = Modifier.padding(
107-
vertical = 8.dp,
108-
horizontal = 16.dp,
109-
),
110+
modifier = Modifier.padding(vertical = 8.dp),
110111
)
111112

112113
KeyMapsEnabledSwitch(
113-
modifier = Modifier.width(IntrinsicSize.Max),
114+
modifier = Modifier
115+
.padding(horizontal = 16.dp)
116+
.width(IntrinsicSize.Max),
114117
state = selectedKeyMapsEnabled,
115118
enabled = enabled,
116119
onCheckedChange = onEnabledKeyMapsChange,
@@ -124,14 +127,15 @@ fun SelectionBottomSheet(
124127
Spacer(modifier = Modifier.height(8.dp))
125128

126129
Text(
127-
stringResource(R.string.home_move_to_group),
130+
modifier = Modifier.padding(horizontal = 16.dp),
131+
text = stringResource(R.string.home_move_to_group),
128132
style = MaterialTheme.typography.labelLarge,
129133
)
130134

131-
Spacer(modifier = Modifier.height(16.dp))
132-
133135
GroupRow(
134-
modifier = Modifier.fillMaxWidth(),
136+
modifier = Modifier
137+
.padding(horizontal = 16.dp, vertical = 4.dp)
138+
.fillMaxWidth(),
135139
groups = groups,
136140
onNewGroupClick = onNewGroupClick,
137141
onGroupClick = onMoveToGroupClick,
@@ -254,6 +258,31 @@ private fun PreviewGroups() {
254258
name = "Key Mapper",
255259
icon = null,
256260
),
261+
GroupListItemModel(
262+
uid = "3",
263+
name = "Key Mapper",
264+
icon = null,
265+
),
266+
GroupListItemModel(
267+
uid = "3",
268+
name = "Key Mapper",
269+
icon = null,
270+
),
271+
GroupListItemModel(
272+
uid = "3",
273+
name = "Key Mapper",
274+
icon = null,
275+
),
276+
GroupListItemModel(
277+
uid = "3",
278+
name = "Key Mapper",
279+
icon = null,
280+
),
281+
GroupListItemModel(
282+
uid = "3",
283+
name = "Key Mapper",
284+
icon = null,
285+
),
257286
),
258287
selectedKeyMapsEnabled = SelectedKeyMapsEnabled.ALL,
259288
onDuplicateClick = {},

0 commit comments

Comments
 (0)