Interface ConversationDelegate
-
- All Known Implementing Classes:
ConversationActivity
,ConversationDelegateAdapter
public interface ConversationDelegate
Delegate for events related to the conversation.Creating a delegate is optional, and may be used to receive callbacks when important changes happen in the conversation.
Callbacks are guaranteed to be called from the main thread.
-
-
Field Summary
Fields Modifier and Type Field Description static int
INTEGRATOR_DELEGATE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onCardSummaryLoaded(CardSummary cardSummary)
Notifies the delegate when a saved stripe card is loaded.void
onConversationEventReceived(ConversationEvent conversationActivity)
Notifies the delegate of a new activity.void
onConversationsListUpdated(java.util.List<Conversation> conversationsList)
Notifies the delegate when the conversations list was updated.void
onInitializationStatusChanged(InitializationStatus status)
Notifies the delegate of a change in Initialization status.void
onLoginComplete(LoginResult result)
Notifies the delegate when a call toSmooch.login(String, String, SmoochCallback)
is completevoid
onLogoutComplete(LogoutResult result)
Notifies the delegate when a call toSmooch.logout(SmoochCallback)
is completevoid
onMessageSent(Message message, MessageUploadStatus status)
Notifies the delegate of a message being sent.void
onMessagesReceived(Conversation conversation, java.util.List<Message> messages)
Notifies the delegate of new incoming messages.void
onMessagesReset(Conversation conversation, java.util.List<Message> messages)
Notifies the delegate the messages in a conversation have been reset.void
onPaymentProcessed(MessageAction messageAction, PaymentStatus status)
Notifies the delegate when payment is processed.void
onSmoochConnectionStatusChanged(SmoochConnectionStatus status)
Notifies the delegate when the user's connection to Smooch has changed.void
onSmoochHidden()
Notifies the delegate when the Smooch Conversation is hidden.void
onSmoochShown()
Notifies the delegate when the Smooch Conversation is shown.void
onUnreadCountChanged(Conversation conversation, int unreadCount)
Notifies the delegate of a change in unread message count.boolean
shouldTriggerAction(MessageAction messageAction)
Allows a delegate to override default action behavior.
-
-
-
Field Detail
-
INTEGRATOR_DELEGATE
static final int INTEGRATOR_DELEGATE
- See Also:
- Constant Field Values
-
-
Method Detail
-
onMessagesReceived
void onMessagesReceived(Conversation conversation, java.util.List<Message> messages)
Notifies the delegate of new incoming messages.Called when new messages are received from the server.
- Parameters:
conversation
- The conversation object.messages
- A list of Message objects representing the new messages.
-
onMessagesReset
void onMessagesReset(Conversation conversation, java.util.List<Message> messages)
Notifies the delegate the messages in a conversation have been reset.Called when new messages are received from the server that do not match locally stored cache or if a different conversation was loaded.
- Parameters:
conversation
- The conversation object.messages
- A list of Message objects representing the new messages.
-
onUnreadCountChanged
void onUnreadCountChanged(Conversation conversation, int unreadCount)
Notifies the delegate of a change in unread message count.Called when conversation data is fetched from the server, or when the user enters the conversation activity.
- Parameters:
conversation
- The conversation objectunreadCount
- The count of unread messages
-
onMessageSent
void onMessageSent(Message message, MessageUploadStatus status)
Notifies the delegate of a message being sent.Called once the message has been sent successfully or not.
- Parameters:
message
- The message that was sentstatus
- The status of the message that was sent- See Also:
MessageUploadStatus
-
onConversationEventReceived
void onConversationEventReceived(ConversationEvent conversationActivity)
Notifies the delegate of a new activity.Called when a new activity is received from the server
- Parameters:
conversationActivity
- The conversationActivity that was received- See Also:
ConversationEventType
-
onInitializationStatusChanged
void onInitializationStatusChanged(InitializationStatus status)
Notifies the delegate of a change in Initialization status.- Parameters:
status
- The new status- See Also:
InitializationStatus
-
onLoginComplete
void onLoginComplete(LoginResult result)
Notifies the delegate when a call toSmooch.login(String, String, SmoochCallback)
is complete- Parameters:
result
- The login result- See Also:
LoginResult
-
onLogoutComplete
void onLogoutComplete(LogoutResult result)
Notifies the delegate when a call toSmooch.logout(SmoochCallback)
is complete- Parameters:
result
- The logout result- See Also:
LogoutResult
-
onPaymentProcessed
void onPaymentProcessed(MessageAction messageAction, PaymentStatus status)
Notifies the delegate when payment is processed.- Parameters:
messageAction
- The purchased message actionstatus
- The status of the payment- See Also:
MessageAction
,PaymentStatus
-
shouldTriggerAction
boolean shouldTriggerAction(MessageAction messageAction)
Allows a delegate to override default action behavior.Called when the user taps a message action.
- Parameters:
messageAction
- The message action that was tapped.- Returns:
- false to prevent default behaviour of message action click, true otherwise
- See Also:
MessageAction
-
onCardSummaryLoaded
void onCardSummaryLoaded(CardSummary cardSummary)
Notifies the delegate when a saved stripe card is loaded.Called when the stripe card info is loaded.
- Parameters:
cardSummary
- The stripe card information.- See Also:
CardSummary
-
onSmoochConnectionStatusChanged
void onSmoochConnectionStatusChanged(SmoochConnectionStatus status)
Notifies the delegate when the user's connection to Smooch has changed.Called when the user's connection to Smooch changes.
- Parameters:
status
- The connection status.- See Also:
SmoochConnectionStatus
-
onSmoochShown
void onSmoochShown()
Notifies the delegate when the Smooch Conversation is shown.
-
onSmoochHidden
void onSmoochHidden()
Notifies the delegate when the Smooch Conversation is hidden.
-
onConversationsListUpdated
void onConversationsListUpdated(java.util.List<Conversation> conversationsList)
Notifies the delegate when the conversations list was updated. If you are building your own conversation list UI, implement this method to receive updates on any conversations in the list for this user- Parameters:
conversationsList
- an updated list ofConversation
-
-