public class ConversationActivity extends AppCompatActivity implements ConversationDelegate
INTEGRATOR_DELEGATE
Constructor and Description |
---|
ConversationActivity() |
Modifier and Type | Method and Description |
---|---|
static ConversationActivityBuilder |
builder()
Returns a new builder for configuring and displaying
ConversationActivity . |
static void |
close()
Closes the conversation view.
|
void |
closeFormFragment() |
void |
onBackPressed() |
void |
onBrandMessengerConnectionStatusChanged(BrandMessengerConnectionStatus status)
Notifies the delegate when the user's connection to BrandMessenger has changed.
|
void |
onBrandMessengerHidden()
Notifies the delegate when the BrandMessenger Conversation is hidden.
|
void |
onBrandMessengerShown()
Notifies the delegate when the BrandMessenger Conversation is shown.
|
void |
onCardSummaryLoaded(CardSummary cardSummary)
Notifies the delegate when a saved stripe card is loaded.
|
void |
onConversationEventReceived(ConversationEvent conversationEvent)
Notifies the delegate of a new activity.
|
void |
onConversationsListUpdated(java.util.List<Conversation> conversationsList)
Notifies the delegate when the conversations list was updated.
|
protected void |
onCreate(android.os.Bundle savedInstanceState) |
boolean |
onCreateOptionsMenu(android.view.Menu menu) |
protected void |
onDestroy() |
void |
onFormComplete() |
void |
onFormFragmentClose(Message message) |
void |
onFormFragmentShown() |
void |
onInitializationStatusChanged(InitializationStatus status)
Notifies the delegate of a change in Initialization status.
|
void |
onLoginComplete(LoginResult result)
Notifies the delegate when a call to
BrandMessenger.login(String, String, BrandMessengerCallback) is complete |
void |
onLogoutComplete(LogoutResult result)
Notifies the delegate when a call to
BrandMessenger.logout(BrandMessengerCallback) is complete |
void |
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.
|
boolean |
onOptionsItemSelected(android.view.MenuItem item) |
void |
onPause() |
void |
onPaymentProcessed(MessageAction messageAction,
PaymentStatus status)
Notifies the delegate when payment is processed.
|
void |
onPurchaseComplete() |
void |
onResume() |
void |
onShadedAreaClick() |
void |
onStart() |
void |
onStop() |
void |
onStripeFragmentClose() |
void |
onStripeFragmentShown() |
void |
onUnreadCountChanged(Conversation conversation,
int unreadCount)
Notifies the delegate of a change in unread message count.
|
void |
onWebviewHidden() |
void |
onWebviewShown() |
boolean |
shouldTriggerAction(MessageAction messageAction)
Allows a delegate to override default action behavior.
|
public static ConversationActivityBuilder builder()
ConversationActivity
.ConversationActivityBuilder
public static void close()
Ignored if the conversation is not running.
protected void onCreate(android.os.Bundle savedInstanceState)
protected void onDestroy()
public boolean onCreateOptionsMenu(android.view.Menu menu)
public boolean onOptionsItemSelected(android.view.MenuItem item)
public void onFormFragmentClose(Message message)
public void onBackPressed()
public void onResume()
public void onPause()
public void onStart()
public void onStop()
public void onMessagesReceived(Conversation conversation, java.util.List<Message> messages)
ConversationDelegate
Called when new messages are received from the server.
onMessagesReceived
in interface ConversationDelegate
conversation
- The conversation object.messages
- A list of Message objects representing the new messages.public void onMessagesReset(Conversation conversation, java.util.List<Message> messages)
ConversationDelegate
Called when new messages are received from the server that do not match locally stored cache or if a different conversation was loaded.
onMessagesReset
in interface ConversationDelegate
conversation
- The conversation object.messages
- A list of Message objects representing the new messages.public void onUnreadCountChanged(Conversation conversation, int unreadCount)
ConversationDelegate
Called when conversation data is fetched from the server, or when the user enters the conversation activity.
onUnreadCountChanged
in interface ConversationDelegate
conversation
- The conversation objectunreadCount
- The count of unread messagespublic void onMessageSent(Message message, MessageUploadStatus status)
ConversationDelegate
Called once the message has been sent successfully or not.
onMessageSent
in interface ConversationDelegate
message
- The message that was sentstatus
- The status of the message that was sentMessageUploadStatus
public void onConversationEventReceived(ConversationEvent conversationEvent)
ConversationDelegate
Called when a new activity is received from the server
onConversationEventReceived
in interface ConversationDelegate
conversationEvent
- The conversationActivity that was receivedConversationEventType
public void onInitializationStatusChanged(InitializationStatus status)
ConversationDelegate
onInitializationStatusChanged
in interface ConversationDelegate
status
- The new statusInitializationStatus
public void onLoginComplete(LoginResult result)
ConversationDelegate
BrandMessenger.login(String, String, BrandMessengerCallback)
is completeonLoginComplete
in interface ConversationDelegate
result
- The login resultLoginResult
public void onLogoutComplete(LogoutResult result)
ConversationDelegate
BrandMessenger.logout(BrandMessengerCallback)
is completeonLogoutComplete
in interface ConversationDelegate
result
- The logout resultLogoutResult
public void onPaymentProcessed(MessageAction messageAction, PaymentStatus status)
ConversationDelegate
onPaymentProcessed
in interface ConversationDelegate
messageAction
- The purchased message actionstatus
- The status of the paymentMessageAction
,
PaymentStatus
public boolean shouldTriggerAction(MessageAction messageAction)
ConversationDelegate
Called when the user taps a message action.
shouldTriggerAction
in interface ConversationDelegate
messageAction
- The message action that was tapped.MessageAction
public void onCardSummaryLoaded(CardSummary cardSummary)
ConversationDelegate
Called when the stripe card info is loaded.
onCardSummaryLoaded
in interface ConversationDelegate
cardSummary
- The stripe card information.CardSummary
public void onBrandMessengerConnectionStatusChanged(BrandMessengerConnectionStatus status)
ConversationDelegate
Called when the user's connection to BrandMessenger changes.
onBrandMessengerConnectionStatusChanged
in interface ConversationDelegate
status
- The connection status.BrandMessengerConnectionStatus
public void onBrandMessengerShown()
ConversationDelegate
onBrandMessengerShown
in interface ConversationDelegate
public void onBrandMessengerHidden()
ConversationDelegate
onBrandMessengerHidden
in interface ConversationDelegate
public void onConversationsListUpdated(java.util.List<Conversation> conversationsList)
ConversationDelegate
onConversationsListUpdated
in interface ConversationDelegate
conversationsList
- an updated list of Conversation
public void onStripeFragmentShown()
public void onStripeFragmentClose()
public void onPurchaseComplete()
public void onShadedAreaClick()
public void onWebviewShown()
public void onWebviewHidden()
public void onFormFragmentShown()
public void closeFormFragment()
public void onFormComplete()