Android Open Source - android-animeinfo Search Results Adapter

From Project

Back to project page android-animeinfo.


The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project android-animeinfo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/* w  w  w .j a  va 2  s . c o m*/
import java.util.Collection;
import java.util.Vector;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class SearchResultsAdapter extends BaseAdapter {

  private Vector<AnimeSummary> results = new Vector<AnimeSummary>();
  private Context context;
  public SearchResultsAdapter(Collection<AnimeSummary> results, Context context)
    this.context = context;
  public int getCount() {
    return results.size();

  public AnimeSummary getItem(int location) {
    return results.get(location);

  public long getItemId(int location) {
    return results.get(location).getId();

  public View getView(int position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = LayoutInflater.from(context);
    AnimeSummary result = results.get(position);

    View view = inflater.inflate(R.layout.search_item, parent, false);
    TextView title = (TextView)view.findViewById(;
    TextView synposis = (TextView)view.findViewById(;
    TextView episodes = (TextView)view.findViewById(;
    TextView rating = (TextView)view.findViewById(;
    ImageView image = (ImageView)view.findViewById(;
    return view;

Java Source Code List