Utkarsh Tiwari
// 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" ) } }
A modern programming language that makes developers happier.