public boolean onMenuItemClick(MenuItem menuItem) { int menuItemId = menuItem.getItemId(); if (menuItemId == R.id.profile) { JSONObject data = new JSONObject(); try { data.put("required", interaction.getWhoCardRequired()); data.put("trigger", "button"); } catch (JSONException e) { logException(e); } engageInternal(MessageCenterInteraction.EVENT_NAME_PROFILE_OPEN, data.toString()); boolean whoCardDisplayedBefore = wasWhoCardAsPreviouslyDisplayed(); forceShowKeyboard = true; addWhoCard(!whoCardDisplayedBefore); return true; } else { return false; } }
private boolean checkAddWhoCardIfRequired() { boolean whoCardDisplayedBefore = wasWhoCardAsPreviouslyDisplayed(); boolean addedWhoCard = false; if (interaction.getWhoCardRequestEnabled() && interaction.getWhoCardRequired()) { if (!whoCardDisplayedBefore) { forceShowKeyboard = true; addWhoCard(true); addedWhoCard = true; } else { String savedEmail = Apptentive.getPersonEmail(); if (TextUtils.isEmpty(savedEmail)) { forceShowKeyboard = true; addWhoCard(false); addedWhoCard = true; } } } if (addedWhoCard) { JSONObject data = new JSONObject(); try { data.put("required", interaction.getWhoCardRequired()); data.put("trigger", "automatic"); } catch (JSONException e) { logException(e); } engageInternal(MessageCenterInteraction.EVENT_NAME_PROFILE_OPEN, data.toString()); return true; } return false; }
@Override public void onCloseWhoCard(String buttonLabel) { JSONObject data = new JSONObject(); try { data.put("required", interaction.getWhoCardRequired()); data.put("button_label", buttonLabel); } catch (JSONException e) { logException(e); } engageInternal(MessageCenterInteraction.EVENT_NAME_PROFILE_CLOSE, data.toString()); setWhoCardAsPreviouslyDisplayed(); cleanupWhoCard(); if (shouldOpenComposerAfterClosingWhoCard()) { addComposingCard(); } else { showFab(); showProfileButton(); } }
@Override public void onSubmitWhoCard(String buttonLabel) { JSONObject data = new JSONObject(); try { data.put("required", interaction.getWhoCardRequired()); data.put("button_label", buttonLabel); } catch (JSONException e) { logException(e); } engageInternal(MessageCenterInteraction.EVENT_NAME_PROFILE_SUBMIT, data.toString()); setWhoCardAsPreviouslyDisplayed(); cleanupWhoCard(); if (shouldOpenComposerAfterClosingWhoCard()) { addComposingCard(); } else { showFab(); showProfileButton(); } }
JSONObject data = new JSONObject(); try { data.put("required", fragment.interaction.getWhoCardRequired()); data.put("trigger", "automatic"); } catch (JSONException e) {