public class

ReplyUIViewModel

extends ViewModel
java.lang.Object
   ↳ ViewModel
     ↳ com.pdftron.collab.ui.reply.component.ReplyUIViewModel

Class Overview

ViewModel containing data required by the reply dialog, such as the list of messages, the header, text input field, and the current user.

The ReplyUIViewModel object will be reused and reinitialized for every reply dialog pertaining to a specific annotation in the document viewer.

Summary

Public Constructors
ReplyUIViewModel()
Public Methods
getEditCommentLiveData()
Similar to getWriteMessageLiveData(), however returns a LiveData< ReplyInput > that calls its observers when ever there is a change in the comment edit text input field.
getEditMessageLiveData()
Similar to getWriteMessageLiveData(), however returns a LiveData< ReplyInput > that calls its observers when ever there is a change in the new message edit text input field.
getHeaderLiveData()
Returns a LiveData< ReplyHeader > that calls its observers when the header information has changed.
getHeaderObservable()
getMessagesLiveData()
Returns a LiveData< ReplyMessages > that calls its observers when the list of messages/ comments have changed.
getMessagesObservable()
int getPage()
Returns the current page of the annotation that this ReplyUIViewModel represents.
User getUser()
Returns the current User.
getWriteMessageLiveData()
Returns a LiveData< ReplyInput > that calls its observers when ever there is a change in the new message edit text input field.
getWriteMessageObservable()
void set(ReplyHeader replyHeader, ReplyMessages replyMessages, User user, int page)
Initialize the data in the ReplyUIViewModel.
void setHasUnreadReplies(boolean hasUnreadReplies)
Updates the notification flag in the LiveData containing the reply header data.
void setMessages(List<ReplyMessage> newMessages)
Updates the LiveData containing the reply messages with a new list of comments/messages.
void setParentAnnotation(AnnotationEntity parentAnnot)
Updates the parent annotation associated with the reply header.
void setParentAnnotationContent(String content)
Updates the parent annotation's content.
void setReviewState(AnnotReviewState reviewState)
Updates the review state in the LiveData containing the reply header data.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ReplyUIViewModel ()

Public Methods

public getEditCommentLiveData ()

Similar to getWriteMessageLiveData(), however returns a LiveData< ReplyInput > that calls its observers when ever there is a change in the comment edit text input field.

Returns
  • the LiveData< ReplyInput >

public getEditMessageLiveData ()

Similar to getWriteMessageLiveData(), however returns a LiveData< ReplyInput > that calls its observers when ever there is a change in the new message edit text input field.

Returns
  • the LiveData< ReplyInput >

public getHeaderLiveData ()

Returns a LiveData< ReplyHeader > that calls its observers when the header information has changed. It is used internally to initialize the view state, but can be used externally to listen to header state changes. Currently observers are only notified when replies have changed (i.e. the notification icon) and preview changes are not supported.

Returns
  • the LiveData< ReplyHeader >

public getHeaderObservable ()

public getMessagesLiveData ()

Returns a LiveData< ReplyMessages > that calls its observers when the list of messages/ comments have changed. It is used internally to initialize the view state, but can also be used externally to listen to message list changes.

Returns
  • the LiveData< ReplyMessages >

public getMessagesObservable ()

public int getPage ()

Returns the current page of the annotation that this ReplyUIViewModel represents.

public User getUser ()

Returns the current User.

public getWriteMessageLiveData ()

Returns a LiveData< ReplyInput > that calls its observers when ever there is a change in the new message edit text input field.

Returns
  • the LiveData< ReplyInput >

public getWriteMessageObservable ()

public void set (ReplyHeader replyHeader, ReplyMessages replyMessages, User user, int page)

Initialize the data in the ReplyUIViewModel. Data usually comes from the current selected annotation.

Parameters
replyHeader contains the annotation information to be displayed
replyMessages contains the reply message to be displayed
user contains information about the current user (used to edit and write comments)
page current page of the annotation that this view model describes

public void setHasUnreadReplies (boolean hasUnreadReplies)

Updates the notification flag in the LiveData containing the reply header data.

Parameters
hasUnreadReplies whether there are any unread replies/comments

public void setMessages (List<ReplyMessage> newMessages)

Updates the LiveData containing the reply messages with a new list of comments/messages.

Parameters
newMessages used to update the view model.

public void setParentAnnotation (AnnotationEntity parentAnnot)

Updates the parent annotation associated with the reply header.

Parameters
parentAnnot containing the parent annotation information.

public void setParentAnnotationContent (String content)

Updates the parent annotation's content.

Parameters
content the content

public void setReviewState (AnnotReviewState reviewState)

Updates the review state in the LiveData containing the reply header data.

Parameters
reviewState the review state of the reply