use of com.applozic.mobicomkit.uiwidgets.conversation.fragment.ConversationFragment in project Applozic-Android-SDK by AppLozic.
the class ConversationUIService method getConversationFragment.
public ConversationFragment getConversationFragment() {
ConversationFragment conversationFragment = (ConversationFragment) UIService.getFragmentByTag(fragmentActivity, CONVERSATION_FRAGMENT);
if (conversationFragment == null) {
Contact contact = ((ConversationActivity) fragmentActivity).getContact();
Channel channel = ((ConversationActivity) fragmentActivity).getChannel();
Integer conversationId = ((ConversationActivity) fragmentActivity).getConversationId();
conversationFragment = ConversationFragment.newInstance(contact, channel, conversationId, null, null);
ConversationActivity.addFragment(fragmentActivity, conversationFragment, CONVERSATION_FRAGMENT);
}
return conversationFragment;
}
use of com.applozic.mobicomkit.uiwidgets.conversation.fragment.ConversationFragment in project Applozic-Android-SDK by AppLozic.
the class ConversationUIService method updateTypingStatus.
public void updateTypingStatus(String userId, String isTypingStatus) {
if (!BroadcastService.isIndividual()) {
return;
}
ConversationFragment conversationFragment = getConversationFragment();
Utils.printLog(fragmentActivity, TAG, "Received typing status for: " + userId);
if (conversationFragment != null && conversationFragment.getContact() != null && userId.equals(conversationFragment.getContact().getContactIds()) || conversationFragment.getChannel() != null) {
conversationFragment.updateUserTypingStatus(userId, isTypingStatus);
}
}
use of com.applozic.mobicomkit.uiwidgets.conversation.fragment.ConversationFragment in project Applozic-Android-SDK by AppLozic.
the class ConversationActivity method onBackPressed.
@Override
public void onBackPressed() {
if (isFromSearch()) {
return;
}
if (getSupportFragmentManager().getBackStackEntryCount() == 1) {
try {
Intent upIntent = ApplozicSetting.getInstance(this).getParentActivityIntent(this);
if (upIntent != null && isTaskRoot()) {
TaskStackBuilder.create(this).addNextIntentWithParentStack(upIntent).startActivities();
}
} catch (Exception e) {
e.printStackTrace();
}
this.finish();
return;
}
Boolean takeOrder = getIntent().getBooleanExtra(TAKE_ORDER, false);
ConversationFragment conversationFragment = (ConversationFragment) getSupportFragmentManager().findFragmentByTag(ConversationUIService.CONVERSATION_FRAGMENT);
if (conversationFragment != null && conversationFragment.isVisible() && (conversationFragment.multimediaPopupGrid.getVisibility() == View.VISIBLE)) {
conversationFragment.hideMultimediaOptionGrid();
return;
}
if (takeOrder && getSupportFragmentManager().getBackStackEntryCount() == 2) {
Intent upIntent = ApplozicSetting.getInstance(this).getParentActivityIntent(this);
if (upIntent != null && isTaskRoot()) {
TaskStackBuilder.create(this).addNextIntentWithParentStack(upIntent).startActivities();
}
ConversationActivity.this.finish();
} else if (getSupportFragmentManager().getBackStackEntryCount() > 1) {
getSupportFragmentManager().popBackStack();
} else {
super.onBackPressed();
}
}
use of com.applozic.mobicomkit.uiwidgets.conversation.fragment.ConversationFragment in project Applozic-Android-SDK by AppLozic.
the class ConversationUIService method updateMessageKeyString.
public void updateMessageKeyString(Message message) {
if (!BroadcastService.isIndividual()) {
return;
}
String userId = message.getContactIds();
ConversationFragment conversationFragment = getConversationFragment();
if (conversationFragment != null && !TextUtils.isEmpty(userId) && conversationFragment.getContact() != null && userId.equals(conversationFragment.getContact().getUserId()) || conversationFragment.getCurrentChannelKey(message.getGroupId())) {
conversationFragment.updateMessageKeyString(message);
}
}
use of com.applozic.mobicomkit.uiwidgets.conversation.fragment.ConversationFragment in project Applozic-Android-SDK by AppLozic.
the class ConversationUIService method updateLastSeenStatus.
public void updateLastSeenStatus(String contactId) {
if (BroadcastService.isQuick() && getQuickConversationFragment() != null) {
getQuickConversationFragment().updateLastSeenStatus(contactId);
return;
}
if (BroadcastService.isIndividual()) {
final ConversationFragment conversationFragment = getConversationFragment();
if (conversationFragment != null && conversationFragment.getContact() != null && contactId.equals(conversationFragment.getContact().getContactIds()) || conversationFragment.getChannel() != null) {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
conversationFragment.updateLastSeenStatus();
}
});
thread.setPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
thread.start();
}
}
}
Aggregations