Class LocalNotification.MessagingStyle
java.lang.Object
com.codename1.notifications.LocalNotification.MessagingStyle
- Enclosing class:
LocalNotification
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 Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA single message within a messaging style notification. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMessage(String text, long timestamp, String senderName) Adds a message to the conversation.Sets the conversation title shown above the messages.Returns the conversation title.Returns the messages in the conversation.Returns the name representing the device user.groupConversation(boolean b) Marks the conversation as a group conversation (more than two participants).booleanReturns true if this is a group conversation.
-
Constructor Details
-
MessagingStyle
Creates a messaging style.
Parameters
selfDisplayName: the name representing the device user
-
-
Method Details
-
conversationTitle
Sets the conversation title shown above the messages.
Parameters
t: the conversation title
Returns
this messaging style for chaining
-
groupConversation
Marks the conversation as a group conversation (more than two participants).
Parameters
b: true if this is a group conversation
Returns
this messaging style for chaining
-
addMessage
Adds a message to the conversation.
Parameters
-
text: the message text -
timestamp: the message timestamp in milliseconds since the epoch -
senderName: the display name of the sender, or null for the device user
Returns
this messaging style for chaining
-
-
getSelfDisplayName
Returns the name representing the device user.
Returns
the self display name
-
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
Returns the messages in the conversation.
Returns
the messages, never null
-