當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageLoadingListener.onLoadingComplete方法代碼示例

本文整理匯總了Java中com.nostra13.universalimageloader.core.listener.ImageLoadingListener.onLoadingComplete方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageLoadingListener.onLoadingComplete方法的具體用法?Java ImageLoadingListener.onLoadingComplete怎麽用?Java ImageLoadingListener.onLoadingComplete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.nostra13.universalimageloader.core.listener.ImageLoadingListener的用法示例。


在下文中一共展示了ImageLoadingListener.onLoadingComplete方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: show

import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; //導入方法依賴的package包/類
public static boolean show(String url, ImageView imageView, ImageLoadingListener listener){
        imageView.setImageDrawable(null);
        if(url == null)
            return false;

        if(!url.startsWith("http"))
            url = ShikiApi.HTTP_SERVER + url;

        if(url.contains(".gif") && Build.VERSION.SDK_INT > 13){
            Ion.with(imageView)
                    .animateGif(AnimateGifMode.ANIMATE)
//                    .animateLoad(R.anim.spin_animation)
                    .smartSize(true)
                    .error(R.drawable.missing_preview)
                    .load(url);
            if(listener!=null)
                listener.onLoadingComplete(null,null,null);
        }
        else
            ImageLoader.getInstance().displayImage(url, imageView, listener);
        return true;
    }
 
開發者ID:LeshiyGS,項目名稱:shikimori,代碼行數:23,代碼來源:ShikiImage.java

示例2: getWithListener

import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; //導入方法依賴的package包/類
public void getWithListener(String imageUri,String access_token,ImageLoadingListener listener,int round,int defaultDrawable) {
    Bitmap bitmap = null;
    bitmap = _imageLoader.loadImageSync(imageUri,access_token);
    if(bitmap != null){
        if(listener != null){
            listener.onLoadingComplete(imageUri, null, bitmap);
        }
    }else{
        get(imageUri,access_token, listener,0);
    }
}
 
開發者ID:yun2win,項目名稱:yun2win-sdk-android,代碼行數:12,代碼來源:ImagePool.java

示例3: getWithListener

import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; //導入方法依賴的package包/類
public void getWithListener(String imageUri,ImageLoadingListener listener,int round,int defaultDrawable) {
    Bitmap bitmap = null;
    bitmap = _imageLoader.loadImageSync(imageUri);
    if(bitmap != null){
        if(listener != null){
            listener.onLoadingComplete(imageUri, null, bitmap);
        }
    }else{
        get(imageUri, listener,0);
    }
}
 
開發者ID:yun2win,項目名稱:yun2win-sdk-android,代碼行數:12,代碼來源:ImagePool.java

示例4: displayImage

