package com.example.avjindersinghsekhon.toodle;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.TextView;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {
    private RecyclerView mRecyclerView;
    private FloatingActionButton mAddToDoItemFAB;
    private ArrayList<ToDoItem> mToDoItemsArrayList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mToDoItemsArrayList = new ArrayList<>();
        android.support.v7.widget.Toolbar toolbar = (android.support.v7.widget.Toolbar)findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        mToDoItemsArrayList = new ArrayList<>();

        if(getSupportActionBar()!=null){
            getSupportActionBar().setElevation(0);
        }
        mAddToDoItemFAB = (FloatingActionButton)findViewById(R.id.addToDoItemFAB);
        mRecyclerView = (RecyclerView)findViewById(R.id.toDoRecyclerView);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        mRecyclerView.setAdapter(new BasicListAdapter(mToDoItemsArrayList));
    }

    public static class BasicListAdapter extends RecyclerView.Adapter<BasicListAdapter.ViewHolder>{
        private ArrayList<ToDoItem> items;

        @Override
        public BasicListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_layout, parent, false);
            return new ViewHolder(v);
        }

        @Override
        public void onBindViewHolder(BasicListAdapter.ViewHolder holder, int position) {
            ToDoItem item = items.get(position);
            holder.mCheckBox.setChecked(item.HasReminder());
            holder.mTextview.setText(item.getToDoText());

            holder.mView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Snackbar.make(v, "Clicked", Snackbar.LENGTH_SHORT);
                }
            });

        }

        @Override
        public int getItemCount() {
            return items.size();
        }

        BasicListAdapter(ArrayList<ToDoItem> items){

            this.items = items;
        }

        public static class ViewHolder extends RecyclerView.ViewHolder{

            View mView;
            CheckBox mCheckBox;
            TextView mTextview;
            public ViewHolder(View v){
                super(v);
                mView = v;
                mCheckBox = (CheckBox)v.findViewById(R.id.toDoListItemCheckBox);
                mTextview = (TextView)v.findViewById(R.id.toDoListItemTextview);
            }


        }
    }

}

@@ -509,16 +509,39 @@
 rayList;
+%0Aimport java.util.Date;
 %0A%0Apublic
@@ -1146,16 +1146,63 @@
 st%3C%3E();%0A
+        makeUpItems(mToDoItemsArrayList, 50);%0A%0A
 %0A       
@@ -1598,24 +1598,238 @@
 rrayList));%0A
+%0A    %7D%0A%0A    public void makeUpItems(ArrayList%3CToDoItem%3E items, int len)%7B%0A        for(int i=0; i%3Clen; i++)%7B%0A            ToDoItem item = new ToDoItem(%22%22+i, false, new Date());%0A            items.add(item);%0A        %7D%0A%0A
     %7D%0A%0A    p
@@ -2333,16 +2333,22 @@
  holder,
+ final
  int pos
@@ -2666,24 +2666,24 @@
 k(View v) %7B%0A
-
             
@@ -2716,16 +2716,25 @@
 Clicked%22
++position
 , Snackb

Set up RecyclerView, RecyclerView.Adapter and RecyclerView.ViewhHolder