// Path: 2016-06-08_queue/app/src/main/java/com/gdgand/rxjava/rxjavasample/scroll/realm/FasterListData.java
// public class FasterListData extends RealmObject {
//     @PrimaryKey
//     private long position;
// 
//     public long getPosition() {
//         return position;
//     }
// 
//     public void setPosition(long position) {
//         this.position = position;
//     }
// }


import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.gdgand.rxjava.rxjavasample.R;
import com.gdgand.rxjava.rxjavasample.scroll.realm.FasterListData;
import java.util.ArrayList;
import java.util.List;
import io.realm.Realm;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
package com.gdgand.rxjava.rxjavasample.scroll.adapter;





public class FasterAdapter extends RecyclerView.Adapter<FasterListViewHolder> {

    private Context context;

    private List<String> list;

    public FasterAdapter(Context context) {
        this.context = context;
        list = new ArrayList<>();
    }

    @Override
    public FasterListViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_fasterlist, parent, false);
        return new FasterListViewHolder(view);
    }

    @Override
    public void onBindViewHolder(FasterListViewHolder holder, int position) {
        Observable.just(position)
                .subscribeOn(Schedulers.io())
                .map(index -> {

                    try {
                        Realm realm = Realm.getDefaultInstance();
// Path: 2016-06-08_queue/app/src/main/java/com/gdgand/rxjava/rxjavasample/scroll/realm/FasterListData.java
// public class FasterListData extends RealmObject {
//     @PrimaryKey
//     private long position;
// 
//     public long getPosition() {
//         return position;
//     }
// 
//     public void setPosition(long position) {
//         this.position = position;
//     }
// }


// Path: 2016-06-08_queue/app/src/main/java/com/gdgand/rxjava/rxjavasample/scroll/adapter/FasterAdapter.java
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.gdgand.rxjava.rxjavasample.R;
import com.gdgand.rxjava.rxjavasample.scroll.realm.FasterListData;
import java.util.ArrayList;
import java.util.List;
import io.realm.Realm;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

package com.gdgand.rxjava.rxjavasample.scroll.adapter;





public class FasterAdapter extends RecyclerView.Adapter<FasterListViewHolder> {

    private Context context;

    private List<String> list;

    public FasterAdapter(Context context) {
        this.context = context;
        list = new ArrayList<>();
    }

    @Override
    public FasterListViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_fasterlist, parent, false);
        return new FasterListViewHolder(view);
    }

    @Override
    public void onBindViewHolder(FasterListViewHolder holder, int position) {
        Observable.just(position)
                .subscribeOn(Schedulers.io())
                .map(index -> {

                    try {
                        Realm realm = Realm.getDefaultInstance();
                        long count = realm.where(FasterListData.class).greaterThanOrEqualTo("position", position)