// Path: MyApplication/app/src/main/java/com/example/administrator/myapplication/activity/simple/dummy/DummyContent.java
// public class DummyContent {
// 
//     /**
//      * An array of sample (dummy) items.
//      */
//     public static final List<DummyItem> ITEMS = new ArrayList<DummyItem>();
// 
//     /**
//      * A map of sample (dummy) items, by ID.
//      */
//     public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
// 
//     private static final int COUNT = 25;
// 
//     static {
//         // Add some sample items.
//         for (int i = 1; i <= COUNT; i++) {
//             addItem(createDummyItem(i));
//         }
//     }
// 
//     private static void addItem(DummyItem item) {
//         ITEMS.add(item);
//         ITEM_MAP.put(item.id, item);
//     }
// 
//     private static DummyItem createDummyItem(int position) {
//         return new DummyItem(String.valueOf(position), "Item " + position, makeDetails(position));
//     }
// 
//     private static String makeDetails(int position) {
//         StringBuilder builder = new StringBuilder();
//         builder.append("Details about Item: ").append(position);
//         for (int i = 0; i < position; i++) {
//             builder.append("\nMore details information here.");
//         }
//         return builder.toString();
//     }
// 
//     /**
//      * A dummy item representing a piece of content.
//      */
//     public static class DummyItem {
//         public final String id;
//         public final String content;
//         public final String details;
// 
//         public DummyItem(String id, String content, String details) {
//             this.id = id;
//             this.content = content;
//             this.details = details;
//         }
// 
//         @Override
//         public String toString() {
//             return content;
//         }
//     }
// }


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.example.administrator.myapplication.R;
import com.example.administrator.myapplication.activity.simple.dummy.DummyContent;
import java.util.List;
package com.example.administrator.myapplication.activity.simple;





/**
 * An activity representing a list of Items. This activity
 * has different presentations for handset and tablet-size devices. On
 * handsets, the activity presents a list of items, which when touched,
 * lead to a {@link ItemDetailActivity} representing
 * item details. On tablets, the activity presents the list of items and
 * item details side-by-side using two vertical panes.
 */
public class ItemListActivity extends AppCompatActivity {

    /**
     * Whether or not the activity is in two-pane mode, i.e. running on a tablet
     * device.
     */
    private boolean mTwoPane;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_item_list);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        toolbar.setTitle(getTitle());

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });

        View recyclerView = findViewById(R.id.item_list);
        assert recyclerView != null;
        setupRecyclerView((RecyclerView) recyclerView);

        if (findViewById(R.id.item_detail_container) != null) {
            // The detail container view will be present only in the
            // large-screen layouts (res/values-w900dp).
            // If this view is present, then the
            // activity should be in two-pane mode.
            mTwoPane = true;
        }
    }

    private void setupRecyclerView(@NonNull RecyclerView recyclerView) {
// Path: MyApplication/app/src/main/java/com/example/administrator/myapplication/activity/simple/dummy/DummyContent.java
// public class DummyContent {
// 
//     /**
//      * An array of sample (dummy) items.
//      */
//     public static final List<DummyItem> ITEMS = new ArrayList<DummyItem>();
// 
//     /**
//      * A map of sample (dummy) items, by ID.
//      */
//     public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
// 
//     private static final int COUNT = 25;
// 
//     static {
//         // Add some sample items.
//         for (int i = 1; i <= COUNT; i++) {
//             addItem(createDummyItem(i));
//         }
//     }
// 
//     private static void addItem(DummyItem item) {
//         ITEMS.add(item);
//         ITEM_MAP.put(item.id, item);
//     }
// 
//     private static DummyItem createDummyItem(int position) {
//         return new DummyItem(String.valueOf(position), "Item " + position, makeDetails(position));
//     }
// 
//     private static String makeDetails(int position) {
//         StringBuilder builder = new StringBuilder();
//         builder.append("Details about Item: ").append(position);
//         for (int i = 0; i < position; i++) {
//             builder.append("\nMore details information here.");
//         }
//         return builder.toString();
//     }
// 
//     /**
//      * A dummy item representing a piece of content.
//      */
//     public static class DummyItem {
//         public final String id;
//         public final String content;
//         public final String details;
// 
//         public DummyItem(String id, String content, String details) {
//             this.id = id;
//             this.content = content;
//             this.details = details;
//         }
// 
//         @Override
//         public String toString() {
//             return content;
//         }
//     }
// }


// Path: MyApplication/app/src/main/java/com/example/administrator/myapplication/activity/simple/ItemListActivity.java
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.example.administrator.myapplication.R;
import com.example.administrator.myapplication.activity.simple.dummy.DummyContent;
import java.util.List;

package com.example.administrator.myapplication.activity.simple;





/**
 * An activity representing a list of Items. This activity
 * has different presentations for handset and tablet-size devices. On
 * handsets, the activity presents a list of items, which when touched,
 * lead to a {@link ItemDetailActivity} representing
 * item details. On tablets, the activity presents the list of items and
 * item details side-by-side using two vertical panes.
 */
public class ItemListActivity extends AppCompatActivity {

    /**
     * Whether or not the activity is in two-pane mode, i.e. running on a tablet
     * device.
     */
    private boolean mTwoPane;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_item_list);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        toolbar.setTitle(getTitle());

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });

        View recyclerView = findViewById(R.id.item_list);
        assert recyclerView != null;
        setupRecyclerView((RecyclerView) recyclerView);

        if (findViewById(R.id.item_detail_container) != null) {
            // The detail container view will be present only in the
            // large-screen layouts (res/values-w900dp).
            // If this view is present, then the
            // activity should be in two-pane mode.
            mTwoPane = true;
        }
    }

    private void setupRecyclerView(@NonNull RecyclerView recyclerView) {
        recyclerView.setAdapter(new SimpleItemRecyclerViewAdapter(DummyContent.ITEMS));