PendingIntentActionSample
@Sampled
@Preview
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
@Composable
fun PendingIntentActionSample() {
val launchAction = rememberPendingIntentAction { context ->
val intent = Intent(Intent.ACTION_MAIN).setPackage(context.packageName)
PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE)
}
RemoteBox(
modifier =
RemoteModifier.clip(RemoteRoundedCornerShape(12.rdp))
.background(Color(0xFF1E88E5).rc)
.clickable(launchAction)
.padding(16.rdp),
contentAlignment = RemoteAlignment.Center,
) {
RemoteText(text = "Open App".rs, color = Color.White.rc)
}
}