Package io.smooch.core
Class ConversationDelegateAdapter
- java.lang.Object
-
- io.smooch.core.ConversationDelegateAdapter
-
- All Implemented Interfaces:
ConversationDelegate
public abstract class ConversationDelegateAdapter extends java.lang.Object implements ConversationDelegate
Abstract class that implementsConversationDelegate
so individual methods can be overridden.
-
-
Field Summary
-
Fields inherited from interface io.smooch.core.ConversationDelegate
INTEGRATOR_DELEGATE
-
-
Constructor Summary
Constructors Constructor Description ConversationDelegateAdapter()
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Method Detail
-
onMessagesReceived
public void onMessagesReceived(Conversation conversation, java.util.List<Message> messages)
Description copied from interface:ConversationDelegate
Notifies the delegate of new incoming messages.Called when new messages are received from the server.
- Specified by:
onMessagesReceived
in interfaceConversationDelegate
- Parameters:
conversation
- The conversation object.messages
- A list of Message objects representing the new messages.- See Also:
ConversationDelegate.onMessagesReceived(Conversation, List)
-
onMessagesReset
public void onMessagesReset(Conversation conversation, java.util.List<Message> messages)
Description copied from interface:ConversationDelegate
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.
- Specified by:
onMessagesReset
in interfaceConversationDelegate
- Parameters:
conversation
- The conversation object.messages
- A list of Message objects representing the new messages.- See Also:
ConversationDelegate.onMessagesReset(Conversation, List)
-
onUnreadCountChanged
public void onUnreadCountChanged(Conversation conversation, int unreadCount)
Description copied from interface:ConversationDelegate
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.
- Specified by:
onUnreadCountChanged
in interfaceConversationDelegate
- Parameters:
conversation
- The conversation objectunreadCount
- The count of unread messages- See Also:
ConversationDelegate.onUnreadCountChanged(Conversation, int)
-
onMessageSent
public void onMessageSent(Message message, MessageUploadStatus status)
Description copied from interface:ConversationDelegate
Notifies the delegate of a message being sent.Called once the message has been sent successfully or not.
- Specified by:
onMessageSent
in interfaceConversationDelegate
- Parameters:
message
- The message that was sentstatus
- The status of the message that was sent- See Also:
ConversationDelegate.onMessageSent(Message, MessageUploadStatus)
-
onConversationEventReceived
public void onConversationEventReceived(ConversationEvent conversationActivity)
Description copied from interface:ConversationDelegate
Notifies the delegate of a new activity.Called when a new activity is received from the server
- Specified by:
onConversationEventReceived
in interfaceConversationDelegate
- Parameters:
conversationActivity
- The conversationActivity that was received- See Also:
ConversationDelegate.onConversationEventReceived(ConversationEvent)
-
onInitializationStatusChanged
public void onInitializationStatusChanged(InitializationStatus status)
Description copied from interface:ConversationDelegate
Notifies the delegate of a change in Initialization status.- Specified by:
onInitializationStatusChanged
in interfaceConversationDelegate
- Parameters:
status
- The new status- See Also:
ConversationDelegate.onInitializationStatusChanged(InitializationStatus)
-
onLoginComplete
public void onLoginComplete(LoginResult result)
Description copied from interface:ConversationDelegate
Notifies the delegate when a call toSmooch.login(String, String, SmoochCallback)
is complete- Specified by:
onLoginComplete
in interfaceConversationDelegate
- Parameters:
result
- The login result- See Also:
ConversationDelegate.onLoginComplete(LoginResult)
-
onLogoutComplete
public void onLogoutComplete(LogoutResult result)
Description copied from interface:ConversationDelegate
Notifies the delegate when a call toSmooch.logout(SmoochCallback)
is complete- Specified by:
onLogoutComplete
in interfaceConversationDelegate
- Parameters:
result
- The logout result- See Also:
ConversationDelegate.onLogoutComplete(LogoutResult)
-
onPaymentProcessed
public void onPaymentProcessed(MessageAction messageAction, PaymentStatus status)
Description copied from interface:ConversationDelegate
Notifies the delegate when payment is processed.- Specified by:
onPaymentProcessed
in interfaceConversationDelegate
- Parameters:
messageAction
- The purchased message actionstatus
- The status of the payment- See Also:
ConversationDelegate.onPaymentProcessed(MessageAction, PaymentStatus)
-
shouldTriggerAction
public boolean shouldTriggerAction(MessageAction messageAction)
Description copied from interface:ConversationDelegate
Allows a delegate to override default action behavior.Called when the user taps a message action.
- Specified by:
shouldTriggerAction
in interfaceConversationDelegate
- Parameters:
messageAction
- The message action that was tapped.- Returns:
- false to prevent default behaviour of message action click, true otherwise
- See Also:
ConversationDelegate.shouldTriggerAction(MessageAction)
-
onCardSummaryLoaded
public void onCardSummaryLoaded(CardSummary cardSummary)
Description copied from interface:ConversationDelegate
Notifies the delegate when a saved stripe card is loaded.Called when the stripe card info is loaded.
- Specified by:
onCardSummaryLoaded
in interfaceConversationDelegate
- Parameters:
cardSummary
- The stripe card information.- See Also:
ConversationDelegate.onCardSummaryLoaded(CardSummary)
-
onSmoochConnectionStatusChanged
public void onSmoochConnectionStatusChanged(SmoochConnectionStatus status)
Description copied from interface:ConversationDelegate
Notifies the delegate when the user's connection to Smooch has changed.Called when the user's connection to Smooch changes.
- Specified by:
onSmoochConnectionStatusChanged
in interfaceConversationDelegate
- Parameters:
status
- The connection status.- See Also:
ConversationDelegate.onSmoochConnectionStatusChanged(SmoochConnectionStatus)
-
onSmoochShown
public void onSmoochShown()
Description copied from interface:ConversationDelegate
Notifies the delegate when the Smooch Conversation is shown.- Specified by:
onSmoochShown
in interfaceConversationDelegate
- See Also:
ConversationDelegate.onSmoochShown()
-
onSmoochHidden
public void onSmoochHidden()
Description copied from interface:ConversationDelegate
Notifies the delegate when the Smooch Conversation is hidden.- Specified by:
onSmoochHidden
in interfaceConversationDelegate
- See Also:
ConversationDelegate.onSmoochHidden()
-
onConversationsListUpdated
public void onConversationsListUpdated(java.util.List<Conversation> conversationsList)
Description copied from interface:ConversationDelegate
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- Specified by:
onConversationsListUpdated
in interfaceConversationDelegate
- Parameters:
conversationsList
- an updated list ofConversation
- See Also:
ConversationDelegate.onConversationsListUpdated(List)
-
-