1

I am building a Tinder-like Android app with this library : https://github.com/Diolor/Swipecards and Picasso for image loading. Everything works fine, except the first view of the list. The image is not displayed, although the text is correct.

Views are stored in a custom subclass of ArrayAdapter. Here is the code:

public View getView(int position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = ((Activity)context).getLayoutInflater();

    switch (getItemViewType(position)) {
        case TYPE_MOVIE:
            ViewHolderMovie holder;
            if (convertView == null) {
                holder = new ViewHolderMovie();
                convertView = inflater.inflate(R.layout.movie_card, parent, false);
                holder.movieCover = (ImageView)convertView.findViewById(R.id.movieCover);
                holder.movieTitle = (TextView)convertView.findViewById(R.id.movieTitle);
                holder.movieGenre = (TextView)convertView.findViewById(R.id.movieGenre);
                convertView.setTag(holder);
            } else {
                holder = (ViewHolderMovie) convertView.getTag();
            }

            Movie movie = (Movie) data.get(position);
            Picasso.with(convertView.getContext())
                .load(movie.imagePath)
                .resize(500, 500)
                .into(holder.movieCover); // this doesn't work for the first view
            holder.movieTitle.setText(movie.title);
            holder.movieGenre.setText("Film au cinéma ("+movie.genre+")");

            return convertView;
    }

    return null;

}

Do you have an idea please?

Arnaud
  • 4,884
  • 17
  • 54
  • 85

1 Answers1

0

Check Your image URL path ,especially slash '/'. Picasso don't show first image of ArrayAdapter when '/' has twice in your imageurl path. But it show truly when you scroll Gridview or Listview

Go Goal
  • 81
  • 1
  • 3