package com.github.skittlesdev.kubrick.adapters;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.github.skittlesdev.kubrick.R;

import java.util.List;

import info.movito.themoviedbapi.model.MovieDb;

public class SimilarMoviesOverviewAdapter extends RecyclerView.Adapter<SimilarMoviesOverviewAdapter.ViewHolder> {
    private List<MovieDb> movies;
    private Context context;

    public SimilarMoviesOverviewAdapter(List<MovieDb> movies) {
        this.movies = movies;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        this.context = parent.getContext();
        View layout = LayoutInflater.from(parent.getContext()).inflate(R.layout.movies_layout, parent, false);
        return new ViewHolder(layout);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        holder.setItem(this.movies.get(position));
        holder.setposter(this.context);
    }

    @Override
    public int getItemCount() {
        return this.movies.size();
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {
        private ImageView poster;
        private MovieDb item;

        public ViewHolder(View itemView) {
            super(itemView);
            this.poster = (ImageView) itemView.findViewById(R.id.moviePoster);
        }
        public void setposter(Context context) {
            Glide.with(context)
                    .load("http://image.tmdb.org/t/p/w500" + item.getPosterPath())
                    .placeholder(R.drawable.poster_default_placeholder)
                    .error(R.drawable.poster_default_error)
                    .into(this.poster);
        }

        public void setItem(MovieDb item) {
            this.item = item;
        }
    }
}

@@ -75,16 +75,40 @@
 ontext;%0A
+import android.net.Uri;%0A
 import a
@@ -243,73 +243,57 @@
 up;%0A
+%0A
 import 
-android.widget.ImageView;%0A%0Aimport com.bumptech.glide.Glide
+com.facebook.drawee.view.SimpleDraweeView
 ;%0Aim
@@ -897,20 +897,23 @@
 .layout.
-movi
+favorit
 es_layou
@@ -1330,20 +1330,27 @@
 private 
-Imag
+SimpleDrawe
 eView po
@@ -1489,12 +1489,19 @@
  = (
-Imag
+SimpleDrawe
 eVie
@@ -1619,53 +1619,41 @@
     
-Glide.with(context)%0A                    .load
+this.poster.setImageURI(Uri.parse
 (%22ht
@@ -1709,178 +1709,8 @@
 h())
-%0A                    .placeholder(R.drawable.poster_default_placeholder)%0A                    .error(R.drawable.poster_default_error)%0A                    .into(this.poster
 );%0A 

Integrate fresco on related movies