I don't use primary color and don't apply radius f...
# compose
c
I don't use primary color and don't apply radius for the primary color area. How can I remove the primary color and the radius here?
Copy code
Button(
            onClick = {
                isPressed = !isPressed
                onNotifyButtonState.invoke(index, isPressed)
            },
            modifier = if (isPressed) {
                modifier
                    .clip(RoundedCornerShape(10.dp))
                    .background(buttonColor)
                    .border(1.dp, PressedButtonStroke, buttonShape)
            } else {
                modifier
                    .clip(buttonShape)
                    .background(buttonColor)
            }
        )
I think it's related to theme but I don't know where I can fix it.
o
Button
has dedicated arguments for shape, color and border, which should be use to adjust it’s style:
Copy code
Button(
    shape = if (isPressed) RoundedCornerShape(10.dp) else buttonShape,
    border = if (isPressed) BorderStroke(1.dp, PressedButtonStroke) else null,
    colors = ButtonDefaults.buttonColors(buttonColor),
    onClick = { ... }
) {   
   ...
}
Or you can adjust them in the material theme if you want to apply it across all your elements. Check https://developer.android.com/jetpack/compose/designsystems/material Also try to put long code snippets & screenshots in the thread, see https://kotlinlang.slack.com/archives/CJLTWPH7S/p1616265877303000
c
I solved this thank you!