Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallax effect on PEWImageView inside GridView is unnoticeable #15

Open
Signoo opened this issue May 19, 2016 · 1 comment
Open

Parallax effect on PEWImageView inside GridView is unnoticeable #15

Signoo opened this issue May 19, 2016 · 1 comment

Comments

@Signoo
Copy link

Signoo commented May 19, 2016

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?

@ghost
Copy link

ghost commented Sep 29, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant