// Path: 2016-06-15_hot_and_cold/app/src/main/java/com/gdgand/rxjava/rxjavasample/hotandcold/presentation/hotandcold/adapter/HotAndColdAdapter.java
// public class HotAndColdAdapter extends RecyclerView.Adapter<HotAndColdAdapter.ViewHolder> {
// 
//     private Context context;
//     private List<String> items = new ArrayList<>();
// 
//     public HotAndColdAdapter(Context context) {
//         this.context = context;
//     }
// 
//     public void clearItems() {
//         this.items = new ArrayList<>();
//         notifyDataSetChanged();
//     }
// 
//     public void addItem(String item) {
//         items.add(item);
//         notifyDataSetChanged();
//     }
// 
//     @Override
//     public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//         View view = LayoutInflater.from(context).inflate(R.layout.item_hot_and_cold, parent, false);
//         return new ViewHolder(view);
//     }
// 
//     @Override
//     public void onBindViewHolder(ViewHolder holder, int position) {
//         holder.textViewItem.setText(getItem(position));
//     }
// 
//     public String getItem(int position) {
//         return items.get(position);
//     }
// 
//     @Override
//     public int getItemCount() {
//         return items.size();
//     }
// 
//     static class ViewHolder extends RecyclerView.ViewHolder {
// 
//         @BindView(R.id.textViewItem)
//         TextView textViewItem;
// 
//         public ViewHolder(View itemView) {
//             super(itemView);
//             ButterKnife.bind(this, itemView);
//         }
//     }
// }


import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.RadioGroup;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.gdgand.rxjava.rxjavasample.hotandcold.R;
import com.gdgand.rxjava.rxjavasample.hotandcold.presentation.hotandcold.adapter.HotAndColdAdapter;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.subjects.ReplaySubject;
import java.util.Random;
package com.gdgand.rxjava.rxjavasample.hotandcold.presentation.hotandcold;






/**
 * ReplaySubject 에서 Hot And Cold Observable 동작
 */
public class HotAndColdActivity extends AppCompatActivity {

	@BindView(R.id.radioGroup)
	RadioGroup radioGroup;

	@BindView(R.id.recyclerView1)
	RecyclerView recyclerView1;

	@BindView(R.id.recyclerView2)
	RecyclerView recyclerView2;

	ReplaySubject<Integer> subject = ReplaySubject.create();
// Path: 2016-06-15_hot_and_cold/app/src/main/java/com/gdgand/rxjava/rxjavasample/hotandcold/presentation/hotandcold/adapter/HotAndColdAdapter.java
// public class HotAndColdAdapter extends RecyclerView.Adapter<HotAndColdAdapter.ViewHolder> {
// 
//     private Context context;
//     private List<String> items = new ArrayList<>();
// 
//     public HotAndColdAdapter(Context context) {
//         this.context = context;
//     }
// 
//     public void clearItems() {
//         this.items = new ArrayList<>();
//         notifyDataSetChanged();
//     }
// 
//     public void addItem(String item) {
//         items.add(item);
//         notifyDataSetChanged();
//     }
// 
//     @Override
//     public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//         View view = LayoutInflater.from(context).inflate(R.layout.item_hot_and_cold, parent, false);
//         return new ViewHolder(view);
//     }
// 
//     @Override
//     public void onBindViewHolder(ViewHolder holder, int position) {
//         holder.textViewItem.setText(getItem(position));
//     }
// 
//     public String getItem(int position) {
//         return items.get(position);
//     }
// 
//     @Override
//     public int getItemCount() {
//         return items.size();
//     }
// 
//     static class ViewHolder extends RecyclerView.ViewHolder {
// 
//         @BindView(R.id.textViewItem)
//         TextView textViewItem;
// 
//         public ViewHolder(View itemView) {
//             super(itemView);
//             ButterKnife.bind(this, itemView);
//         }
//     }
// }


// Path: 2016-06-15_hot_and_cold/app/src/main/java/com/gdgand/rxjava/rxjavasample/hotandcold/presentation/hotandcold/HotAndColdActivity.java
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.RadioGroup;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.gdgand.rxjava.rxjavasample.hotandcold.R;
import com.gdgand.rxjava.rxjavasample.hotandcold.presentation.hotandcold.adapter.HotAndColdAdapter;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.subjects.ReplaySubject;
import java.util.Random;

package com.gdgand.rxjava.rxjavasample.hotandcold.presentation.hotandcold;






/**
 * ReplaySubject 에서 Hot And Cold Observable 동작
 */
public class HotAndColdActivity extends AppCompatActivity {

	@BindView(R.id.radioGroup)
	RadioGroup radioGroup;

	@BindView(R.id.recyclerView1)
	RecyclerView recyclerView1;

	@BindView(R.id.recyclerView2)
	RecyclerView recyclerView2;

	ReplaySubject<Integer> subject = ReplaySubject.create();
	HotAndColdAdapter adapter1;