AppCard
In Wear Material Compose
Alert
PREVIEW IS NOT AVAILABLE YET
Kotlin
@Composable
fun AlertWithButtons() {
Alert(
icon = {
Icon(
painter = painterResource(id = R.drawable.ic_airplanemode_active_24px),
contentDescription = "airplane",
modifier = Modifier.size(24.dp).wrapContentSize(align = Alignment.Center),
)
},
title = { Text("Title text displayed here", textAlign = TextAlign.Center) },
negativeButton = {
Button(
colors = ButtonDefaults.secondaryButtonColors(),
onClick = {
/* Do something e.g. navController.popBackStack()*/
},
) {
Text("No")
}
},
positiveButton = {
Button(
onClick = {
/* Do something e.g. navController.popBackStack()*/
}
) {
Text("Yes")
}
},
contentPadding = PaddingValues(start = 10.dp, end = 10.dp, top = 24.dp, bottom = 32.dp),
) {
Text(
text = "Body text displayed here " + "(swipe right to dismiss)",
textAlign = TextAlign.Center,
)
}
}