public LocalWorker( IWeiciyuanDrawable view, String url, FileLocationMethod method, boolean isMultiPictures) { this(view.getImageView(), url, method, false); this.IWeiciyuanDrawable = view; this.pbWeakReference = new WeakReference<ProgressBar>(view.getProgressBar()); view.setGifFlag(false); if (view.getProgressBar() != null) { view.getProgressBar().setVisibility(View.INVISIBLE); view.getProgressBar().setProgress(0); } this.isMultiPictures = isMultiPictures; }
private void displayBitmap(Bitmap bitmap) { ImageView imageView = viewWeakReference.get(); if (!isMySelf(imageView)) { return; } if (pbWeakReference != null) { ProgressBar pb = pbWeakReference.get(); if (pb != null) { pb.setVisibility(View.INVISIBLE); } } if (bitmap != null) { if (IWeiciyuanDrawable != null) { IWeiciyuanDrawable.setGifFlag(ImageUtility.isThisPictureGif(getUrl())); } playImageViewAnimation(imageView, bitmap); GlobalContext.getInstance().getBitmapCache().put(data, bitmap); } else { imageView.setImageDrawable(new ColorDrawable(DebugColor.READ_FAILED)); } }