private void setActiveConversation(@Nullable Conversation conversation) { checkConversationQueue(); // we should only access the conversation on a dedicated queue this.activeConversation = conversation; this.activeConversationProxy = conversation != null ? new ConversationProxy(conversation) : null; }
conversation.setMessageCenterPendingMessage(null); else if (!StringUtils.isNullOrEmpty(conversation.getMessageCenterPendingMessage())) { String messageText = conversation.getMessageCenterPendingMessage(); if (messageText != null && this.composerEditText != null) { this.composerEditText.setText(messageText); conversation.setMessageCenterPendingMessage(null);
String interactionIdToLaunch = null; for (Invocation invocation : invocations) { FieldManager fieldManager = new FieldManager(getContext(), getConversation().getVersionHistory(), getConversation().getEventData(), getConversation().getPerson(), getConversation().getDevice(), getConversation().getAppRelease()); if (invocation.isCriteriaMet(fieldManager, false)) { // TODO: should we print details here as well? interactionIdToLaunch = invocation.getInteractionId(); ConversationProxy conversation = getConversation(); if (conversation != null) { String interactionsString = conversation.getInteractions(); if (interactionsString != null) { try {
@Override public void onFinishComposing() { messagingActionHandler.sendEmptyMessage(MSG_REMOVE_COMPOSER); Util.hideSoftKeyboard(hostingActivityRef.get(), getView()); messagingActionHandler.sendEmptyMessage(MSG_SEND_PENDING_CONTEXT_MESSAGE); if (!TextUtils.isEmpty(composerEditText.getText().toString().trim()) || pendingAttachments.size() > 0) { CompoundMessage compoundMessage = new CompoundMessage(); compoundMessage.setBody(composerEditText.getText().toString().trim()); compoundMessage.setRead(true); compoundMessage.setCustomData(ApptentiveInternal.getInstance().getAndClearCustomData()); compoundMessage.setAssociatedImages(new ArrayList<ImageItem>(pendingAttachments)); ConversationProxy conversation = getConversation(); if (conversation != null && conversation.hasActiveState()) { compoundMessage.setSenderId(conversation.getPerson().getId()); } messagingActionHandler.sendMessage(messagingActionHandler.obtainMessage(MSG_START_SENDING, compoundMessage)); composingViewSavedState = null; composerEditText.getText().clear(); pendingAttachments.clear(); clearPendingComposingMessage(); } showFab(); showProfileButton(); }
if (conversation != null && conversation.getMessageCenterPendingAttachments() != null) { String pendingAttachmentsString = conversation.getMessageCenterPendingAttachments(); JSONArray savedAttachmentsJsonArray = null; try { conversation.setMessageCenterPendingAttachments(null);
public void showAttachmentDialog(final ImageItem image) { if (image == null) { ApptentiveLog.d(MESSAGES, "No attachment argument."); return; } try { FragmentTransaction ft = getFragmentManager().beginTransaction(); Fragment prev = getFragmentManager().findFragmentByTag(DIALOG_IMAGE_PREVIEW); if (prev != null) { ft.remove(prev); } ft.addToBackStack(null); // Create and show the dialog. String conversationToken = getConversation().getConversationToken(); AttachmentPreviewDialog dialog = AttachmentPreviewDialog.newInstance(image, conversationToken); dialog.show(ft, DIALOG_IMAGE_PREVIEW); } catch (Exception e) { ApptentiveLog.e(MESSAGES, e, "Error loading attachment preview."); logException(e); } }
getConversation().addPayload(new SurveyResponsePayload(interaction, answers)); ApptentiveLog.i("Survey Submitted."); callListener(true);
public void setupUi() { ConversationProxy conversationProxy = ApptentiveInternal.getInstance().getConversationProxy(); assertNotNull(conversationProxy); if (conversationProxy != null) { String conversationToken = conversationProxy.getConversationToken(); imageBandAdapter = new ImageGridViewAdapter(getContext(), conversationToken, false); setAdapter(imageBandAdapter); } }