yayaa/ParallaxRecyclerView

use glide load picture problem

Closed this issue · 1 comments

@yayaa
I use Glide to test the library,then i find a problem . If the finger don't move in the screen , the screenshots is this
qq 20160309155928
the pictures do not display nomally. But if the finger move in the screen ,the screenshots is this
qq 20160309155959
the pictures can display nomally
my code is below

 @Override
    public void onBindViewHolder(ViewHolder viewHolder, int position) {
        MyGlideUtils.loadImgByResId(context, imageIds[position % imageIds.length], viewHolder.getBackgroundImage());
//        viewHolder.getBackgroundImage().setImageResource(imageIds[position % imageIds.length]);
        viewHolder.getTextView().setText("Row " + position);

        // # CAUTION:
        // Important to call this method
        viewHolder.getBackgroundImage().reuse();
    }

MyGlideUtils is below

public static void loadImgByResId(Context context, int resId, ImageView imageView) {
        Glide.with(context)
                .load(resId)
//                .centerCrop()
                .placeholder(R.mipmap.ic_launcher)
                .into(imageView);
    }

if use centerCrop the Parallax does't work ,the reason i don't find .
If you have free time , please help me ,thank you !

yayaa commented

Try to call parallaxImageView.reuse() before your Glide display method...
See also