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


Java SimpleImageLoadingListener類代碼示例

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


SimpleImageLoadingListener類屬於com.nostra13.universalimageloader.core.listener包,在下文中一共展示了SimpleImageLoadingListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: downloadImage

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
private void downloadImage() {
    MobclickAgent.onEvent(getActivity(), Event.STATUS_SAVE_IMAGE_OK);
    this.imageLoader.loadImage(this.imageUrl, new SimpleImageLoadingListener() {
        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
            if (!HomePopView.this.isRemoved()) {
                String result = FileUtil.downloadImage2Gallery(HomePopView.this.getActivity()
                        , loadedImage, new Md5FileNameGenerator().generate(HomePopView.this
                                .imageUrl));
                if (TextUtils.isEmpty(result)) {
                    Helper.showToast((CharSequence) "保存圖片失敗,請重新保存~~");
                } else {
                    Helper.showToast("圖片已保存到" + result);
                }
                HomePopView.this.ivDownload.setEnabled(true);
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:19,代碼來源:HomePopView.java

示例2: getView

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
	if(convertView == null)
	{
		convertView = LayoutInflater.from(context).inflate(R.layout.gallery_item, parent, false);
		ViewGroup.LayoutParams params = convertView.findViewById(R.id.image).getLayoutParams();
		params.width = params.height = width;
	}
	
	final ImageView iv_image = (ImageView) convertView.findViewById(R.id.image);
	final String uri = "file://" + data.get(position).path;
	imageLoader.displayImage(uri, iv_image, new SimpleImageLoadingListener()
			{
				@Override
				public void onLoadingStarted(String imageUri, View view)
				{
					iv_image.setImageResource(R.drawable.picture_unavailable);
					super.onLoadingStarted(imageUri, view);
				}
			});

	return convertView;
}
 
開發者ID:KAlO2,項目名稱:PerfectShow,代碼行數:25,代碼來源:GalleryAdapter.java

示例3: onBindViewHolder

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
    ButtonData item = items.get(position);
    if (type == TYPE_ASSET) {
        ImageLoader.getInstance().loadImage(urlsToAssets.get(position), new SimpleImageLoadingListener() {
            @Override
            public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                holder.button.setImageBitmap(loadedImage);
            }
        });
    } else if (type == TYPE_DRAWABLE) {
        holder.button.setImageDrawable(App.getVecDrawable(holder.itemView.getContext(), item.getIconRes()));
        //holder.button.setColorFilter(colorFilter);
    }
    if (item.getTitle() == null) {
        holder.title.setVisibility(View.GONE);
        holder.itemView.setContentDescription(item.getText());
    } else {
        holder.itemView.setContentDescription(item.getTitle());
        holder.title.setText(item.getTitle());
        holder.title.setVisibility(View.VISIBLE);
    }
}
 
開發者ID:RadiationX,項目名稱:ForPDA,代碼行數:24,代碼來源:PanelItemAdapter.java

示例4: load

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
@Override
public void load(String path, int defaultRes, ImageView iv, final AbsImageLoader.ImageLoadingListener listener) {
    if(!TextUtils.isEmpty(path)) {
        if (!path.equals(iv.getTag())) {
            iv.setTag(path);
            ImageAware imageAware = new ImageViewAware(iv, false);
            ImageLoader.getInstance().displayImage(path, imageAware,
                    getDefaultOptions(false, defaultRes), new SimpleImageLoadingListener() {

                        @Override
                        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                            if(listener!=null){
                                listener.onSuccess(imageUri, view);
                            }
                        }
                    });
        }
    }else{
        iv.setImageResource(defaultRes);
    }
}
 
開發者ID:bodismile,項目名稱:smile-mvp,代碼行數:22,代碼來源:UILImageLoader.java

示例5: updatePersonalInfo

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
private void updatePersonalInfo(User user) {
    personalName.setText(user.getNick());
    personalSign.setText(user.getSignature());
    ImageLoader.getInstance().displayImage(user.getAvatar(), personalIcon,
            ImageLoadOptions.getOptions(),
            new SimpleImageLoadingListener() {
                @Override
                public void onLoadingComplete(String imageUri, View view,
                                              Bitmap loadedImage) {
                    // TODO Auto-generated method stub
                    super.onLoadingComplete(imageUri, view, loadedImage);
                    L.i(TAG, "load personal icon completed.");
                }

            }
    );
}
 
開發者ID:klob,項目名稱:Diandi1.20,代碼行數:18,代碼來源:PersonalActivity.java

