This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val builder = NotificationCompat.Builder(this, CHANNEL_ID) | |
.setSmallIcon(R.drawable.ic_launcher_foreground) | |
.setContentTitle("Interactive Notification Title") | |
.setContentText("Interactive Notification Text") | |
.setContentIntent(InteractiveNotificationBroadcastReceiver.newPendingIntent(this)) | |
val soCloseInteractiveNotification = builder.build() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onReceive(context: Context?, intent: Intent?) { | |
context?.let { | |
Log.d("InteractiveNotificationBroadcastReceiver", "onReceive") | |
val notification = NotificationCompat.Builder(context, CHANNEL_ID) | |
.setSmallIcon(R.drawable.ic_launcher_foreground) | |
.setContentTitle("Interactive Notification Title") | |
.setContentText("MODIFIED text") | |
.setContentIntent(newPendingIntent(context)) | |
.build() | |
NotificationManagerCompat.from(context) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun SomeComposable(){ | |
val bottomSheetState = rememberStandardBottomSheetState() | |
val scaffoldState = rememberBottomSheetScaffoldState(bottomSheetState) | |
var currentOffset by remember { mutableFloatStateOf(0f) } | |
runCatching { | |
LaunchedEffect(bottomSheetState.requireOffset()) { | |
snapshotFlow { bottomSheetState.requireOffset() } | |
.collect { currentOffset = it } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val bottomSheetState = rememberStandardBottomSheetState() | |
val scaffoldState = rememberBottomSheetScaffoldState(bottomSheetState) | |
BottomSheetScaffold( | |
modifier = Modifier.fillMaxSize(), | |
scaffoldState = scaffoldState, | |
sheetContainerColor = Color.Transparent, | |
sheetContent = { | |
// Put whatever the sheet you want in here | |
} |
OlderNewer