Gh0stWires
1/16/2016 - 6:00 AM

ImageArrayAdapter

public class ImageArrayAdapter extends ArrayAdapter<String> {


    public ImageArrayAdapter(Context context, List<String> imageUrls){
        super(context, R.layout.movie_item, imageUrls);


    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = LayoutInflater.from(getContext());
        View customView = inflater.inflate(R.layout.movie_item, parent, false);

        String singleItem = getItem(position);
        ImageView image = (ImageView) customView.findViewById(R.id.movie_poster);


        Glide
                .with(getContext())
                .load(singleItem)
                .into(image);

        return customView;
    }
}