/**@class android.app.Notification.MessagingStyle @extends android.app.Notification.Style Helper class for generating large-format notifications that include multiple back-and-forth messages of varying types between any number of people. <p> If the platform does not provide large-format notifications, this method has no effect. The user will always see the normal notification view. <p> If the app is targeting Android P and above, it is required to use the {@link android.app.Person} class in order to get an optimal rendering of the notification and its avatars. For conversations involving multiple people, the app should also make sure that it marks the conversation as a group with {@link #setGroupConversation}(boolean). <p> This class is a "rebuilder": It attaches to a Builder object and modifies its behavior. Here's an example of how this may be used: <pre class="prettyprint"> Person user = new Person.Builder().setIcon(userIcon).setName(userName).build(); MessagingStyle style = new MessagingStyle(user) .addMessage(messages[1].getText(), messages[1].getTime(), messages[1].getPerson()) .addMessage(messages[2].getText(), messages[2].getTime(), messages[2].getPerson()) .setGroupConversation(hasMultiplePeople()); Notification noti = new Notification.Builder() .setContentTitle("2 new messages with " + sender.toString()) .setContentText(subject) .setSmallIcon(R.drawable.new_message) .setLargeIcon(aBitmap) .setStyle(style) .build(); </pre> */ var MessagingStyle = { /** The maximum number of messages that will be retained in the Notification itself (the number displayed is up to the platform). */ MAXIMUM_RETAINED_MESSAGES : "25", /**Validate that this style was properly composed. This is called at build time. @hide */ validate : function( ) {}, /** @return {Object {java.lang.CharSequence}} the text that should be displayed in the statusBar when heads upped. If {@code null} is returned, the default implementation will be used. @hide */ getHeadsUpStatusBarText : function( ) {}, /** @return {Object {android.app.Person}} the user to be displayed for any replies sent by the user */ getUser : function( ) {}, /**Returns the name to be displayed for any replies sent by the user @deprecated use {@link #getUser()} instead */ getUserDisplayName : function( ) {}, /**Sets the title to be displayed on this conversation. May be set to {@code null}. <p>This API's behavior was changed in SDK version {@link Build.VERSION_CODES#P}. If your application's target version is less than {@link Build.VERSION_CODES#P}, setting a conversation title to a non-null value will make {@link #isGroupConversation}() return {@code true} and passing {@code null} will make it return {@code false}. In {@link Build.VERSION_CODES#P} and beyond, use {@link #setGroupConversation}(boolean) to set group conversation status. @param {Object {CharSequence}} conversationTitle Title displayed for this conversation @return {Object {android.app.Notification.MessagingStyle}} this object for method chaining */ setConversationTitle : function( ) {}, /**Return the title to be displayed on this conversation. May return {@code null}. */ getConversationTitle : function( ) {}, /**Adds a message for display by this notification. Convenience call for a simple {@link android.app.MessagingStyle.Message} in {@link #addMessage(Notification.MessagingStyle.Message)}. @param {Object {CharSequence}} text A {@link CharSequence} to be displayed as the message content @param {Number} timestamp Time at which the message arrived @param {Object {CharSequence}} sender A {@link CharSequence} to be used for displaying the name of the sender. Should be <code>null</code> for messages by the current user, in which case the platform will insert {@link #getUserDisplayName()}. Should be unique amongst all individuals in the conversation, and should be consistent during re-posts of the notification. @see Message#Notification.MessagingStyle.Message(CharSequence, long, CharSequence) @return {Object {android.app.Notification.MessagingStyle}} this object for method chaining @deprecated use {@link #addMessage(CharSequence, long, Person)} */ addMessage : function( ) {}, /**Adds a message for display by this notification. Convenience call for a simple {@link android.app.MessagingStyle.Message} in {@link #addMessage(Notification.MessagingStyle.Message)}. @param {Object {CharSequence}} text A {@link CharSequence} to be displayed as the message content @param {Number} timestamp Time at which the message arrived @param {Object {Person}} sender The {@link Person} who sent the message. Should be <code>null</code> for messages by the current user, in which case the platform will insert the user set in {@code MessagingStyle(Person)}. @see Message#Notification.MessagingStyle.Message(CharSequence, long, CharSequence) @return {Object {android.app.Notification.MessagingStyle}} this object for method chaining */ addMessage : function( ) {}, /**Adds a {@link android.app.MessagingStyle.Message} for display in this notification. <p>The messages should be added in chronologic order, i.e. the oldest first, the newest last. @param {Object {Notification.MessagingStyle.Message}} message The {@link Message} to be displayed @return {Object {android.app.Notification.MessagingStyle}} this object for method chaining */ addMessage : function( ) {}, /**Adds a {@link android.app.MessagingStyle.Message} for historic context in this notification. <p>Messages should be added as historic if they are not the main subject of the notification but may give context to a conversation. The system may choose to present them only when relevant, e.g. when replying to a message through a {@link android.app.RemoteInput}. <p>The messages should be added in chronologic order, i.e. the oldest first, the newest last. @param {Object {Notification.MessagingStyle.Message}} message The historic {@link Message} to be added @return {Object {android.app.Notification.MessagingStyle}} this object for method chaining */ addHistoricMessage : function( ) {}, /**Gets the list of {@code Message} objects that represent the notification */ getMessages : function( ) {}, /**Gets the list of historic {@code Message}s in the notification. */ getHistoricMessages : function( ) {}, /**Sets whether this conversation notification represents a group. If the app is targeting Android P, this is required if the app wants to display the largeIcon set with {@link android.app.Notification.Builder#setLargeIcon(Bitmap)}, otherwise it will be hidden. @param {Boolean} isGroupConversation {@code true} if the conversation represents a group, {@code false} otherwise. @return {Object {android.app.Notification.MessagingStyle}} this object for method chaining */ setGroupConversation : function( ) {}, /**Returns {@code true} if this notification represents a group conversation, otherwise {@code false}. <p> If the application that generated this {@link android.app.Notification.MessagingStyle} targets an SDK version less than {@link Build.VERSION_CODES#P}, this method becomes dependent on whether or not the conversation title is set; returning {@code true} if the conversation title is a non-null value, or {@code false} otherwise. From {@link Build.VERSION_CODES#P} forward, this method returns what's set by {@link #setGroupConversation}(boolean) allowing for named, non-group conversations. @see #setConversationTitle(CharSequence) */ isGroupConversation : function( ) {}, /** @hide */ addExtras : function( ) {}, /** @hide */ makeContentView : function( ) {}, /** @hide Spans are ignored when comparing text for visual difference. */ areNotificationsVisiblyDifferent : function( ) {}, /** @hide */ findLatestIncomingMessage : function( ) {}, /** @hide */ makeBigContentView : function( ) {}, /** @hide */ makeHeadsUpContentView : function( ) {}, };