// Path: app/src/main/java/com/tyq/jiemian/bean/SearchItem.java
// public class SearchItem implements Serializable{
// 
//     private int return_count;
//     private int has_more;
//     private int offset;
// 
//     private List<DataEntity> data;
// 
//     public int getReturn_count() {
//         return return_count;
//     }
// 
//     public void setReturn_count(int return_count) {
//         this.return_count = return_count;
//     }
// 
//     public int getHas_more() {
//         return has_more;
//     }
// 
//     public void setHas_more(int has_more) {
//         this.has_more = has_more;
//     }
// 
//     public int getOffset() {
//         return offset;
//     }
// 
//     public void setOffset(int offset) {
//         this.offset = offset;
//     }
// 
//     public List<DataEntity> getData() {
//         return data;
//     }
// 
//     public void setData(List<DataEntity> data) {
//         this.data = data;
//     }
// 
//     public static class DataEntity implements Serializable{
//         private String title;
//         @SerializedName("abstract")
//         private String abstractX;
//         private String url;
//         private String datetime;
//         private String img_url;
// 
//         public String getTitle() {
//             return title;
//         }
// 
//         public void setTitle(String title) {
//             this.title = title;
//         }
// 
//         public String getAbstractX() {
//             return abstractX;
//         }
// 
//         public void setAbstractX(String abstractX) {
//             this.abstractX = abstractX;
//         }
// 
//         public String getUrl() {
//             return url;
//         }
// 
//         public void setUrl(String url) {
//             this.url = url;
//         }
// 
//         public String getDatetime() {
//             return datetime;
//         }
// 
//         public void setDatetime(String datetime) {
//             this.datetime = datetime;
//         }
// 
//         public String getImg_url() {
//             return img_url;
//         }
// 
//         public void setImg_url(String img_url) {
//             this.img_url = img_url;
//         }
//     }
// }
// 
// Path: app/src/main/java/com/tyq/jiemian/utils/Constant.java
// public class Constant {
//     public static final String TITLE = "title";
//     public static final String TECHNOLOGICAL_URL = "http://www.jiemian.com/lists/6.html";
//     public static final String ENTERTAINMENT_URL = "http://www.jiemian.com/lists/25.html";
//     public static final String NEWS_ITEM = "news_item";
//     public static final String NEWS_TITLE = "news_title";
//     public static final String Bmob_App_ID = "2cb3bdc19bf6e2240dbb8ae06a80cc24";
//     public static final String BASE_ZHIHU_URL = "http://news-at.zhihu.com/";
//     public static final String ITEM_ID = "item_id";
//     public static final String DB_NAME = "news_db";
//     public static final String NEWS_URL = "new_url";
//     public static final String POPULAR_NEWS_URL = "http://apis.baidu.com/3023/weixin/channel";
//     public static final String POPULAR_API_KEY = "891eeffe6f1b4652128542bb8c9971a2";
//     public static final String TRC_ROBOT_REC = "嗨,我是智能聊天机器人小er，聊两块钱的";
//     public static final String TRC_ROBOT_REST = "小er已经休息，请明天再聊。";
//     public static final String TRC_ROBOT_FAILED = "暂时无法回应";
//     public static final String TRC_KEY = "ae536b38aa743f17ecb5f0e65a8dfea9";
//     public static final String TRC_USER_ID = "diffey";
//     public static final String SEARCH_URL = "http://apis.baidu.com/songshuxiansheng/real_time/search_news";
//     public static final String SEARCH_ITEM = "search_item";
// }


import android.content.Context;
import android.databinding.DataBindingUtil;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.tyq.jiemian.R;
import com.tyq.jiemian.bean.SearchItem;
import com.tyq.jiemian.databinding.ItemSearchResultBinding;
import com.tyq.jiemian.utils.Constant;
import java.util.List;
package com.tyq.jiemian.adapter;




/**
 * Created by tyq on 2016/6/15.
 */
public class SearchResultAdapter extends RecyclerView.Adapter {

    private Context context;
    private LayoutInflater inflater;
    private SearchItem searchItem;

    public SearchResultAdapter(Context context,SearchItem searchItems) {
        inflater = LayoutInflater.from(context);
        this.searchItem = searchItems;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new ResultViewHolder(inflater.inflate(R.layout.item_search_result,parent,false));
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        if (holder instanceof ResultViewHolder){
            ResultViewHolder resultViewHolder = (ResultViewHolder) holder;
            resultViewHolder.updateUi(searchItem.getData().get(position));
        }
    }

