ParallaxEverywhere icon indicating copy to clipboard operation
ParallaxEverywhere copied to clipboard

Parallax effect on PEWImageView inside GridView is unnoticeable

Open Signoo opened this issue 8 years ago • 1 comments

I'm using PEWImageView in order to add parallax effect to some images inside a GridView, the problem is that the parallax effect on the images is almost unnoticeable.. Is it possible to specify the velocity of the parallax effect? is there any method already defined?

Signoo avatar May 19 '16 10:05 Signoo

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 02:09 ghost