Narfss / ParallaxEverywhere

Parallax everywhere is a library with alternative android widgets with parallax effects.
MIT License
715 stars 96 forks source link

Not working with RecyclerView? #13

Open MiralDesai opened 8 years ago

MiralDesai commented 8 years ago

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 commented 8 years ago

Any update to this...?

badlog commented 8 years ago

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

vijay3 commented 7 years ago

Any updates on this?

ghost commented 7 years ago

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.

alexfin90 commented 7 years ago

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

alexfin90 commented 7 years ago

Only PEWTextView work

badlog commented 7 years ago

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