示例6: onPostExecute

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
@Override
protected void onPostExecute(String uri) {
    ImageLoader.getInstance().displayImage(uri, playlistImage,
            new DisplayImageOptions.Builder().cacheInMemory(true)
                    .showImageOnFail(R.drawable.ic_empty_music2)
                    .resetViewBeforeLoading(true)
                    .build(), new SimpleImageLoadingListener() {
                @Override
                public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                }
            });
    songcount.setText(" " + String.valueOf(songCountInt) + " " + mContext.getString(R.string.songs));
}
 
開發者ID:Vinetos,項目名稱:Hello-Music-droid,代碼行數:14,代碼來源:PlaylistPagerFragment.java

示例7: bindVoiceData

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
@Override
public void bindVoiceData(StickerAdapt2Result stickerAdapt2Result) {
    mViewDrawableOverlay.post(this::loadSticker);
    if (stickerAdapt2Result.getScenes().size() > 0)
        ImageLoader.getInstance().displayImage(Constants.setAliyunImageUrl(stickerAdapt2Result.getScenes().get(0).getImgname_url()), mIvBackground, new SimpleImageLoadingListener() {
            @Override
            public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                super.onLoadingComplete(imageUri, view, loadedImage);
                Observable.just(loadedImage)
                        .subscribeOn(Schedulers.io())
                        .observeOn(Schedulers.io())
                        .filter(loadedImg -> loadedImg != null && !loadedImg.isRecycled())
                        .subscribe(loadedImg -> {
                            int hashName = FileUtil.STICKER_BG_NAME.hashCode();
                            FileUtil.saveBitmap(FileUtil.getAppFilePath(FileUtil.DIR_STICKERS) + hashName, loadedImage);
                        }, Throwable::printStackTrace);
            }
        });
}
 
開發者ID:junchenChow,項目名稱:exciting-app,代碼行數:20,代碼來源:VoiceMainActivity.java

示例8: displayImage

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
public void displayImage(MQImageView imageView, String path, @DrawableRes int loadingResId,
                         @DrawableRes int failResId, int width, int height, final
                         MQDisplayImageListener displayImageListener) {
    initImageLoader(imageView.getContext());
    if (path == null) {
        path = "";
    }
    if (!(path.startsWith("http") || path.startsWith("file"))) {
        path = "file://" + path;
    }
    String str = path;
    ImageLoader.getInstance().displayImage(str, new ImageViewAware(imageView), new
            DisplayImageOptions.Builder().showImageOnLoading(loadingResId).showImageOnFail
            (failResId).cacheInMemory(true).build(), new ImageSize(width, height), new
            SimpleImageLoadingListener() {
        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
            if (displayImageListener != null) {
                displayImageListener.onSuccess(view, imageUri);
            }
        }
    }, null);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:23,代碼來源:UILImageLoader.java

示例9: loadBooheePic

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
private void loadBooheePic() {
    new Thread(new Runnable() {
        public void run() {
            for (int i = 0; i < 100; i++) {
                MyFavoriteActivity.this.imageUrl = String.format("http://up.boohee" +
                        ".cn/house/u/one/reminder/%d.jpg", new Object[]{Integer.valueOf(i)});
                MyFavoriteActivity.this.imageLoader.loadImage(MyFavoriteActivity.this
                        .imageUrl, new SimpleImageLoadingListener() {
                    public void onLoadingComplete(String imageUri, View view, Bitmap
                            loadedImage) {
                        super.onLoadingComplete(imageUri, view, loadedImage);
                        new SaveImageTask().execute(new Bitmap[]{loadedImage});
                    }
                });
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }).start();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:24,代碼來源:MyFavoriteActivity.java

示例10: doLoadImage

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
/**
 * ImageLoader異步加載
 */
private void doLoadImage(final boolean needLoad, final String tag, final String url, final int thumbSize) {
    if (needLoad) {
        setTag(tag); // 解決ViewHolder複用問題
        /**
         * 若使用網易雲信雲存儲,這裏可以設置下載圖片的壓縮尺寸,生成下載URL
         * 如果圖片來源是非網易雲信雲存儲,請不要使用NosThumbImageUtil
         */
        final String thumbUrl = makeAvatarThumbNosUrl(url, thumbSize);

        // 異步從cache or NOS加載圖片
        ImageLoader.getInstance().displayImage(thumbUrl, new NonViewAware(new ImageSize(thumbSize, thumbSize),
                ViewScaleType.CROP), options, new SimpleImageLoadingListener() {
            @Override
            public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                if (getTag() != null && getTag().equals(tag)) {
                    setImageBitmap(loadedImage);
                }
            }
        });
    } else {
        setTag(null);
    }
}
 
開發者ID:LegendKe,項目名稱:MyTravelingDiary,代碼行數:27,代碼來源:HeadImageView.java

示例11: onCreate

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.assistant_metro_activity_map_view);

    String cityName =  getIntent().getStringExtra("name");
    final String imageUrl = getIntent().getStringExtra("imageUrl");

    Log.d(">>>imageUrl", imageUrl);
    UIHelp.setHeaderMenuView(this, cityName + "地鐵線路圖");

    imageView = (GestureImageView) findViewById(R.id.imageView);

    ImageLoadUtil.getInstance().loadImage(imageUrl, new SimpleImageLoadingListener(){
        @Override
        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
            imageView.setImageBitmap(loadedImage);
        }
    });
}
 
