use of com.applozic.mobicomkit.api.conversation.MobiComConversationService in project Applozic-Android-SDK by AppLozic.
the class ConversationFragment method onCreateView.
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
this.title = getResources().getString(R.string.chats);
this.conversationService = new MobiComConversationService(getActivity());
hideExtendedSendingOptionLayout = true;
View view = super.onCreateView(inflater, container, savedInstanceState);
populateAttachmentOptions();
conversationCallbackHandler = new ConversationCallbackHandler(getContext(), this);
if (alCustomizationSettings.isHideAttachmentButton()) {
attachButton.setVisibility(View.GONE);
messageEditText.setPadding(20, 0, 0, 0);
}
sendType.setSelection(1);
messageEditText.setHint(R.string.enter_message_hint);
multimediaPopupGrid.setVisibility(View.GONE);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getActivity(), R.array.secret_message_timer_array, R.layout.mobiframework_custom_spinner);
adapter.setDropDownViewResource(R.layout.mobiframework_custom_spinner);
inputMethodManager = (InputMethodManager) getActivity().getSystemService(Activity.INPUT_METHOD_SERVICE);
messageEditText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
multimediaPopupGrid.setVisibility(View.GONE);
}
});
attachButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (contact != null && !contact.isBlocked() || channel != null) {
if (attachmentLayout.getVisibility() == View.VISIBLE) {
Toast.makeText(getActivity(), R.string.select_file_count_limit, Toast.LENGTH_LONG).show();
return;
}
}
if (channel != null) {
if (Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) {
String userId = ChannelService.getInstance(getActivity()).getGroupOfTwoReceiverUserId(channel.getKey());
if (!TextUtils.isEmpty(userId)) {
Contact withUserContact = appContactService.getContactById(userId);
if (withUserContact.isBlocked()) {
userBlockDialog(false, withUserContact, true);
} else {
processAttachButtonClick(view);
}
}
} else {
processAttachButtonClick(view);
}
} else if (contact != null) {
if (contact.isBlocked()) {
userBlockDialog(false, contact, false);
} else {
processAttachButtonClick(view);
}
}
}
});
return view;
}
use of com.applozic.mobicomkit.api.conversation.MobiComConversationService in project Applozic-Android-SDK by AppLozic.
the class ConversationUIService method deleteConversationThread.
public void deleteConversationThread(final Contact contact, final Channel channel) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(fragmentActivity).setPositiveButton(R.string.delete_conversation, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
AlTask.execute(new DeleteConversationAsyncTask(new MobiComConversationService(fragmentActivity), contact, channel, null, fragmentActivity));
}
});
alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
String name = "";
if (channel != null) {
if (Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) {
String userId = ChannelService.getInstance(fragmentActivity).getGroupOfTwoReceiverUserId(channel.getKey());
if (!TextUtils.isEmpty(userId)) {
Contact withUserContact = baseContactService.getContactById(userId);
name = withUserContact.getDisplayName();
}
} else {
name = ChannelUtils.getChannelTitleName(channel, MobiComUserPreference.getInstance(fragmentActivity).getUserId());
}
} else if (contact != null) {
name = contact.getDisplayName();
}
alertDialog.setTitle(fragmentActivity.getString(R.string.dialog_delete_conversation_title).replace("[name]", name));
alertDialog.setMessage(fragmentActivity.getString(R.string.dialog_delete_conversation_confir).replace("[name]", name));
alertDialog.setCancelable(true);
alertDialog.create().show();
}
Aggregations