android recyclerview group by date code example

Example 1: group recyclerview list by date in android studio

public abstract class ListObject {
        public static final int TYPE_DATE = 0;
        public static final int TYPE_GENERAL_RIGHT = 1;
        public static final int TYPE_GENERAL_LEFT = 2;

        abstract public int getType(int userId);
    }

Example 2: group recyclerview list by date in android studio

public class ChatLeftViewHolder extends RecyclerView.ViewHolder {
        private final String TAG = ChatRightViewHolder.class.getSimpleName();

        public ChatLeftViewHolder(View itemView) {
            super(itemView);
            //TODO initialize your xml views
        }

        public void bind(final ChatModel chatModel) {
            //TODO set data to xml view via textivew.setText();
        }
    }

Tags:

Misc Example