import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; //導入方法依賴的package包/類
public void displayImage(String uri, ImageAware imageAware, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) {
    checkConfiguration();
    if (imageAware == null) {
        throw new IllegalArgumentException(ERROR_WRONG_ARGUMENTS);
    }
    if (listener == null) {
        listener = this.emptyListener;
    }
    if (options == null) {
        options = this.configuration.defaultDisplayImageOptions;
    }
    if (TextUtils.isEmpty(uri)) {
        this.engine.cancelDisplayTaskFor(imageAware);
        listener.onLoadingStarted(uri, imageAware.getWrappedView());
        if (options.shouldShowImageForEmptyUri()) {
            imageAware.setImageDrawable(options.getImageForEmptyUri(this.configuration.resources));
        } else {
            imageAware.setImageDrawable(null);
        }
        listener.onLoadingComplete(uri, imageAware.getWrappedView(), null);
        return;
    }
    ImageSize targetSize = ImageSizeUtils.defineTargetSizeForView(imageAware, this.configuration.getMaxImageSize());
    String memoryCacheKey = MemoryCacheUtils.generateKey(uri, targetSize);
    this.engine.prepareDisplayTaskFor(imageAware, memoryCacheKey);
    listener.onLoadingStarted(uri, imageAware.getWrappedView());
    Bitmap bmp = (Bitmap) this.configuration.memoryCache.get(memoryCacheKey);
    if (bmp == null || bmp.isRecycled()) {
        if (options.shouldShowImageOnLoading()) {
            imageAware.setImageDrawable(options.getImageOnLoading(this.configuration.resources));
        } else if (options.isResetViewBeforeLoading()) {
            imageAware.setImageDrawable(null);
        }
        LoadAndDisplayImageTask displayTask = new LoadAndDisplayImageTask(this.engine, new ImageLoadingInfo(uri, imageAware, targetSize, memoryCacheKey, options, listener, progressListener, this.engine.getLockForUri(uri)), defineHandler(options));
        if (options.isSyncLoading()) {
            displayTask.run();
            return;
        } else {
            this.engine.submit(displayTask);
            return;
        }
    }
    L.d(LOG_LOAD_IMAGE_FROM_MEMORY_CACHE, memoryCacheKey);
    if (options.shouldPostProcess()) {
        ProcessAndDisplayImageTask displayTask2 = new ProcessAndDisplayImageTask(this.engine, bmp, new ImageLoadingInfo(uri, imageAware, targetSize, memoryCacheKey, options, listener, progressListener, this.engine.getLockForUri(uri)), defineHandler(options));
        if (options.isSyncLoading()) {
            displayTask2.run();
            return;
        } else {
            this.engine.submit(displayTask2);
            return;
        }
    }
    options.getDisplayer().display(bmp, imageAware, LoadedFrom.MEMORY_CACHE);
    listener.onLoadingComplete(uri, imageAware.getWrappedView(), bmp);
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:57,代碼來源:ImageLoader.java

示例5: displayImage

import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; //導入方法依賴的package包/類
public void displayImage(String uri, ImageAware imageAware, DisplayImageOptions options,
                         ImageSize targetSize, ImageLoadingListener listener,
                         ImageLoadingProgressListener progressListener) {
    checkConfiguration();
    if (imageAware == null) {
        throw new IllegalArgumentException(ERROR_WRONG_ARGUMENTS);
    }
    if (listener == null) {
        listener = this.defaultListener;
    }
    if (options == null) {
        options = this.configuration.defaultDisplayImageOptions;
    }
    if (TextUtils.isEmpty(uri)) {
        this.engine.cancelDisplayTaskFor(imageAware);
        listener.onLoadingStarted(uri, imageAware.getWrappedView());
        if (options.shouldShowImageForEmptyUri()) {
            imageAware.setImageDrawable(options.getImageForEmptyUri(this.configuration
                    .resources));
        } else {
            imageAware.setImageDrawable(null);
        }
        listener.onLoadingComplete(uri, imageAware.getWrappedView(), null);
        return;
    }
    if (targetSize == null) {
        targetSize = ImageSizeUtils.defineTargetSizeForView(imageAware, this.configuration
                .getMaxImageSize());
    }
    String memoryCacheKey = MemoryCacheUtils.generateKey(uri, targetSize);
    this.engine.prepareDisplayTaskFor(imageAware, memoryCacheKey);
    listener.onLoadingStarted(uri, imageAware.getWrappedView());
    Bitmap bmp = this.configuration.memoryCache.get(memoryCacheKey);
    if (bmp == null || bmp.isRecycled()) {
        if (options.shouldShowImageOnLoading()) {
            imageAware.setImageDrawable(options.getImageOnLoading(this.configuration
                    .resources));
        } else if (options.isResetViewBeforeLoading()) {
            imageAware.setImageDrawable(null);
        }
        LoadAndDisplayImageTask displayTask = new LoadAndDisplayImageTask(this.engine, new
                ImageLoadingInfo(uri, imageAware, targetSize, memoryCacheKey, options,
                listener, progressListener, this.engine.getLockForUri(uri)), defineHandler
                (options));
        if (options.isSyncLoading()) {
            displayTask.run();
            return;
        } else {
            this.engine.submit(displayTask);
            return;
        }
    }
    L.d(LOG_LOAD_IMAGE_FROM_MEMORY_CACHE, memoryCacheKey);
    if (options.shouldPostProcess()) {
        ProcessAndDisplayImageTask displayTask2 = new ProcessAndDisplayImageTask(this.engine,
                bmp, new ImageLoadingInfo(uri, imageAware, targetSize, memoryCacheKey,
                options, listener, progressListener, this.engine.getLockForUri(uri)),
                defineHandler(options));
        if (options.isSyncLoading()) {
            displayTask2.run();
            return;
        } else {
            this.engine.submit(displayTask2);
            return;
        }
    }
    options.getDisplayer().display(bmp, imageAware, LoadedFrom.MEMORY_CACHE);
    listener.onLoadingComplete(uri, imageAware.getWrappedView(), bmp);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:70,代碼來源:ImageLoader.java


注:本文中的com.nostra13.universalimageloader.core.listener.ImageLoadingListener.onLoadingComplete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。