Yingding Wang
01/02/2023, 12:33 PMIconButton
in androidx.wear.compose.material
, just noticed that I shall not use androidx.compose.material
with compose wear. As I wrapped Icon in a Button, it attaches a shadow. How can I get ride of this shadow from the Button
?yschimke
01/02/2023, 12:37 PMYingding Wang
01/02/2023, 12:44 PMYingding Wang
01/02/2023, 12:53 PMandroidx.compose.material.IconButton
doesn’t create a shadow. I can use a chip, to achieve the same result, but as i touch the text of the chip, the click event will also be triggered. I thought, if the text is not clickable, then user can have some screen space to fling the screen.Yingding Wang
01/02/2023, 1:05 PMJohn Nichol
01/03/2023, 11:22 AMJohn Nichol
01/03/2023, 11:22 AMYingding Wang
01/03/2023, 4:06 PMIconButton
, the main issue for me was the implementation of androidx.wear.compose.material.Button
takes the Background color for Box in Button
Composable from the ButtonDefaults.primaryButtonColors()
With the following code, i can make the background of Button
transparent now, which gives the same result as using androidx.compose.material.IconButton
, so i think it is all good now.
Button(
modifier = Modifier,
onClick = onClick,
colors = ButtonDefaults.buttonColors(
backgroundColor = Color.Transparent,
contentColor = MaterialTheme.colors.primary
),
) { Icon( ... ) }
John Nichol
01/03/2023, 4:17 PMButtonDefaults.iconButtonColors()
John Nichol
01/03/2023, 5:14 PMSplitToggleChip
. You can use the base Chip
which just provides you with with shapeYingding Wang
01/03/2023, 5:22 PMSplitToggleChip
more generic, like a SplitChip
with adding toggle or click event on each half?
Thanks for mention SplitToggleChip
, I will try it out to see how i can modify it for my need.John Nichol
01/03/2023, 5:29 PMYingding Wang
01/03/2023, 5:30 PM