其他
以人为本 | Android 11 的消息通知
Android 11 https://developer.android.google.cn/preview
什么是通知?
通知 https://developer.android.google.cn/guide/topics/ui/notifiers/notifications
People notifications
一人或多个 person
https://developer.android.google.cn/reference/androidx/core/app/NotificationCompat.Builder#addPerson(androidx.core.app.Person) 联系人 URI https://developer.android.google.cn/reference/android/app/Person.Builder#setUri(java.lang.String)
通知栏消息展示层次
通知渠道 https://developer.android.google.cn/training/notify-user/channels
通知分级
Notification Record https://android.googlesource.com/platform/frameworks/base/+/master/services/core/java/com/android/server/notification/NotificationRecord.java NotificationSignalExtractor https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/services/core/java/com/android/server/notification/NotificationSignalExtractor.java
private RankingReconsideration validatePeople(Context context, final NotificationRecord record) {
...
final PeopleRankingReconsideration rr = validatePeople(context, key, extras, record.getPeopleOverride(), affinityOut);
final float affinity = affinityOut[0];
record.setContactAffinity(affinity);
...
return rr;
}
Android 11 和会话
消息风格的通知
https://developer.android.google.cn/reference/androidx/core/app/NotificationCompat.MessagingStyle#NotificationCompat.MessagingStyle(java.lang.CharSequence)
Bubbles
https://developer.android.google.cn/guide/topics/ui/bubbles
People first
相关信息
Android Developer 官方文档 | 会话 https://developer.android.google.cn/preview/features/conversations Android 消息通知 https://material.io/design/platform-guidance/android-notifications.html
推荐阅读