// Path: app/src/main/java/com/lqr/materialdesigndemo/adapter/MyAdapter.java
// public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyViewHolder> {
// 
//     private List<String> mData;
// 
//     public MyAdapter(List<String> data) {
//         mData = data;
//     }
// 
//     @Override
//     public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//         View itemView = View.inflate(parent.getContext(), android.R.layout.simple_list_item_1, null);
//         itemView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
//         return new MyViewHolder(itemView);
//     }
// 
//     @Override
//     public void onBindViewHolder(MyViewHolder holder, int position) {
//         holder.mTv.setText(mData.get(position));
//     }
// 
//     @Override
//     public int getItemCount() {
//         return mData.size();
//     }
// 
//     class MyViewHolder extends RecyclerView.ViewHolder {
// 
//         TextView mTv;
// 
//         public MyViewHolder(View itemView) {
//             super(itemView);
//             mTv = (TextView) itemView.findViewById(android.R.id.text1);
//         }
//     }
// 
// }
// 
// Path: app/src/main/java/com/lqr/materialdesigndemo/adapter/MyStaggeredAdapter.java
// public class MyStaggeredAdapter extends RecyclerView.Adapter<MyStaggeredAdapter.MyViewHolder> {
// 
//     private List<String> mData;
//     private Random mRandom = new Random();
// 
//     public MyStaggeredAdapter(List<String> data) {
//         mData = data;
//     }
// 
//     @Override
//     public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
// //        LayoutInflater layoutInflater = (LayoutInflater) parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// //        View itemView = LayoutInflater.from(parent.getContext()).inflate(android.R.layout.simple_list_item_1,parent,false);
//         View itemView = View.inflate(parent.getContext(), R.layout.item_layout, null);
//         return new MyViewHolder(itemView);
//     }
// 
//     @Override
//     public void onBindViewHolder(MyViewHolder holder, int position) {
// //        ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, mRandom.nextInt(200) + 200);
//         ViewGroup.LayoutParams params = holder.mTv.getLayoutParams();
//         Log.e("CSDN_LQR", "params == null : " + (params == null));
//         params.height = mRandom.nextInt(200) + 200;
//         holder.mTv.setLayoutParams(params);
//         holder.mTv.setBackgroundColor(Color.argb(255, 180 + mRandom.nextInt(60) + 30, 180 + mRandom.nextInt(60) + 30, 180 + mRandom.nextInt(60) + 30));
//         holder.mTv.setText(mData.get(position));
//     }
// 
//     @Override
//     public int getItemCount() {
//         return mData.size();
//     }
// 
//     class MyViewHolder extends RecyclerView.ViewHolder {
// 
//         TextView mTv;
// 
//         public MyViewHolder(View itemView) {
//             super(itemView);
//             mTv = (TextView) itemView.findViewById(android.R.id.text1);
//         }
//     }
// 
// }


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import com.lqr.materialdesigndemo.R;
import com.lqr.materialdesigndemo.adapter.MyAdapter;
import com.lqr.materialdesigndemo.adapter.MyStaggeredAdapter;
import java.util.ArrayList;
import java.util.List;
package com.lqr.materialdesigndemo.activity;





public class RecyclerViewActivity extends AppCompatActivity {

    private List<String> mData = new ArrayList<>();
    private RecyclerView mRv;
// Path: app/src/main/java/com/lqr/materialdesigndemo/adapter/MyAdapter.java
// public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyViewHolder> {
// 
//     private List<String> mData;
// 
//     public MyAdapter(List<String> data) {
//         mData = data;
//     }
// 
//     @Override
//     public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//         View itemView = View.inflate(parent.getContext(), android.R.layout.simple_list_item_1, null);
//         itemView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
//         return new MyViewHolder(itemView);
//     }
// 
//     @Override
//     public void onBindViewHolder(MyViewHolder holder, int position) {
//         holder.mTv.setText(mData.get(position));
//     }
// 
//     @Override
//     public int getItemCount() {
//         return mData.size();
//     }
// 
//     class MyViewHolder extends RecyclerView.ViewHolder {
// 
//         TextView mTv;
// 
//         public MyViewHolder(View itemView) {
//             super(itemView);
//             mTv = (TextView) itemView.findViewById(android.R.id.text1);
//         }
//     }
// 
// }
// 
// Path: app/src/main/java/com/lqr/materialdesigndemo/adapter/MyStaggeredAdapter.java
// public class MyStaggeredAdapter extends RecyclerView.Adapter<MyStaggeredAdapter.MyViewHolder> {
// 
//     private List<String> mData;
//     private Random mRandom = new Random();
// 
//     public MyStaggeredAdapter(List<String> data) {
//         mData = data;
//     }
// 
//     @Override
//     public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
// //        LayoutInflater layoutInflater = (LayoutInflater) parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// //        View itemView = LayoutInflater.from(parent.getContext()).inflate(android.R.layout.simple_list_item_1,parent,false);
//         View itemView = View.inflate(parent.getContext(), R.layout.item_layout, null);
//         return new MyViewHolder(itemView);
//     }
// 
//     @Override
//     public void onBindViewHolder(MyViewHolder holder, int position) {
// //        ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, mRandom.nextInt(200) + 200);
//         ViewGroup.LayoutParams params = holder.mTv.getLayoutParams();
//         Log.e("CSDN_LQR", "params == null : " + (params == null));
//         params.height = mRandom.nextInt(200) + 200;
//         holder.mTv.setLayoutParams(params);
//         holder.mTv.setBackgroundColor(Color.argb(255, 180 + mRandom.nextInt(60) + 30, 180 + mRandom.nextInt(60) + 30, 180 + mRandom.nextInt(60) + 30));
//         holder.mTv.setText(mData.get(position));
//     }
// 
//     @Override
//     public int getItemCount() {
//         return mData.size();
//     }
// 
//     class MyViewHolder extends RecyclerView.ViewHolder {
// 
//         TextView mTv;
// 
//         public MyViewHolder(View itemView) {
//             super(itemView);
//             mTv = (TextView) itemView.findViewById(android.R.id.text1);
//         }
//     }
// 
// }


// Path: app/src/main/java/com/lqr/materialdesigndemo/activity/RecyclerViewActivity.java
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import com.lqr.materialdesigndemo.R;
import com.lqr.materialdesigndemo.adapter.MyAdapter;
import com.lqr.materialdesigndemo.adapter.MyStaggeredAdapter;
import java.util.ArrayList;
import java.util.List;

package com.lqr.materialdesigndemo.activity;





public class RecyclerViewActivity extends AppCompatActivity {

    private List<String> mData = new ArrayList<>();
    private RecyclerView mRv;
    private MyAdapter mMyAdapter;