public static class LocalNotification.MessagingStyle

  1. Object
  2. LocalNotification.MessagingStyle
Describes a conversation (messaging style) notification. A messaging style notification renders a sequence of chat messages, each attributed to a sender, and is the recommended presentation for chat and messaging apps.

Nested types

class LocalNotification.MessagingStyle.MessageA single message within a messaging style notification.

Constructors

public MessagingStyle(String selfDisplayName)Creates a messaging style.

Methods

public LocalNotification.MessagingStyle conversationTitle(String t)Sets the conversation title shown above the messages.
public LocalNotification.MessagingStyle groupConversation(boolean b)Marks the conversation as a group conversation (more than two participants).
public LocalNotification.MessagingStyle addMessage(String text, long timestamp, String senderName)Adds a message to the conversation.
public String getSelfDisplayName()Returns the name representing the device user.
public String getConversationTitle()Returns the conversation title.
public boolean isGroupConversation()Returns true if this is a group conversation.
public List<LocalNotification.MessagingStyle.Message> getMessages()Returns the messages in the conversation.

Inherited methods

Constructor details

MessagingStyle

public MessagingStyle(String selfDisplayName)
Creates a messaging style.

Parameters

selfDisplayName String
the name representing the device user

Method details

conversationTitle

public LocalNotification.MessagingStyle conversationTitle(String t)
Sets the conversation title shown above the messages.

Parameters

t String
the conversation title

Returns

this messaging style for chaining

groupConversation

public LocalNotification.MessagingStyle groupConversation(boolean b)
Marks the conversation as a group conversation (more than two participants).

Parameters

b boolean
true if this is a group conversation

Returns

this messaging style for chaining

addMessage

public LocalNotification.MessagingStyle addMessage(String text, long timestamp, String senderName)
Adds a message to the conversation.

Parameters

text String
the message text
timestamp long
the message timestamp in milliseconds since the epoch
senderName String
the display name of the sender, or null for the device user

Returns

this messaging style for chaining

getSelfDisplayName

public String getSelfDisplayName()
Returns the name representing the device user.

Returns

the self display name

getConversationTitle

public String getConversationTitle()
Returns the conversation title.

Returns

the conversation title, or null

isGroupConversation

public boolean isGroupConversation()
Returns true if this is a group conversation.

Returns

true if a group conversation

getMessages

public List<LocalNotification.MessagingStyle.Message> getMessages()
Returns the messages in the conversation.

Returns

the messages, never null