Skip to content

Commit 9456988

Browse files
change grid number for M3 picker
1 parent 3f0b4f2 commit 9456988

File tree

1 file changed

+3
-31
lines changed
  • colorpicker/src/main/java/com/smarttoolfactory/colorpicker/picker

1 file changed

+3
-31
lines changed

colorpicker/src/main/java/com/smarttoolfactory/colorpicker/picker/M3ColorPicker.kt

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fun M3ColorPicker(onColorChange: (Color) -> Unit) {
112112

113113
// Color Swatch Selection
114114
ColorSelectionGrid(
115-
columns = GridCells.Fixed(8),
115+
columns = GridCells.Fixed(7),
116116
contentPadding = PaddingValues(8.dp),
117117
verticalArrangement = Arrangement.spacedBy(4.dp),
118118
horizontalArrangement = Arrangement.spacedBy(4.dp),
@@ -150,7 +150,7 @@ fun M3ColorPicker(onColorChange: (Color) -> Unit) {
150150
// Primary/Accent Color Selection
151151
ColorSelectionGrid(
152152
modifier = Modifier.fillMaxWidth(if (primaryAccentSelection == 0) 1f else .5f),
153-
columns = GridCells.Fixed(if (primaryAccentSelection == 0) 8 else 4),
153+
columns = GridCells.Fixed(if (primaryAccentSelection == 0) 6 else 4),
154154
contentPadding = PaddingValues(8.dp),
155155
verticalArrangement = Arrangement.spacedBy(4.dp),
156156
horizontalArrangement = Arrangement.spacedBy(4.dp),
@@ -187,7 +187,7 @@ fun M3ColorPicker(onColorChange: (Color) -> Unit) {
187187

188188
// M3 Tone Selection
189189
ColorSelectionGrid(
190-
columns = GridCells.Fixed(8),
190+
columns = GridCells.Fixed(7),
191191
contentPadding = PaddingValues(8.dp),
192192
verticalArrangement = Arrangement.spacedBy(4.dp),
193193
horizontalArrangement = Arrangement.spacedBy(4.dp),
@@ -336,32 +336,4 @@ fun ColorDisplayWithTitle(
336336
}
337337
}
338338

339-
@Composable
340-
fun ColorDisplayWithIcon(
341-
modifier: Modifier,
342-
selected: Boolean,
343-
contentColor: Color = Color.Unspecified,
344-
backgroundColor: Color
345-
) {
346-
Box(
347-
contentAlignment = Alignment.Center
348-
) {
349-
Box(
350-
modifier = modifier
351-
.background(backgroundColor)
352-
)
353-
354-
if (selected) {
355-
Icon(
356-
modifier = modifier
357-
.background(contentColor.copy(alpha = .5f))
358-
.padding(4.dp),
359-
imageVector = Icons.Default.Check,
360-
contentDescription = "check",
361-
tint = Color.Green
362-
)
363-
}
364-
}
365-
}
366-
367339
data class ColorSelectionIndex(var mainSelection: Int = 0, var subSelection: Int = 0)

0 commit comments

Comments
 (0)