Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1.  
  2. public class GridListAdapter extends BaseAdapter {
  3. private Context context;
  4. private List<Movies_Variables>mListmovies;
  5.  
  6. public GridListAdapter(Context context,List<Movies_Variables>mListmovies){
  7. this.context=context;
  8. this.mListmovies=mListmovies;
  9.  
  10.  
  11. }
  12. @Override
  13. public int getCount() {
  14. return mListmovies.size();
  15. }
  16.  
  17. @Override
  18. public Object getItem(int position) {
  19. return mListmovies.get(position);
  20. }
  21.  
  22. @Override
  23. public long getItemId(int position) {
  24. return position;
  25. }
  26.  
  27. @Override
  28. public View getView(int position, View convertView, ViewGroup parent) {
  29. View v=View.inflate(context,R.layout.grid_item,null);
  30. ImageView movie_image=(ImageView)v.findViewById(R.id.grid_item_image_view);
  31.  
  32.  
  33.  
  34. //////////////////////////////////
  35. ////////////////Add picasso
  36. Picasso.with(context).load(mListmovies.get(position).getPoster_path()).into(movie_image);
  37. Picasso.with(context).setLoggingEnabled(true);
  38.  
  39.  
  40. return v;
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement