ParallaxEverywhere icon indicating copy to clipboard operation
ParallaxEverywhere copied to clipboard

Not working with RecyclerView?

Open MiralDesai opened this issue 8 years ago • 7 comments

Do you have a sample on how this library works? Specifically with a RecyclerView if possible? I'm adding the PEWImageVIew to my row layout and it's not working.

Anything I need to add to the view, or is it simply not compatible with a RecyclerView? i'm getting my image from a HTTP call, loading it in, maybe it's that?

Edit: It seems the PEWTextView works, just not the PEWImageView?

MiralDesai avatar Apr 18 '16 09:04 MiralDesai

Any update to this...?

MiralDesai avatar Apr 21 '16 09:04 MiralDesai

I'm using recyclerview with picasso and its work good.

badlog avatar Jun 03 '16 04:06 badlog

Any updates on this?

vijay3 avatar Aug 25 '16 09:08 vijay3

Override the PEWImageView like this:

` public class ParalaxImageView extends PEWImageView{

public ParalaxImageView(Context context) {
    super(context);
}

public ParalaxImageView(Context context, AttributeSet attrs) {
    super(context, attrs);
}

public ParalaxImageView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
}

@Override
public void setImageResource(int resId) {
    super.setImageResource(resId);
    invalidate();
}

@Override
public void setImageDrawable(Drawable drawable) {
    super.setImageDrawable(drawable);
    invalidate();
}

@Override
public void setImageBitmap(Bitmap bm) {
    super.setImageBitmap(bm);
    invalidate();
}

} `

And it will work fine.

I'll submit a pull request soon.

ghost avatar Sep 29 '16 14:09 ghost

With recyclerView not work for me ! maybe because i use holder.imageView.setImageResource(srcs.get(position)); on onBindViewHolder method???

alexfin90 avatar Mar 22 '17 15:03 alexfin90

Only PEWTextView work

alexfin90 avatar Mar 22 '17 15:03 alexfin90

I use Picasso.with(mContext).load(resourceId).into(holder.background); on onBindViewHolder

badlog avatar Apr 20 '17 12:04 badlog