public static class ChatBubbleView.ViewModel extends Entity
This is a view model class that may be used as a model for the ChatBubbleView, as it
defines properties with all of the required tags. You can also use your own entity
for a view model as long as the entity contains properties with the given tags. E.g.
You can use any entity as long as it includes at least a property with the messageTextTag
tag, which
is the same as CreativeWork.text
.
<p>Note: If you use a custom view model, you needn’t use the same content types for your properties. E.g. this sample view model’s iconTag is a string URL. But you could just as easily use an image property, and the view will handle it properly.
Modifier and Type | Field and Description |
---|---|
static StringProperty |
attachmentImageUrl |
static Tag |
attachmentPlaceholder |
static DateProperty |
date |
static Tag |
dateTag
Tag used for the date field.
|
static BooleanProperty |
favorite |
static Tag |
iconTag
Tag used for the "icon" property of a chat message.
|
static StringProperty |
iconUrl |
static Tag |
isFavorite
Tag used for boolean property which marks a chat message as a "favourite".
|
static Tag |
isOwnTag
Tag used for the "own" flag of a chat message to indicate that
the message originated from the current user, and not another user.
|
static StringProperty |
messageText |
static Tag |
messageTextTag
Tag used for the message text property of a chat message.
|
static BooleanProperty |
own |
static StringProperty |
postedBy |
static Tag |
postedByTag
Tag used for the 'posted by' property of a chat message.
|
static BooleanProperty |
typingInProgress |
static Tag |
typingInProgressTag
Tag used for boolean property that indicates typing is still in progress for a chat message.
|
Constructor and Description |
---|
ViewModel() |
Modifier and Type | Method and Description |
---|---|
ChatBubbleView.ViewModel |
attachmentImageUrl(String imageUrl) |
ChatBubbleView.ViewModel |
date(Date d) |
String |
getAttachmentImageUrl() |
Date |
getDate() |
String |
getIconUrl() |
String |
getMessageText() |
String |
getPostedBy() |
ChatBubbleView.ViewModel |
iconUrl(String url) |
Boolean |
isFavorite() |
ChatBubbleView.ViewModel |
isFavorite(boolean o) |
Boolean |
isOwn() |
ChatBubbleView.ViewModel |
isOwn(boolean o) |
Boolean |
isTypingInProgress() |
ChatBubbleView.ViewModel |
messageText(String text) |
ChatBubbleView.ViewModel |
postedBy(String username) |
ChatBubbleView.ViewModel |
typingInProgress(boolean inProgress) |
addPropertyChangeListener, addPropertyChangeListener, clearChanged, createImageToFile, createImageToFile, createImageToFile, createImageToFile, createImageToFile, createImageToFile, createImageToFile, createImageToFile, createImageToStorage, createImageToStorage, createImageToStorage, createImageToStorage, createImageToStorage, createImageToStorage, createImageToStorage, createImageToStorage, findProperty, firePropertyChangeEvent, get, get, get, getAggregate, getBoolean, getBoolean, getDate, getDate, getEntity, getEntity, getEntityList, getEntityList, getEntityType, getText, getText, isEmpty, isEmpty, isEntity, isEntity, isFalsey, isFalsey, removePropertyChangeListener, removePropertyChangeListener, set, set, set, set, setBoolean, setBoolean, setBoolean, setChanged, setDate, setDate, setDate, setDouble, setDouble, setDouble, setEntity, setEntity, setEntity, setEntityType, setFloat, setFloat, setFloat, setInt, setInt, setInt, setText, setText, setText
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
public static final Tag dateTag
Tag used for the date field.
public static final Tag isOwnTag
Tag used for the "own" flag of a chat message to indicate that the message originated from the current user, and not another user. This flag is used to determine which side (left or right) of the view the chat bubble is displayed on.
<p>If the view model entity does not contain a property with this tag, then it will be inferred by the ChatBubbleView based on whether the "postedBy" property is empty.</p>
ChatMessage.isOwnMessage
public static final Tag isFavorite
Tag used for boolean property which marks a chat message as a "favourite".
ChatMessage.isFavorite
public static final Tag iconTag
Tag used for the "icon" property of a chat message. The field may be any content
type that can be converted to an AsyncImage
. This includes a string (with a URL,
fiile path, resource path, or storage key), or any other content type that can convert
to AsyncImage.
Thing.thumbnailUrl
public static final Tag postedByTag
Tag used for the 'posted by' property of a chat message. This reference implementation uses a String property for this, but you could just as well use an Entity content type to store an actual entity of a user.
CreativeWork.creator
public static final Tag messageTextTag
Tag used for the message text property of a chat message. This is the only required tag for an entity to be usable as a model for a ChatBubbleView.
CreativeWork.text
public static final Tag typingInProgressTag
Tag used for boolean property that indicates typing is still in progress for a chat message.
ChatMessage.typingInProgress
public static final Tag attachmentPlaceholder
public static StringProperty postedBy
public static StringProperty iconUrl
public static StringProperty messageText
public static StringProperty attachmentImageUrl
public static BooleanProperty own
public static BooleanProperty favorite
public static BooleanProperty typingInProgress
public static DateProperty date
public ChatBubbleView.ViewModel postedBy(String username)
public ChatBubbleView.ViewModel iconUrl(String url)
public ChatBubbleView.ViewModel date(Date d)
public ChatBubbleView.ViewModel messageText(String text)
public ChatBubbleView.ViewModel isOwn(boolean o)
public ChatBubbleView.ViewModel isFavorite(boolean o)
public Boolean isTypingInProgress()
public ChatBubbleView.ViewModel typingInProgress(boolean inProgress)
public ChatBubbleView.ViewModel attachmentImageUrl(String imageUrl)
public String getPostedBy()
public String getIconUrl()
public Date getDate()
public Boolean isOwn()
public Boolean isFavorite()
public String getMessageText()
public String getAttachmentImageUrl()