@Override public void onFailure(ApiResponse apiResponse, Exception exception) { String error = getString(Utils.isInternetAvailable(getActivity()) ? R.string.applozic_server_error : R.string.you_need_network_access_for_block_or_unblock); Toast toast = Toast.makeText(getActivity(), error, Toast.LENGTH_LONG); toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); }
public void userBlockDialog(final boolean block, final Contact withUserContact, final boolean isFromChannel) { if (withUserContact == null) { return; } AlertDialog.Builder alertDialog = new AlertDialog.Builder(getActivity()). setPositiveButton(R.string.ok_alert, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { blockUserProcess(withUserContact.getUserId(), block, isFromChannel); } }); alertDialog.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { } }); String name = withUserContact.getDisplayName(); alertDialog.setMessage(getString(block ? R.string.user_block_info : R.string.user_un_block_info).replace("[name]", name)); alertDialog.setCancelable(true); alertDialog.create().show(); }
protected AlertDialog showInviteDialog(int titleId, int messageId) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage(getString(messageId).replace("[name]", getNameForInviteDialog())) .setTitle(titleId); builder.setPositiveButton(R.string.invite, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent share = new Intent(Intent.ACTION_SEND); /* String textToShare = getActivity().getResources().getString(R.string.invite_message); share.setAction(Intent.ACTION_SEND) .setType("text/plain").putExtra(Intent.EXTRA_TEXT, textToShare);*/ startActivity(Intent.createChooser(share, "Share Via")); sendType.setSelection(0); } }); builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { sendType.setSelection(0); } }); AlertDialog dialog = builder.create(); dialog.show(); return dialog; }
startActivity(Intent.createChooser(shareIntent, getString(R.string.send_message_to))); break; if (message.getGroupId() != null) { if (MobiComUserPreference.getInstance(getActivity()).getUserId().equals(message.getContactIds()) || TextUtils.isEmpty(message.getContactIds())) { displayName = getString(R.string.you_string); } else { displayName = appContactService.getContactById(message.getContactIds()).getDisplayName(); displayName = getString(R.string.you_string); } else { displayName = appContactService.getContactById(message.getContactIds()).getDisplayName(); imageViewForAttachmentType.setImageResource(R.drawable.applozic_ic_image_camera_alt); if (TextUtils.isEmpty(message.getMessage())) { messageTextView.setText(getString(R.string.photo_string)); } else { messageTextView.setText(message.getMessage()); messageTextView.setText(getString(R.string.video_string)); } else { messageTextView.setText(message.getMessage()); imageViewForAttachmentType.setImageResource(R.drawable.applozic_ic_music_note); if (TextUtils.isEmpty(message.getMessage())) { messageTextView.setText(getString(R.string.audio_string)); } else { messageTextView.setText(message.getMessage());
startActivity(Intent.createChooser(shareIntent, getString(R.string.send_message_to))); break; if (message.getGroupId() != null) { if (MobiComUserPreference.getInstance(getActivity()).getUserId().equals(message.getContactIds()) || TextUtils.isEmpty(message.getContactIds())) { displayName = getString(R.string.you_string); } else { displayName = appContactService.getContactById(message.getContactIds()).getDisplayName(); displayName = getString(R.string.you_string); } else { displayName = appContactService.getContactById(message.getContactIds()).getDisplayName(); imageViewForAttachmentType.setImageResource(R.drawable.applozic_ic_image_camera_alt); if (TextUtils.isEmpty(message.getMessage())) { messageTextView.setText(getString(R.string.photo_string)); } else { messageTextView.setText(message.getMessage()); messageTextView.setText(getString(R.string.video_string)); } else { messageTextView.setText(message.getMessage()); imageViewForAttachmentType.setImageResource(R.drawable.applozic_ic_music_note); if (TextUtils.isEmpty(message.getMessage())) { messageTextView.setText(getString(R.string.audio_string)); } else { messageTextView.setText(message.getMessage());
if (!TextUtils.isEmpty(channelUserMapper.getUserKey())) { if (MobiComUserPreference.getInstance(getActivity()).getUserId().equals(channelUserMapper.getUserKey())) { youString = getString(R.string.you_string); } else { stringBuffer.append(contactDisplayName.getDisplayName()).append(",");