public class ConversationActivity extends AppCompatActivity implements Conversation.Delegate
Constructor and Description |
---|
ConversationActivity() |
Modifier and Type | Method and Description |
---|---|
static void |
close()
Closes the conversation view.
|
void |
onBackPressed() |
void |
onBotsConnectionStatusChanged(BotsConnectionStatus status)
Notifies the delegate when the user's connection to Bots has changed.
|
void |
onBotsHidden()
Notifies the delegate when the Bots Conversation is hidden.
|
void |
onBotsShown()
Notifies the delegate when the Bots 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.
|
protected void |
onCreate(android.os.Bundle savedInstanceState) |
boolean |
onCreateOptionsMenu(android.view.Menu menu) |
protected void |
onDestroy() |
void |
onInitializationStatusChanged(InitializationStatus status)
Notifies the delegate of a change in Initialization status.
|
void |
onLoginComplete(LoginResult result)
Notifies the delegate when a call to
Bots.login(String, String, BotsCallback) is complete |
void |
onLogoutComplete(LogoutResult result)
Notifies the delegate when a call to
Bots.logout(BotsCallback) 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.
|
static void |
show(android.content.Context context)
Shows the conversation view
|
static void |
show(android.content.Context context,
int flags)
Shows the conversation view.
|
public static void show(android.content.Context context)
Ignored if the conversation is already shown.
context
- The context from which to start the activity.public static void show(android.content.Context context, int flags)
Ignored if the conversation is already shown.
context
- The context from which to start the activity.flags
- The flags to set on the activity intent.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 onBackPressed()
public void onResume()
public void onPause()
public void onStart()
public void onStop()
public void onMessagesReceived(Conversation conversation, java.util.List<Message> messages)
Conversation.Delegate
Called when new messages are received from the server.
onMessagesReceived
in interface Conversation.Delegate
conversation
- The conversation object.messages
- A list of Message objects representing the new messages.public void onUnreadCountChanged(Conversation conversation, int unreadCount)
Conversation.Delegate
Called when conversation data is fetched from the server, or when the user enters the conversation activity.
onUnreadCountChanged
in interface Conversation.Delegate
conversation
- The conversation objectunreadCount
- The count of unread messagespublic void onMessagesReset(Conversation conversation, java.util.List<Message> messages)
Conversation.Delegate
Called when new messages are received from the server that do not match locally stored cache.
onMessagesReset
in interface Conversation.Delegate
conversation
- The conversation object.messages
- A list of Message objects representing the new messages.public void onMessageSent(Message message, MessageUploadStatus status)
Conversation.Delegate
Called once the message has been sent successfully or not.
onMessageSent
in interface Conversation.Delegate
message
- The message that was sentstatus
- The status of the message that was sentMessageUploadStatus
public void onConversationEventReceived(ConversationEvent conversationEvent)
Conversation.Delegate
Called when a new activity is received from the server
onConversationEventReceived
in interface Conversation.Delegate
conversationEvent
- The conversationActivity that was receivedConversationEventType
public void onInitializationStatusChanged(InitializationStatus status)
Conversation.Delegate
onInitializationStatusChanged
in interface Conversation.Delegate
status
- The new statusInitializationStatus
public void onLoginComplete(LoginResult result)
Conversation.Delegate
Bots.login(String, String, BotsCallback)
is completeonLoginComplete
in interface Conversation.Delegate
result
- The login resultLoginResult
public void onLogoutComplete(LogoutResult result)
Conversation.Delegate
Bots.logout(BotsCallback)
is completeonLogoutComplete
in interface Conversation.Delegate
result
- The logout resultLogoutResult
public void onPaymentProcessed(MessageAction messageAction, PaymentStatus status)
Conversation.Delegate
onPaymentProcessed
in interface Conversation.Delegate
messageAction
- The purchased message actionstatus
- The status of the paymentMessageAction
,
PaymentStatus
public boolean shouldTriggerAction(MessageAction messageAction)
Conversation.Delegate
Called when the user taps a message action.
shouldTriggerAction
in interface Conversation.Delegate
messageAction
- The message action that was tapped.MessageAction
public void onCardSummaryLoaded(CardSummary cardSummary)
Conversation.Delegate
Called when the stripe card info is loaded.
onCardSummaryLoaded
in interface Conversation.Delegate
cardSummary
- The stripe card information.CardSummary
public void onBotsConnectionStatusChanged(BotsConnectionStatus status)
Conversation.Delegate
Called when the user's connection to Bots changes.
onBotsConnectionStatusChanged
in interface Conversation.Delegate
status
- The connection status.BotsConnectionStatus
public void onBotsShown()
Conversation.Delegate
onBotsShown
in interface Conversation.Delegate
public void onBotsHidden()
Conversation.Delegate
onBotsHidden
in interface Conversation.Delegate
public void onStripeFragmentShown()
public void onStripeFragmentClose()
public void onPurchaseComplete()
public void onShadedAreaClick()
public void onWebviewShown()
public void onWebviewHidden()