[英]what notification type do gmail use in android
What type of notification does Gmail use in Nexus4 (Android 4.3) ? Gmail在Nexus4(Android 4.3)中使用什么类型的通知?
It has two special features I would like to use as well. 它也有两个我想使用的特殊功能。
a) When there are multiple mails to read all their headers appear one after the other. a)当有多个要读取的邮件时,它们的所有标头都一个接一个地出现。 and a bottom line is drawn. 然后画底线。
b) When there is no space in the notification page, the Gmail notification shrinks and sums all headers to on line. b)当通知页面中没有空间时,Gmail通知会缩小,并将所有标头加总成一行。
How do they do this? 他们怎么做到的? How can I do this as well? 我也该怎么做?
It is basically the Big View and Notification.BigTextStyle . 它基本上是Big View和Notification.BigTextStyle 。
You can either customize your layout or use it under default notification by: 您可以通过以下方式自定义布局或在默认通知下使用它:
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
this).setSmallIcon(R.drawable.ic_launcher)
.setContentTitle("Title")
.setStyle(new NotificationCompat.BigTextStyle().bigText("Message"))
.setContentText("Message");
For customizing layouts of your Notifications, which may be well suited depending on the requirement, refer: 对于自定义通知的布局(根据要求可能非常适合),请参阅:
Expandable Notifications 展开式通知
Applying Big Style 运用大风格
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.