    @Override
// Path: app/src/main/java/com/tyq/jiemian/bean/SearchItem.java
// public class SearchItem implements Serializable{
// 
//     private int return_count;
//     private int has_more;
//     private int offset;
// 
//     private List<DataEntity> data;
// 
//     public int getReturn_count() {
//         return return_count;
//     }
// 
//     public void setReturn_count(int return_count) {
//         this.return_count = return_count;
//     }
// 
//     public int getHas_more() {
//         return has_more;
//     }
// 
//     public void setHas_more(int has_more) {
//         this.has_more = has_more;
//     }
// 
//     public int getOffset() {
//         return offset;
//     }
// 
//     public void setOffset(int offset) {
//         this.offset = offset;
//     }
// 
//     public List<DataEntity> getData() {
//         return data;
//     }
// 
//     public void setData(List<DataEntity> data) {
//         this.data = data;
//     }
// 
//     public static class DataEntity implements Serializable{
//         private String title;
//         @SerializedName("abstract")
//         private String abstractX;
//         private String url;
//         private String datetime;
//         private String img_url;
// 
//         public String getTitle() {
//             return title;
//         }
// 
//         public void setTitle(String title) {
//             this.title = title;
//         }
// 
//         public String getAbstractX() {
//             return abstractX;
//         }
// 
//         public void setAbstractX(String abstractX) {
//             this.abstractX = abstractX;
//         }
// 
//         public String getUrl() {
//             return url;
//         }
// 
//         public void setUrl(String url) {
//             this.url = url;
//         }
// 
//         public String getDatetime() {
//             return datetime;
//         }
// 
//         public void setDatetime(String datetime) {
//             this.datetime = datetime;
//         }
// 
//         public String getImg_url() {
//             return img_url;
//         }
// 
//         public void setImg_url(String img_url) {
//             this.img_url = img_url;
//         }
//     }
// }
// 
// Path: app/src/main/java/com/tyq/jiemian/utils/Constant.java
// public class Constant {
//     public static final String TITLE = "title";
//     public static final String TECHNOLOGICAL_URL = "http://www.jiemian.com/lists/6.html";
//     public static final String ENTERTAINMENT_URL = "http://www.jiemian.com/lists/25.html";
//     public static final String NEWS_ITEM = "news_item";
//     public static final String NEWS_TITLE = "news_title";
//     public static final String Bmob_App_ID = "2cb3bdc19bf6e2240dbb8ae06a80cc24";
//     public static final String BASE_ZHIHU_URL = "http://news-at.zhihu.com/";
//     public static final String ITEM_ID = "item_id";
//     public static final String DB_NAME = "news_db";
//     public static final String NEWS_URL = "new_url";
//     public static final String POPULAR_NEWS_URL = "http://apis.baidu.com/3023/weixin/channel";
//     public static final String POPULAR_API_KEY = "891eeffe6f1b4652128542bb8c9971a2";
//     public static final String TRC_ROBOT_REC = "嗨,我是智能聊天机器人小er，聊两块钱的";
//     public static final String TRC_ROBOT_REST = "小er已经休息，请明天再聊。";
//     public static final String TRC_ROBOT_FAILED = "暂时无法回应";
//     public static final String TRC_KEY = "ae536b38aa743f17ecb5f0e65a8dfea9";
//     public static final String TRC_USER_ID = "diffey";
//     public static final String SEARCH_URL = "http://apis.baidu.com/songshuxiansheng/real_time/search_news";
//     public static final String SEARCH_ITEM = "search_item";
// }


// Path: app/src/main/java/com/tyq/jiemian/adapter/SearchResultAdapter.java
import android.content.Context;
import android.databinding.DataBindingUtil;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.tyq.jiemian.R;
import com.tyq.jiemian.bean.SearchItem;
import com.tyq.jiemian.databinding.ItemSearchResultBinding;
import com.tyq.jiemian.utils.Constant;
import java.util.List;

package com.tyq.jiemian.adapter;




/**
 * Created by tyq on 2016/6/15.
 */
public class SearchResultAdapter extends RecyclerView.Adapter {

    private Context context;
    private LayoutInflater inflater;
    private SearchItem searchItem;

    public SearchResultAdapter(Context context,SearchItem searchItems) {
        inflater = LayoutInflater.from(context);
        this.searchItem = searchItems;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new ResultViewHolder(inflater.inflate(R.layout.item_search_result,parent,false));
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        if (holder instanceof ResultViewHolder){
            ResultViewHolder resultViewHolder = (ResultViewHolder) holder;
            resultViewHolder.updateUi(searchItem.getData().get(position));
        }
    }

    @Override
    public int getItemCount() {