開發者ID:hubcarl,項目名稱:mobile-manager-tool,代碼行數:21,代碼來源:MetroMapViewActivity.java

示例12: setToolbarAndStatusColorAccordingToEventImage

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
private void setToolbarAndStatusColorAccordingToEventImage() {
    if(event.hasImage()) {
        MyImageLoader.getInstance().getImageLoader().loadImage(event.getImage(), new SimpleImageLoadingListener() {
            @Override
            public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                super.onLoadingComplete(imageUri, view, loadedImage);
                Palette.from(loadedImage).generate(new Palette.PaletteAsyncListener() {
                    @Override
                    public void onGenerated(Palette palette) {
                        int darkVibrantColor = palette.getDarkVibrantColor(getResources().getColor(R.color.primaryDark));
                        int vibrantColor = palette.getVibrantColor(getResources().getColor(R.color.primary));
                        collapsingToolbarLayout.setContentScrimColor(vibrantColor);

                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                            Window window = EventDetailActivity.this.getWindow();
                            window.setStatusBarColor(darkVibrantColor);
                        }
                    }
                });
            }
        });
    }
}
 
開發者ID:LibertACAO,項目名稱:libertacao-android,代碼行數:24,代碼來源:EventDetailActivity.java

示例13: onCreate

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_pic_detail);
    ButterKnife.bind(this);
    imgUrl = getIntent().getStringExtra("IMAGE_URL");
    photoViewAttacher = new PhotoViewAttacher(pvPic);

    DisplayImageOptions options = new DisplayImageOptions.Builder()
            .cacheOnDisk(true).considerExifParams(true).build();
    ImageLoader.getInstance().displayImage(imgUrl,pvPic,options,
            new SimpleImageLoadingListener(){
        @Override
        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
            progressBar.setVisibility(View.GONE);
            photoViewAttacher.update();
        }
    });

}
 
開發者ID:SparkYuan,項目名稱:Material-9GAG,代碼行數:21,代碼來源:PicDetailActivity.java

示例14: onCreateView

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	View v = inflater.inflate(R.layout.fragment_beauty, container, false);
	mBeautyImg = (ImageView) v.findViewById(R.id.beautyImg);
	mAttacher = new PhotoViewAttacher(mBeautyImg);
	ImageLoaderUtil.displayImage(url, mBeautyImg,
			ImageLoaderUtil.getDefaultOptions(),new SimpleImageLoadingListener(){
		@Override
		public void onLoadingComplete(String imageUri, View view,
				Bitmap loadedImage) {
			super.onLoadingComplete(imageUri, view, loadedImage);
			mAttacher.update();
		}
	});
	return v;
}
 
開發者ID:xiaozhi003,項目名稱:BeautyGallery,代碼行數:18,代碼來源:BeautyFragment.java

示例15: fillImage

import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener; //導入依賴的package包/類
/**
 * Method fillInfo
 * all written info is filled
 *
 * @param filmDetail
 */
private void fillImage(FilmDetailsJSONEntity filmDetail) {

    // Finally the image loaded by Universal Image Loader library
    final String titleOfFilm = filmDetail.getTitle();

    // Load image, decode it to Bitmap and return Bitmap to callback
    ImageLoader.getInstance().displayImage(filmDetail.getUrlPoster(), imgExtended, new SimpleImageLoadingListener() {
        @Override
        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
            // Do whatever you want with Bitmap
            Palette.generateAsync(loadedImage, new Palette.PaletteAsyncListener() {
                public void onGenerated(Palette palette) {
                    applyPalette(palette, titleOfFilm);
                }
            });
        }
    });
}
 
開發者ID:raulh82vlc,項目名稱:TopRate_Materialised,代碼行數:25,代碼來源:CardFilmDetailsActivity.java


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