public AppCompatActivity getAppComaptActivity() { if (activity instanceof AppCompatActivity) { return (AppCompatActivity) activity; } return super.getAppCompatActivity(); } }
@Override public void onMessageReceived(Message message) { if (conversationFragment != null) { conversationFragment.addMessage(message); } }
@Override public void onMessageDeleted(String messageKey, String userId) { if (conversationFragment != null) { conversationFragment.notifyAdapter(); } }
/** * This methods saves you a lot of work by check. Use this method in your bindView/getView. * * @param imageView CircularImageView to load the image * @param textView TextView to display AlphabeticImage */ public void loadProfileImage(CircleImageView imageView, TextView textView) { if (channel != null) { loadChannelImage(imageView, textView, channel); } else if (contact != null) { loadContactImage(imageView, textView, contact); } }
public ConversationViewHolder(View view) { super(view); alphabeticImage = view.findViewById(R.id.alphabeticImage); profileImage = view.findViewById(R.id.contactImage); receiverName = view.findViewById(R.id.smReceivers); messageTv = view.findViewById(R.id.message); unreadCount = view.findViewById(R.id.unreadSmsCount); createdAtTime = view.findViewById(R.id.createdAtTime); attachmentIcon = view.findViewById(R.id.attachmentIcon); properties = new AlMessageProperties(context); uiService = new AlUIService(context); view.setOnClickListener(this); view.setOnCreateContextMenuListener(this); }
@Override public void onClick(EditText editText) { if (attachmentView != null) { attachmentView.setVisibility(View.GONE); } }
@Override public void onClick(View v) { if (listener != null) { listener.onClick(editText); } } });
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { AlAttachmentOptions.handleAttachmentOptionsResult(requestCode, resultCode, data, this, "reytum6", null); }
public AlConversationAdapter(Context context, List<Message> mList) { super(context, mList); this.context = context; messageProperties = new AlMessageProperties(context); }
@Override public void onClick(View v) { if (listener != null) { listener.onAttachmentButtonClick(); } } });
@Override public Activity getActivity() { if (activity != null) { return activity; } return super.getActivity(); }
@Override public void onClick(View v) { if (listener != null) { listener.onSendButtonClicked(messageEditText); } } });
@Override public void onClick(View v) { if (listener != null) { listener.onRecordButtonClicked(); } } });
@Override public void onMessageMetadataUpdated(String keyString) { if (conversationFragment != null) { conversationFragment.notifyAdapter(); } } }
@Override public void onMessageSync(Message message, String key) { if (conversationFragment != null) { conversationFragment.addMessage(message); } }
@Override public void onAttachmentButtonClick() { if (attachmentView != null) { attachmentView.setVisibility(View.VISIBLE); } }
@Override public void onUserDetailUpdated(String userId) { if (conversationFragment != null) { conversationFragment.notifyAdapter(); } }
@Override public void onMessageSent(Message message) { if (conversationFragment != null) { conversationFragment.addMessage(message); } }
@Override public void onFocus(EditText editText, boolean hasFocus) { if (attachmentView != null) { attachmentView.setVisibility(View.GONE); } }
@Override public void onChannelUpdated() { if (conversationFragment != null) { conversationFragment.notifyAdapter(); } }