public void showScheduleMessageToast() { if (this.getActivity() == null) { return; } getActivity().runOnUiThread(new Runnable() { public void run() { Toast.makeText(getActivity(), R.string.info_message_scheduled, Toast.LENGTH_SHORT).show(); } }); }
public void run() { Toast.makeText(getActivity(), R.string.info_message_scheduled, Toast.LENGTH_SHORT).show(); } });
public void updateMessage(final Message message) { if (this.getActivity() == null) { return; } this.getActivity().runOnUiThread(new Runnable() { @Override public void run() { //Note: Removing and adding the same message again as the new sms object will contain the keyString. messageList.remove(message); messageList.add(message); recyclerDetailConversationAdapter.notifyDataSetChanged(); } }); }
@Override public void onSuccess(ApiResponse apiResponse) { if (block && typingStarted) { if (getActivity() != null) { setToolbarSubtitle(""); } Intent intent = new Intent(getActivity(), ApplozicMqttIntentService.class); intent.putExtra(ApplozicMqttIntentService.CONTACT, contact); intent.putExtra(ApplozicMqttIntentService.STOP_TYPING, true); ApplozicMqttIntentService.enqueueWork(getActivity(), intent); } menu.findItem(R.id.userBlock).setVisible(!block); menu.findItem(R.id.userUnBlock).setVisible(block); }
public boolean onKey(View v, int keyCode, KeyEvent event) { if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) { Utils.toggleSoftKeyBoard(getActivity(), true); return true; } return false; } });
@Override public void onClick(View v) { getActivity().runOnUiThread(new Runnable() { @Override public void run() { recyclerView.smoothScrollToPosition(messageList.size()); recyclerView.getLayoutManager().scrollToPosition(messageList.size()); } }); } });
private void vibrate() { try { Vibrator v = (Vibrator) getActivity().getSystemService(Context.VIBRATOR_SERVICE); v.vibrate(200); } catch (Exception e) { e.printStackTrace(); } }
@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(); }
private void setToolbarTitle(String title) { ((CustomToolbarListener) getActivity()).setToolbarTitle(title); }
private void setToolbarImage(Contact contact, Channel channel) { ((CustomToolbarListener) getActivity()).setToolbarImage(contact, channel); }
@Override public void onClick(View v) { if (v.getId() == R.id.emoticons_btn) { if (emoticonsFrameLayout.getVisibility() == VISIBLE) { emoticonsFrameLayout.setVisibility(View.GONE); Utils.toggleSoftKeyBoard(getActivity(), false); } else { Utils.toggleSoftKeyBoard(getActivity(), true); emoticonsFrameLayout.setVisibility(VISIBLE); } } }
public void makePaymentForBooking(ALRichMessageModel model) { Intent intent = new Intent(getActivity(), PaymentActivity.class); intent.putExtra("formData", model.getFormData()); intent.putExtra("formAction", model.getFormAction()); getContext().startActivity(intent); } }
@Override public void onClick(View view) { if (alCustomizationSettings.isMessageFastScrollEnabled()) { getActivity().runOnUiThread(new Runnable() { @Override public void run() { linearLayoutManager.setStackFromEnd(true); linearLayoutManager.setReverseLayout(true); } }); } emoticonsFrameLayout.setVisibility(View.GONE); } });
@Override public void onClick(DialogInterface dialogInterface, int i) { new DeleteConversationAsyncTask(new MobiComConversationService(getActivity()), contact, channel, currentConversationId, getActivity()).execute(); } });
private void setToolbarSubtitle(String subtitle){ if ((alCustomizationSettings.isGroupSubtitleHidden() || ApplozicSetting.getInstance(getContext()).isGroupSubtitleHidden()) && channel != null && !subtitle.contains(getActivity().getString(R.string.is_typing))) { ((CustomToolbarListener)getActivity()).setToolbarSubtitle(""); return; } ((CustomToolbarListener) getActivity()).setToolbarSubtitle(subtitle); }
public void updateTitleForOpenGroup() { try { if (channel != null) { Channel newChannel = ChannelService.getInstance(getActivity()).getChannelByChannelKey(channel.getKey()); if (getActivity() != null) { setToolbarTitle(newChannel.getName()); } } updateChannelSubTitle(); } catch (Exception e) { e.printStackTrace(); } }
public void updateChannelTitle() { if (!Channel.GroupType.GROUPOFTWO.getValue().equals(channel.getType())) { Channel newChannel = ChannelService.getInstance(getActivity()).getChannelByChannelKey(channel.getKey()); if (newChannel != null && !TextUtils.isEmpty(channel.getName()) && !channel.getName().equals(newChannel.getName())) { title = ChannelUtils.getChannelTitleName(newChannel, MobiComUserPreference.getInstance(getActivity()).getUserId()); channel = newChannel; if (getActivity() != null) { setToolbarTitle(title); } } } }
@Override public void onClick(View v) { ConversationScheduler conversationScheduler = new ConversationScheduler(); conversationScheduler.setScheduleOption(scheduleOption); conversationScheduler.setScheduledTimeHolder(scheduledTimeHolder); conversationScheduler.setCancelable(false); conversationScheduler.show(getActivity().getSupportFragmentManager(), "conversationScheduler"); } }
@Override public void onDestroyView() { super.onDestroyView(); count = 0; t.cancel(); ((ConversationActivity) getActivity()).setChildFragmentLayoutBG(); ApplozicAudioManager.getInstance(getContext()).audiostop(); }
public void selfDestructMessage(Message message) { if (Message.MessageType.MT_INBOX.getValue().equals(message.getType()) && message.getTimeToLive() != null && message.getTimeToLive() != 0) { new Timer().schedule(new DisappearingMessageTask(getActivity(), conversationService, message), message.getTimeToLive() * 60 * 1000); } }