Search in sources :

Example 1 with MediaPreviewAdapter

use of eu.siacs.conversations.ui.adapter.MediaPreviewAdapter in project Conversations by siacs.

the class ConversationFragment method onCreateView.

@Override
public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    this.binding = DataBindingUtil.inflate(inflater, R.layout.fragment_conversation, container, false);
    // TODO why the fuck did we do this?
    binding.getRoot().setOnClickListener(null);
    binding.textinput.addTextChangedListener(new StylingHelper.MessageEditorStyler(binding.textinput));
    binding.textinput.setOnEditorActionListener(mEditorActionListener);
    binding.textinput.setRichContentListener(new String[] { "image/*" }, mEditorContentListener);
    binding.textSendButton.setOnClickListener(this.mSendButtonListener);
    binding.scrollToBottomButton.setOnClickListener(this.mScrollButtonListener);
    binding.messagesView.setOnScrollListener(mOnScrollListener);
    binding.messagesView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
    mediaPreviewAdapter = new MediaPreviewAdapter(this);
    binding.mediaPreview.setAdapter(mediaPreviewAdapter);
    messageListAdapter = new MessageAdapter((XmppActivity) getActivity(), this.messageList);
    messageListAdapter.setOnContactPictureClicked(this);
    messageListAdapter.setOnContactPictureLongClicked(this);
    binding.messagesView.setAdapter(messageListAdapter);
    registerForContextMenu(binding.messagesView);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        this.binding.textinput.setCustomInsertionActionModeCallback(new EditMessageActionModeCallback(this.binding.textinput));
    }
    return binding.getRoot();
}
Also used : EditMessageActionModeCallback(eu.siacs.conversations.ui.util.EditMessageActionModeCallback) MessageAdapter(eu.siacs.conversations.ui.adapter.MessageAdapter) MediaPreviewAdapter(eu.siacs.conversations.ui.adapter.MediaPreviewAdapter) StylingHelper(eu.siacs.conversations.utils.StylingHelper)

Aggregations

MediaPreviewAdapter (eu.siacs.conversations.ui.adapter.MediaPreviewAdapter)1 MessageAdapter (eu.siacs.conversations.ui.adapter.MessageAdapter)1 EditMessageActionModeCallback (eu.siacs.conversations.ui.util.EditMessageActionModeCallback)1 StylingHelper (eu.siacs.conversations.utils.StylingHelper)1