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

Loading Internet Images with Glide #57

Closed
jaydp17 opened this issue May 12, 2015 · 3 comments
Closed

Loading Internet Images with Glide #57

jaydp17 opened this issue May 12, 2015 · 3 comments

Comments

@jaydp17
Copy link

jaydp17 commented May 12, 2015

Till now I used to use Picasso for loading images. Right now I'm moving to Glide and there's an issue with that.

When loading images from the internet for the first time, it doesn't show up in the CircleImageView (Glide isn't able to replace the placeholder image).

Setup:

I have an activity with just a CircleImageView. I use the below code to load image using glide

Glide.with(this)
    .load("https://s3.amazonaws.com/xyz.png")
    .placeholder(R.drawable.abc)
    .into(imgView);

Steps to Reproduce:

  1. Fresh install and open the app
  2. The placeholder shows up, while the image is getting downloaded
  3. The placeholder is never replaced by the actual image, even though the image has been downloaded and cached
  4. Go back
  5. Re-open the app
  6. The image appears

Note: I have tried replacing the CircleImageView with a regular ImageView and it works perfectly.

@hdodenhof
Copy link
Owner

I haven't used Glide myself, but I'm pretty sure this is the same issue as #20, #5 and #3.

You might be able to work around this limitation using a custom target:

Glide.with(this)
    .load("https://s3.amazonaws.com/xyz.png")
    .placeholder(R.drawable.abc)
    .into(new SimpleTarget<Bitmap>(width, height) {
        @Override
        public void onResourceReady(Bitmap bitmap, GlideAnimation anim) {
            // setImageBitmap(bitmap) on CircleImageView
        }
    };

@thewbb
Copy link

thewbb commented Aug 23, 2015

ok,you can disable this fade by this way.

Glide.with(this).load(url).placeholder(R.mipmap.ic_launcher).dontAnimate().into(circleImageView);

@hdodenhof
Copy link
Owner

Closing this as solved.

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