Hi I have a RecyclerView which I use to display images in two columns. ArrayList of movies holds 60 String of URL's for images.So the images are loaded fine into the ImageViews. When I scroll down everything works fine and smooth, then I reach bottom and scroll up, for a while it scrolls ok, but then it scrolls to the very top and I actually see all the photos between trying to load. I looked for this issue, but haven't found a cause of this scrolling issue. But if I have just 20 items in the list everything works great
Here's the Adapter's code:
public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private ArrayList<Movie> movies; private Context context; private int newWidth; private int newHeight; public CustomAdapter(ArrayList<Movie> movies, Context context) { this.movies = movies; this.context = context; int screenWidth = context.getResources().getDisplayMetrics().widthPixels; int orientation = context.getResources().getConfiguration().orientation; newWidth = screenWidth / (orientation == Configuration.ORIENTATION_LANDSCAPE ? 3 : 2); newHeight = (int) (((double) newWidth / 185) * 278); } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_movie, parent, false); return new ViewHolder(view); } @Override public void onBindViewHolder(ViewHolder holder, int position) { Picasso.with(context) .load(movies.get(position).url) .resize(newWidth, newHeight) .into(holder.imageView); } @Override public int getItemCount() { return movies.size(); } public static class ViewHolder extends RecyclerView.ViewHolder { final ImageView imageView; public ViewHolder(View itemView) { super(itemView); imageView = (ImageView) itemView.findViewById(R.id.pic); } } } Thank you