8

Bubble Notifications in Android

 3 years ago
source link: https://www.raywenderlich.com/20853889-bubble-notifications-in-android
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Bubble Notifications in Android

The most important thing an Android phone does is connect people. Wouldn’t it be nice if you could feel like the people you want to talk to are right there with you? Android 11 has spectacular new features to help developers and users do just that. In this episode you are going to learn about the difference between regular notifications and conversation notifications. You are also going to learn about bubbles and the advantages they offer for sharing and multitasking.

Notifications that appear in the conversation section have a stronger visual emphasis on the avatar, highlighting who the conversation is with. Long-pressing notifications in this area shows you conversation-specific actions you can take. In this episode you will learn how to display your notifications in the conversations section.

When targeting Android 11 or higher, you have to give a shortcut to any notification you want to show in the conversation space. Shortcuts are a handy way for a user to jump right into a conversation.

Now that the code to create the shortcuts is in place, it’s time to add the ability to update them dynamically. In this episode we will add the ability to update the conversation shortcuts dynamically by adding the appropriate code to our acitivity.

Conversational shortcuts make it easy to share conversations through Direct Share. In Android 11, you can pin up to four apps to the default share menu. Otherwise, apps and conversations appear in the menu, organized contextually.

When working with bubbles, the user has the option to disallow them for certain apps or conversations, so it’s always a good idea to provide a notification with sufficient information for the bubble.

Because the user can opt out of bubble notifications for specific apps or conversations, it’s handy to know when they’ve allowed bubbling. In this episode you will learn how to display activities in a bubble and detect permissions given by the user at runtime.

An app can launch a bubble even when it isn’t in the foreground. However, the bubble won’t expand on all devices. In this episode we will discuss how background bubbles work on different devices.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK