Skip to content

Instantly share code, notes, and snippets.

@Karn
Created September 29, 2019 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Karn/a0c275a0ccacbf7e6465766bf097218b to your computer and use it in GitHub Desktop.
Save Karn/a0c275a0ccacbf7e6465766bf097218b to your computer and use it in GitHub Desktop.
Notify.with(context)
// Defines the content of the Notification
.content {
title = "New dessert menu"
text = "The Cheesecake Factory has a new dessert for you to try!"
}
// Bubblize the Notfication!
.bubblize {
// Create bubble intent
val target = Intent(context, BubbleActivity::class.java)
val bubbleIntent = PendingIntent.getActivity(context, 0, target, 0 /* flags */)
// Set the image for the Bubble
bubbleIcon = IconCompat.createWithResource(context, R.drawable.ic_app_icon)
// Set the activity that is being shown when the Bubble is expanded.
targetActivity = bubbleIntent
}
.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment