简体   繁体   English

gmail在Android中使用哪种通知类型

[英]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 ViewNotification.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.

相关问题 Android:这个“通知”叫什么? - Android: What is this “notification” called? 我需要在Android Studio中使用哪种填充类型来在屏幕上居中放置按钮? - What type of padding do I need to use in Android studio to center my buttons on the screen? Pebble手表上的Android Notification类型 - Android Notification type on Pebble watch 将 android 手机与 gmail 联系人同步的代码是什么 - what is the code to Sync android phone with gmail contact Android:Android推送通知应该使用什么? Google Cloud Messaging或Parse.com - Android: what should I use for android push notification? Google Cloud Messaging or Parse.com oAuth 2 Gmail-Android / iOS连接和服务器使用 - oAuth 2 Gmail - Android /iOS connexion and server use Android 通知不执行任何操作 - Android Notification does not do anything 在phonegap android应用程序中使用什么代替不推荐使用的“ LegacyContext”类型? - what to use instead of deprecated “LegacyContext” type in phonegap android application? 我应该在Android中使用哪种类型的数据存储? - What type of data storage should I use in Android? MessageQueue class 的用途是什么,我们如何使用它来处理 Firebase 推送通知? - What is the purpose of MessageQueue class and how do we use it to handle the Firebase push notification?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM