Package io.smooch.ui
Class ConversationActivity
- java.lang.Object
-
- AppCompatActivity
-
- io.smooch.ui.ConversationActivity
-
- All Implemented Interfaces:
ConversationDelegate
public class ConversationActivity extends AppCompatActivity implements ConversationDelegate
-
-
Field Summary
-
Fields inherited from interface io.smooch.core.ConversationDelegate
INTEGRATOR_DELEGATE
-
-
Constructor Summary
Constructors Constructor Description ConversationActivity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConversationActivityBuilderbuilder()Returns a new builder for configuring and displayingConversationActivity.static voidclose()Closes the conversation view.voidonBackPressed()voidonCardSummaryLoaded(CardSummary cardSummary)Notifies the delegate when a saved stripe card is loaded.voidonConversationEventReceived(ConversationEvent conversationEvent)Notifies the delegate of a new activity.voidonConversationsListUpdated(java.util.List<Conversation> conversationsList)Notifies the delegate when the conversations list was updated.protected voidonCreate(android.os.Bundle savedInstanceState)booleanonCreateOptionsMenu(android.view.Menu menu)protected voidonDestroy()voidonInitializationStatusChanged(InitializationStatus status)Notifies the delegate of a change in Initialization status.voidonLoginComplete(LoginResult result)Notifies the delegate when a call toSmooch.login(String, String, SmoochCallback)is completevoidonLogoutComplete(LogoutResult result)Notifies the delegate when a call toSmooch.logout(SmoochCallback)is completevoidonMessageSent(Message message, MessageUploadStatus status)Notifies the delegate of a message being sent.voidonMessagesReceived(Conversation conversation, java.util.List<Message> messages)Notifies the delegate of new incoming messages.voidonMessagesReset(Conversation conversation, java.util.List<Message> messages)Notifies the delegate the messages in a conversation have been reset.booleanonOptionsItemSelected(android.view.MenuItem item)voidonPause()voidonPaymentProcessed(MessageAction messageAction, PaymentStatus status)Notifies the delegate when payment is processed.voidonPurchaseComplete()voidonResume()voidonShadedAreaClick()voidonSmoochConnectionStatusChanged(SmoochConnectionStatus status)Notifies the delegate when the user's connection to Smooch has changed.voidonSmoochHidden()Notifies the delegate when the Smooch Conversation is hidden.voidonSmoochShown()Notifies the delegate when the Smooch Conversation is shown.voidonStart()voidonStop()voidonStripeFragmentClose()voidonStripeFragmentShown()voidonUnreadCountChanged(Conversation conversation, int unreadCount)Notifies the delegate of a change in unread message count.voidonWebviewHidden()voidonWebviewShown()booleanshouldTriggerAction(MessageAction messageAction)Allows a delegate to override default action behavior.
-
-
-
Method Detail
-
builder
public static ConversationActivityBuilder builder()
Returns a new builder for configuring and displayingConversationActivity.- Returns:
- a new
ConversationActivityBuilder
-
close
public static void close()
Closes the conversation view.Ignored if the conversation is not running.
-
onCreate
protected void onCreate(android.os.Bundle savedInstanceState)
-
onDestroy
protected void onDestroy()
-
onCreateOptionsMenu
public boolean onCreateOptionsMenu(android.view.Menu menu)
-
onOptionsItemSelected
public boolean onOptionsItemSelected(android.view.MenuItem item)
-
onBackPressed
public void onBackPressed()
-
onResume
public void onResume()
-
onPause
public void onPause()
-
onStart
public void onStart()
-
onStop
public void onStop()
-
onMessagesReceived
public void onMessagesReceived(Conversation conversation, java.util.List<Message> messages)
Description copied from interface:ConversationDelegateNotifies the delegate of new incoming messages.Called when new messages are received from the server.
- Specified by:
onMessagesReceivedin interfaceConversationDelegate- Parameters:
conversation- The conversation object.messages- A list of Message objects representing the new messages.
-
onMessagesReset
public void onMessagesReset(Conversation conversation, java.util.List<Message> messages)
Description copied from interface:ConversationDelegateNotifies 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:
onMessagesResetin interfaceConversationDelegate- Parameters:
conversation- The conversation object.messages- A list of Message objects representing the new messages.
-
onUnreadCountChanged
public void onUnreadCountChanged(Conversation conversation, int unreadCount)
Description copied from interface:ConversationDelegateNotifies 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:
onUnreadCountChangedin interfaceConversationDelegate- Parameters:
conversation- The conversation objectunreadCount- The count of unread messages
-
onMessageSent
public void onMessageSent(Message message, MessageUploadStatus status)
Description copied from interface:ConversationDelegateNotifies the delegate of a message being sent.Called once the message has been sent successfully or not.
- Specified by:
onMessageSentin interfaceConversationDelegate- Parameters:
message- The message that was sentstatus- The status of the message that was sent- See Also:
MessageUploadStatus
-
onConversationEventReceived
public void onConversationEventReceived(ConversationEvent conversationEvent)
Description copied from interface:ConversationDelegateNotifies the delegate of a new activity.Called when a new activity is received from the server
- Specified by:
onConversationEventReceivedin interfaceConversationDelegate- Parameters:
conversationEvent- The conversationActivity that was received- See Also:
ConversationEventType
-
onInitializationStatusChanged
public void onInitializationStatusChanged(InitializationStatus status)
Description copied from interface:ConversationDelegateNotifies the delegate of a change in Initialization status.- Specified by:
onInitializationStatusChangedin interfaceConversationDelegate- Parameters:
status- The new status- See Also:
InitializationStatus
-
onLoginComplete
public void onLoginComplete(LoginResult result)
Description copied from interface:ConversationDelegateNotifies the delegate when a call toSmooch.login(String, String, SmoochCallback)is complete- Specified by:
onLoginCompletein interfaceConversationDelegate- Parameters:
result- The login result- See Also:
LoginResult
-
onLogoutComplete
public void onLogoutComplete(LogoutResult result)
Description copied from interface:ConversationDelegateNotifies the delegate when a call toSmooch.logout(SmoochCallback)is complete- Specified by:
onLogoutCompletein interfaceConversationDelegate- Parameters:
result- The logout result- See Also:
LogoutResult
-
onPaymentProcessed
public void onPaymentProcessed(MessageAction messageAction, PaymentStatus status)
Description copied from interface:ConversationDelegateNotifies the delegate when payment is processed.- Specified by:
onPaymentProcessedin interfaceConversationDelegate- Parameters:
messageAction- The purchased message actionstatus- The status of the payment- See Also:
MessageAction,PaymentStatus
-
shouldTriggerAction
public boolean shouldTriggerAction(MessageAction messageAction)
Description copied from interface:ConversationDelegateAllows a delegate to override default action behavior.Called when the user taps a message action.
- Specified by:
shouldTriggerActionin interfaceConversationDelegate- Parameters:
messageAction- The message action that was tapped.- Returns:
- false to prevent default behaviour of message action click, true otherwise
- See Also:
MessageAction
-
onCardSummaryLoaded
public void onCardSummaryLoaded(CardSummary cardSummary)
Description copied from interface:ConversationDelegateNotifies the delegate when a saved stripe card is loaded.Called when the stripe card info is loaded.
- Specified by:
onCardSummaryLoadedin interfaceConversationDelegate- Parameters:
cardSummary- The stripe card information.- See Also:
CardSummary
-
onSmoochConnectionStatusChanged
public void onSmoochConnectionStatusChanged(SmoochConnectionStatus status)
Description copied from interface:ConversationDelegateNotifies the delegate when the user's connection to Smooch has changed.Called when the user's connection to Smooch changes.
- Specified by:
onSmoochConnectionStatusChangedin interfaceConversationDelegate- Parameters:
status- The connection status.- See Also:
SmoochConnectionStatus
-
onSmoochShown
public void onSmoochShown()
Description copied from interface:ConversationDelegateNotifies the delegate when the Smooch Conversation is shown.- Specified by:
onSmoochShownin interfaceConversationDelegate
-
onSmoochHidden
public void onSmoochHidden()
Description copied from interface:ConversationDelegateNotifies the delegate when the Smooch Conversation is hidden.- Specified by:
onSmoochHiddenin interfaceConversationDelegate
-
onConversationsListUpdated
public void onConversationsListUpdated(java.util.List<Conversation> conversationsList)
Description copied from interface:ConversationDelegateNotifies 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:
onConversationsListUpdatedin interfaceConversationDelegate- Parameters:
conversationsList- an updated list ofConversation
-
onStripeFragmentShown
public void onStripeFragmentShown()
-
onStripeFragmentClose
public void onStripeFragmentClose()
-
onPurchaseComplete
public void onPurchaseComplete()
-
onShadedAreaClick
public void onShadedAreaClick()
-
onWebviewShown
public void onWebviewShown()
-
onWebviewHidden
public void onWebviewHidden()
-
-