Class LocalNotification.MessagingStyle

java.lang.Object
com.codename1.notifications.LocalNotification.MessagingStyle
Enclosing class:
LocalNotification

public static class LocalNotification.MessagingStyle extends Object
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.
  • Constructor Details

    • MessagingStyle

      public MessagingStyle(String selfDisplayName)

      Creates a messaging style.

      Parameters
      • selfDisplayName: 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: 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: 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: 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

      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

      Returns the messages in the conversation.

      Returns

      the messages, never null