@@ -0,0 +1,2780 @@
+package pl.komunikator.komunikator.adapter;%0A%0Aimport android.support.v7.widget.RecyclerView;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.CheckBox;%0Aimport android.widget.ImageView;%0Aimport android.widget.TextView;%0A%0Aimport java.util.List;%0A%0Aimport pl.komunikator.komunikator.R;%0Aimport pl.komunikator.komunikator.entity.User;%0Aimport pl.komunikator.komunikator.viewHolder.EmptyViewHolder;%0A%0A/**%0A * Created by adrian on 22.05.2017.%0A */%0A%0Apublic class ConversationCreatorAdapter extends RecyclerView.Adapter %7B%0A%0A    private static final int NO_CONTACTS = 404;%0A    private List%3CUser%3E mContacts;%0A%0A    public ConversationCreatorAdapter(List%3CUser%3E contacts) %7B%0A        mContacts = contacts;%0A    %7D%0A%0A    @Override%0A    public int getItemCount() %7B%0A        int size = mContacts.size();%0A        if (size %3E 0) %7B%0A            return size;%0A        %7D else %7B%0A            size += 1;%0A            return size;%0A        %7D%0A    %7D%0A%0A    @Override%0A    public int getItemViewType(int position) %7B%0A        if (mContacts.size() == 0) %7B%0A            return NO_CONTACTS;%0A        %7D else %7B%0A            return super.getItemViewType(position);%0A        %7D%0A    %7D%0A%0A    public class CheckBoxedContactViewHolder extends RecyclerView.ViewHolder %7B%0A%0A        public TextView nameTextView, emailTextView;%0A        public ImageView avatarImageView;%0A        public CheckBox checkBox;%0A%0A        public CheckBoxedContactViewHolder(View view) %7B%0A            super(view);%0A%0A            nameTextView = (TextView) view.findViewById(R.id.contactName);%0A            emailTextView = (TextView) view.findViewById(R.id.contactEmail);%0A            avatarImageView = (ImageView) view.findViewById(R.id.contactImageView);%0A            checkBox = (CheckBox) view.findViewById(R.id.contactCheckBox);%0A        %7D%0A%0A    %7D%0A%0A    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) %7B%0A        LayoutInflater inflater = LayoutInflater.from(parent.getContext());%0A        View view;%0A%0A        if (viewType == NO_CONTACTS) %7B%0A            view = inflater.inflate(R.layout.item_no_results, parent, false);%0A            return new EmptyViewHolder(view);%0A        %7D else %7B%0A            view = inflater.inflate(R.layout.item_contact_checkbox, parent, false);%0A            return new CheckBoxedContactViewHolder(view);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) %7B%0A%0A        if (getItemViewType(position) == NO_CONTACTS) %7B%0A            return;%0A        %7D%0A%0A        User contact = mContacts.get(position);%0A%0A        CheckBoxedContactViewHolder viewHolder = (CheckBoxedContactViewHolder) holder;%0A        viewHolder.nameTextView.setText(contact.getUsername());%0A        viewHolder.emailTextView.setText(contact.getEmail());%0A    %7D%0A%0A%7D%0A

Implement an adapter for checkBoxed contacts