// Path: wpp/app/src/main/java/adamin90/com/wpp/fragment/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: wpp/app/src/main/java/adamin90/com/wpp/fragment/dummy/DummyContent.java
// 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.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
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 adamin90.com.wpp.R;
import adamin90.com.wpp.fragment.dummy.DummyContent;
import adamin90.com.wpp.fragment.dummy.DummyContent.DummyItem;
import java.util.List;
package adamin90.com.wpp.fragment;




/**
 * A fragment representing a list of Items.
 * <p/>
 * Activities containing this fragment MUST implement the {@link OnListFragmentInteractionListener}
 * interface.
 */
public class ZhuanTiFragment extends Fragment {

    // TODO: Customize parameter argument names
    private static final String ARG_COLUMN_COUNT = "column-count";
    // TODO: Customize parameters
    private int mColumnCount = 1;
    private OnListFragmentInteractionListener mListener;

    /**
     * Mandatory empty constructor for the fragment manager to instantiate the
     * fragment (e.g. upon screen orientation changes).
     */
    public ZhuanTiFragment() {
    }

    // TODO: Customize parameter initialization
    @SuppressWarnings("unused")
    public static ZhuanTiFragment newInstance(int columnCount) {
        ZhuanTiFragment fragment = new ZhuanTiFragment();
        Bundle args = new Bundle();
        args.putInt(ARG_COLUMN_COUNT, columnCount);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (getArguments() != null) {
            mColumnCount = getArguments().getInt(ARG_COLUMN_COUNT);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_item_list, container, false);

        // Set the adapter
        if (view instanceof RecyclerView) {
            Context context = view.getContext();
            RecyclerView recyclerView = (RecyclerView) view;
//            if (mColumnCount <= 1) {
                recyclerView.setLayoutManager(new LinearLayoutManager(context));
//            } else {
//                recyclerView.setLayoutManager(new GridLayoutManager(context, mColumnCount));
//            }
// Path: wpp/app/src/main/java/adamin90/com/wpp/fragment/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: wpp/app/src/main/java/adamin90/com/wpp/fragment/dummy/DummyContent.java
// 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: wpp/app/src/main/java/adamin90/com/wpp/fragment/ZhuanTiFragment.java
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
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 adamin90.com.wpp.R;
import adamin90.com.wpp.fragment.dummy.DummyContent;
import adamin90.com.wpp.fragment.dummy.DummyContent.DummyItem;
import java.util.List;

package adamin90.com.wpp.fragment;




/**
 * A fragment representing a list of Items.
 * <p/>
 * Activities containing this fragment MUST implement the {@link OnListFragmentInteractionListener}
 * interface.
 */
public class ZhuanTiFragment extends Fragment {

    // TODO: Customize parameter argument names
    private static final String ARG_COLUMN_COUNT = "column-count";
    // TODO: Customize parameters
    private int mColumnCount = 1;
    private OnListFragmentInteractionListener mListener;

    /**
     * Mandatory empty constructor for the fragment manager to instantiate the
     * fragment (e.g. upon screen orientation changes).
     */
    public ZhuanTiFragment() {
    }

    // TODO: Customize parameter initialization
    @SuppressWarnings("unused")
    public static ZhuanTiFragment newInstance(int columnCount) {
        ZhuanTiFragment fragment = new ZhuanTiFragment();
        Bundle args = new Bundle();
        args.putInt(ARG_COLUMN_COUNT, columnCount);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (getArguments() != null) {
            mColumnCount = getArguments().getInt(ARG_COLUMN_COUNT);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_item_list, container, false);

        // Set the adapter
        if (view instanceof RecyclerView) {
            Context context = view.getContext();
            RecyclerView recyclerView = (RecyclerView) view;
//            if (mColumnCount <= 1) {
                recyclerView.setLayoutManager(new LinearLayoutManager(context));
//            } else {
//                recyclerView.setLayoutManager(new GridLayoutManager(context, mColumnCount));
//            }
            recyclerView.setAdapter(new MyItemRecyclerViewAdapter(DummyContent.ITEMS, mListener));