0

This is not a duplicate of Modify ripple color of IconButton in Jetpack Compose This question was diverted in a different way...

I am trying to change the IconButton ripple colour as follows

IconButton(

        modifier = modifier
            .indication(
                interactionSource = remember { MutableInteractionSource() },
                indication = rememberRipple(
                    bounded = false,
                    radius = 30.dp,
                    color = colorResource(id = R.color.error_red)
                )
            )
            .background(colorResource(id = R.color.white), shape = CircleShape),
        onClick = { onButtonPressed() }
    ) {
        Icon(
            painter = painterResource(R.drawable.ic_busy_small_busy),
            contentDescription = buttonContentDesc,
        )
    }

The ripple colour does not change. It stays dark Grey. Also, Is there a way to change the alpha of the ripple??

Nik
  • 2,913
  • 7
  • 40
  • 66
  • The question is the same and also the [answer](https://stackoverflow.com/a/67266346/2016562): your code doesn't work since the Ripple is implemented in a `.clickable` modifier defined inside the `IconButton`. – Gabriele Mariotti Jul 19 '22 at 16:34
  • Thank you @GabrieleMariotti The answer helped me in some way. Now that the colour is changing and I can control the Alpha, the radius cannot be changed as I am no more using ```indication = rememberRipple( bounded = false, radius = 30.dp, color = colorResource(id = R.color.error_red) )``` Any idea how to that when using the ripple theme – Nik Jul 25 '22 at 10:28

0 Answers0