// Path: parser/src/main/java/com/readium/r2_streamer/model/searcher/SearchResult.java
// public class SearchResult {
//     private int searchIndex;
//     private String resource;
//     private String title;
//     private String searchQuery;
//     private String matchString;
//     private String textBefore;
//     private String textAfter;
// 
//     public SearchResult() {
//     }
// 
//     public SearchResult(int searchIndex, String resource, String title, String searchQuery, String matchString, String textBefore, String textAfter) {
//         this.searchIndex = searchIndex;
//         this.resource = resource;
//         this.title = title;
//         this.searchQuery = searchQuery;
//         this.matchString = matchString;
//         this.textBefore = textBefore;
//         this.textAfter = textAfter;
//     }
// 
//     public int getSearchIndex() {
//         return searchIndex;
//     }
// 
//     public void setSearchIndex(int searchIndex) {
//         this.searchIndex = searchIndex;
//     }
// 
//     public String getResource() {
//         return resource;
//     }
// 
//     public void setResource(String resource) {
//         this.resource = resource;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public void setTitle(String title) {
//         this.title = title;
//     }
// 
//     public String getSearchQuery() {
//         return searchQuery;
//     }
// 
//     public void setSearchQuery(String searchQuery) {
//         this.searchQuery = searchQuery;
//     }
// 
//     public String getMatchString() {
//         return matchString;
//     }
// 
//     public void setMatchString(String matchString) {
//         this.matchString = matchString;
//     }
// 
//     public String getTextBefore() {
//         return textBefore;
//     }
// 
//     public void setTextBefore(String textBefore) {
//         this.textBefore = textBefore;
//     }
// 
//     public String getTextAfter() {
//         return textAfter;
//     }
// 
//     public void setTextAfter(String textAfter) {
//         this.textAfter = textAfter;
//     }
// }


import android.content.Context;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.readium.r2_streamer.model.searcher.SearchResult;
import com.readium.sample.R;
import java.util.List;
package com.readium.sample.adapters;




/**
 * Created by Shrikant Badwaik on 17-Feb-17.
 */

public class SearchListAdapter extends ArrayAdapter<String> {
    private Context context;
    private List<SearchResult> list;
    private TextView view_1, view_2;

    public SearchListAdapter(Context context, List<SearchResult> list) {
        super(context, 0);
        this.context = context;
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @NonNull
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LinearLayout layout = null;
        if (convertView == null) {
            LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            layout = (LinearLayout) layoutInflater.inflate(R.layout.searchlist_adapter_resource, null);
        } else {
            layout = (LinearLayout) convertView;
        }

        view_1 = (TextView) layout.findViewById(R.id.titleText);
        view_2 = (TextView) layout.findViewById(R.id.matchingText);

// Path: parser/src/main/java/com/readium/r2_streamer/model/searcher/SearchResult.java
// public class SearchResult {
//     private int searchIndex;
//     private String resource;
//     private String title;
//     private String searchQuery;
//     private String matchString;
//     private String textBefore;
//     private String textAfter;
// 
//     public SearchResult() {
//     }
// 
//     public SearchResult(int searchIndex, String resource, String title, String searchQuery, String matchString, String textBefore, String textAfter) {
//         this.searchIndex = searchIndex;
//         this.resource = resource;
//         this.title = title;
//         this.searchQuery = searchQuery;
//         this.matchString = matchString;
//         this.textBefore = textBefore;
//         this.textAfter = textAfter;
//     }
// 
//     public int getSearchIndex() {
//         return searchIndex;
//     }
// 
//     public void setSearchIndex(int searchIndex) {
//         this.searchIndex = searchIndex;
//     }
// 
//     public String getResource() {
//         return resource;
//     }
// 
//     public void setResource(String resource) {
//         this.resource = resource;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public void setTitle(String title) {
//         this.title = title;
//     }
// 
//     public String getSearchQuery() {
//         return searchQuery;
//     }
// 
//     public void setSearchQuery(String searchQuery) {
//         this.searchQuery = searchQuery;
//     }
// 
//     public String getMatchString() {
//         return matchString;
//     }
// 
//     public void setMatchString(String matchString) {
//         this.matchString = matchString;
//     }
// 
//     public String getTextBefore() {
//         return textBefore;
//     }
// 
//     public void setTextBefore(String textBefore) {
//         this.textBefore = textBefore;
//     }
// 
//     public String getTextAfter() {
//         return textAfter;
//     }
// 
//     public void setTextAfter(String textAfter) {
//         this.textAfter = textAfter;
//     }
// }


// Path: sample/src/main/java/com/readium/sample/adapters/SearchListAdapter.java
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.readium.r2_streamer.model.searcher.SearchResult;
import com.readium.sample.R;
import java.util.List;

package com.readium.sample.adapters;




/**
 * Created by Shrikant Badwaik on 17-Feb-17.
 */

public class SearchListAdapter extends ArrayAdapter<String> {
    private Context context;
    private List<SearchResult> list;
    private TextView view_1, view_2;

    public SearchListAdapter(Context context, List<SearchResult> list) {
        super(context, 0);
        this.context = context;
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @NonNull
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LinearLayout layout = null;
        if (convertView == null) {
            LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            layout = (LinearLayout) layoutInflater.inflate(R.layout.searchlist_adapter_resource, null);
        } else {
            layout = (LinearLayout) convertView;
        }

        view_1 = (TextView) layout.findViewById(R.id.titleText);
        view_2 = (TextView) layout.findViewById(R.id.matchingText);

        SearchResult searchResult = list.get(position);