Utkarsh Tiwari
03/25/2021, 10:37 AMUtkarsh Tiwari
03/25/2021, 10:38 AM// Comment.kt
fun Comment(
enabled: Boolean = true,
actions: @Composable RowScope.() -> Unit
) {
actions()
}
enum class ActionIcon {
REPORT,
DELETE;
}
ActionIcon(
painter: Painter,
contentDescription: String? = null,
onClick: () -> Unit
) {
Icon(
modifier = Modifier.tint() // Want to control tint color here based on value of `enabled`
)
}
// Screen.kt
Row {
Comment(
enabled = true
) {
ActionIcon(
icon: ActionIcon = ActionIcon.DELETE
contentDescription = "This is delete button"
)
ActionIcon(
icon: ActionIcon = ActionIcon.REPORT
contentDescription = "This is report button"
)
}
}