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

Not working with Glide #9

Open
ghost opened this issue Aug 29, 2015 · 5 comments
Open

Not working with Glide #9

ghost opened this issue Aug 29, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Aug 29, 2015

Dear,
Thank you for great component. I have an issue. I am using Glide to download images. parallax is not working when using Glide. Please advise

@TonyHaddad91
Copy link

@hishambakr Have you solved your issue yet, it so bad decision to replace glide with any other image loader

@ghost
Copy link
Author

ghost commented Sep 29, 2016

Hey guys,

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.

@FelipeRRM
Copy link

FelipeRRM commented Oct 13, 2016

@ronaldo-getreveel Tried this but it still did not load. I'm loading the image in a recycler view using this calls:

Glide.with(context)
.load(atual.getImage())
.diskCacheStrategy(DiskCacheStrategy.ALL)
.centerCrop()
.dontAnimate()
.into(holder.image);

am I missing anything?

@FelipeRRM
Copy link

Got it working,
just had to use .override(1080,675),
as Glide loads a cut version of the image to fit perfectly in the ImageView, not leaving room for the parallax effect.

@sudansh
Copy link

sudansh commented Apr 13, 2017

@FelipeRRM thanks for the tip. It worked.

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

3 participants