/** * Adds load image task to execution pool. Image will be returned with * {@link ImageLoadingListener#onLoadingComplete(Bitmap) callback}.<br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param targetImageSize Minimal size for {@link Bitmap} which will be returned in * {@linkplain ImageLoadingListener#onLoadingComplete(Bitmap) callback}. Downloaded image will be decoded * and scaled to {@link Bitmap} of the size which is <b>equal or larger</b> (usually a bit larger) than * incoming minImageSize . * @param options {@linkplain DisplayImageOptions Display image options} for image displaying. If <b>null</b> - * default display image options * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) from * configuration} will be used.<br /> * Incoming options should contain {@link FakeBitmapDisplayer} as displayer. * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires events on UI * thread. * * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before */ public void loadImage(String uri, ImageSize targetImageSize, DisplayImageOptions options, ImageLoadingListener listener) { checkConfiguration(); if (targetImageSize == null) { targetImageSize = new ImageSize(configuration.maxImageWidthForMemoryCache, configuration.maxImageHeightForMemoryCache); } if (options == null) { options = configuration.defaultDisplayImageOptions; } DisplayImageOptions optionsWithFakeDisplayer; if (options.getDisplayer() instanceof FakeBitmapDisplayer) { optionsWithFakeDisplayer = options; } else { optionsWithFakeDisplayer = new DisplayImageOptions.Builder().cloneFrom(options).displayer(fakeBitmapDisplayer).build(); } ImageView fakeImage = new ImageView(configuration.context); fakeImage.setLayoutParams(new LayoutParams(targetImageSize.getWidth(), targetImageSize.getHeight())); fakeImage.setScaleType(ScaleType.CENTER_CROP); displayImage(uri, fakeImage, optionsWithFakeDisplayer, listener); }
public void getAlbumImage(final Album album, final CompletionListener listener) { if (album == null) return; imageLoader.loadImage(LiqearApplication.getAppContext(), album.getImageUrl(), new ImageLoadingListener() { @Override public void onLoadingStarted() { } @Override public void onLoadingFailed(FailReason failReason) { } @Override public void onLoadingComplete(Bitmap bitmap) { AudioTimeline.setCurrentAlbumBitmap(bitmap); listener.onCompleted(); } @Override public void onLoadingCancelled() { } }); }
static public void DisplayImage(String uri,ImageView imageView,int defaultImage,ImageLoadingListener listener) { DisplayImageOptions options = new DisplayImageOptions.Builder() .showStubImage(defaultImage) .resetViewBeforeLoading() .delayBeforeLoading(1000) .showImageForEmptyUri(defaultImage) .cacheInMemory() .cacheOnDisc() .imageScaleType(ImageScaleType.EXACTLY) .build(); if(listener != null) { ImageLoader.getInstance().displayImage(uri, imageView, options,listener); } else { ImageLoader.getInstance().displayImage(uri, imageView, options); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_full_screan_image); Intent intent = getIntent(); imgURL = intent.getStringExtra(NewsArticleActivity.IMG_URL); DisplayImageOptions displayImageOptions; ImageLoadingListener animateFirstListener; displayImageOptions = new DisplayImageOptions.Builder(). showImageForEmptyUri(R.drawable.ic_stub). showImageOnFail(R.drawable.ic_stub). cacheInMemory(true).cacheOnDisc(true).build(); animateFirstListener = new AnimateFirstDisplayListener(); TouchImageView touch = (TouchImageView) findViewById(R.id.touchImage); ImageLoader imageLoader; imageLoader = ImageLoader.getInstance(); imageLoader.init(ImageLoaderConfiguration.createDefault(getApplicationContext())); imageLoader.displayImage(imgURL, touch, displayImageOptions, animateFirstListener); }
public ImageLoadingInfo(String uri, ImageAware imageAware, ImageSize targetSize, String memoryCacheKey, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener, ReentrantLock loadFromUriLock) { this.uri = uri; this.imageAware = imageAware; this.targetSize = targetSize; this.options = options; this.listener = listener; this.progressListener = progressListener; this.loadFromUriLock = loadFromUriLock; this.memoryCacheKey = memoryCacheKey; }
public ImageLoadingInfo(String uri, ImageView imageView, ImageSize targetSize, DisplayImageOptions options, ImageLoadingListener listener, ReentrantLock loadFromUriLock) { this.uri = uri; this.imageView = imageView; this.targetSize = targetSize; this.options = options; this.listener = listener; this.loadFromUriLock = loadFromUriLock; memoryCacheKey = MemoryCacheUtil.generateKey(uri, targetSize); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_info_article); Intent intent = getIntent(); String title = intent.getStringExtra(InfoFragment.INFO_ARTICLE_TITLE); imageURL = intent.getStringExtra(InfoFragment.INFO_IMG_URL); String article = intent.getStringExtra(InfoFragment.INFO_ARTICLE_TEXT); TextView titleTextView = (TextView) findViewById(R.id.infoTitleTextView); titleTextView.setText(title); TextView articleTextView = (TextView) findViewById(R.id.infoArticleTextView); articleTextView.setText(Html.fromHtml(article, new ImageGetter(), null)); DisplayImageOptions displayImageOptions; ImageLoadingListener animateFirstListener; displayImageOptions = new DisplayImageOptions.Builder(). showImageForEmptyUri(R.drawable.ic_stub). showImageOnFail(R.drawable.ic_stub). cacheInMemory(true).cacheOnDisc(true).build(); animateFirstListener = new AnimateFirstDisplayListener(); ImageView imageView = (ImageView) findViewById(R.id.infoArticleImageView); ImageLoader imageLoader; imageLoader = ImageLoader.getInstance(); imageLoader.init(ImageLoaderConfiguration.createDefault(getApplicationContext())); imageLoader.displayImage(imageURL, imageView, displayImageOptions, animateFirstListener); final ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_news_article); Intent intent = getIntent(); String title = intent.getStringExtra(NewsFragment.NEWS_ARTICLE_TITLE); imgURL = intent.getStringExtra(NewsFragment.NEWS_IMG_URL_BIG); String article = intent.getStringExtra(NewsFragment.NEWS_ARTICLE_TEXT); TextView articleNewsTitle = (TextView) findViewById(R.id.newsTitleTextView); articleNewsTitle.setText(title); TextView articleNewsText = (TextView) findViewById(R.id.newsArticleTextView); articleNewsText.setText(Html.fromHtml(article)); DisplayImageOptions displayImageOptions; ImageLoadingListener animateFirstListener; displayImageOptions = new DisplayImageOptions.Builder(). showImageForEmptyUri(R.drawable.ic_stub). showImageOnFail(R.drawable.ic_stub). cacheInMemory(true).cacheOnDisc(true).build(); animateFirstListener = new AnimateFirstDisplayListener(); ImageView imageView = (ImageView) findViewById(R.id.newsImageView); imageView.setOnClickListener(this); ImageLoader imageLoader; imageLoader = ImageLoader.getInstance(); imageLoader.init(ImageLoaderConfiguration.createDefault(getApplicationContext())); imageLoader.displayImage(imgURL, imageView, displayImageOptions, animateFirstListener); final ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); }
/** * 根据当前的索引更新组件的内容 * * */ private void updateComponentData(int position) { Photo photo = photos.get(position); final View view = mListViews.get(position); ImageViewTouch zoomableImageView = (ImageViewTouch) view.findViewById(R.id.zoomableImageView); zoomableImageView.setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View v) { VibratorUtil.Vibrate(PhotoDetailActivity.this, 50); mActionMode = startActionMode(new ActionModeOfSave(ActionModeOfSave.ACTION_MODE_SAVE_PHOTO)); return false; } }); zoomableImageView.setSingleTapListener(new OnImageViewTouchSingleTapListener() { @Override public void onSingleTapConfirmed() { if (actionBar.isShowing()) { actionBar.hide(); hideDescribe(); } else { actionBar.show(); showDescribe(); } } }); final ProgressBar pbLoading = (ProgressBar) view.findViewById(R.id.pbLoading); imageLoader.displayImage(photo.image, zoomableImageView, ImageOptions.getTransPictureOption(0));// 加载图片 MyApplication.getImageLoader().displayImage(photo.image, zoomableImageView, ImageOptions.getTransPictureOption(0), new ImageLoadingListener() { @Override public void onLoadingStarted() { pbLoading.setVisibility(View.VISIBLE); } @Override public void onLoadingFailed(FailReason failReason) { view.findViewById(R.id.tvErrorTip).setVisibility(View.VISIBLE); pbLoading.setVisibility(View.GONE); } @Override public void onLoadingComplete(Bitmap loadedImage) { view.findViewById(R.id.tvErrorTip).setVisibility(View.GONE); pbLoading.setVisibility(View.GONE); } @Override public void onLoadingCancelled() { pbLoading.setVisibility(View.GONE); } }); updateTitle(photo.position); setCurrentPhotoPosition(position); tvDesc.setText(photo.desc); tvAuthorAndDate.setText(new StringBuilder().append(photo.author.getName()).append(" 上传于 ").append(photo.created)); tvCommentNum.setText(photo.comments_count + ""); }
@Override public int onStartCommand(Intent intent, int flags, int startId) { if(intent.getBooleanExtra(NEXT_TRACK_MODE,false)) { /*request to start scrobbling the next track, check if it is sound*/ int pos = intent.getIntExtra(NEXT_TRACK_ID,0); String title = intent.getStringExtra(NEXT_TRACK_TITLE); if(trackList != null && trackList.size()>0) { //done listening to the previous track -> scrobble the previous track int now = (int)(System.currentTimeMillis()/1000); mLastfm.scrobbleTrack(track,now,new Lastfm.LastfmWaiter() { @Override public void onResult(boolean success) { //the user already sees the notification, no need for extras notifications atm. } }); mTrackDone = 0; if (pos == -1 && trackList.get(0).title.equals(title)) { //stop requested stop(); } else if (pos < trackList.size() && trackList.get(pos).title.equals(title)) { //ok, this is a valid request, make it happen play(pos); } } /*release the wakelock if it was called via the now playing alarm*/ NowPlayingAlarm.completeWakefulIntent(intent); } else { /*we have received a playlist, start playing*/ trackList = intent.getParcelableArrayListExtra(TRACK_LIST); thumb = intent.getStringExtra(THUMB_URL); albumArtURL = intent.getStringExtra(ALBUM_ART_URL); releaseId = intent.getLongExtra(RELEASE_ID,0); currentTrack = 0; /*first try to load the album art, then start playing*/ mImageLoader.loadImage(this, thumb, new ImageLoadingListener() { @Override public void onLoadingStarted() { } @Override public void onLoadingCancelled() { } @Override public void onLoadingFailed(FailReason failReason) { mNotificationBuilder.setLargeIcon(null); play(currentTrack); } @Override public void onLoadingComplete(Bitmap loadedImage) { mNotificationBuilder.setLargeIcon(loadedImage); play(currentTrack); } }); } return(START_NOT_STICKY); }
@Override public Object instantiateItem(ViewGroup view, int position) { View imageLayout = inflater.inflate(R.layout.item_pager_image, view, false); TouchImageView imageView = (TouchImageView) imageLayout.findViewById(R.id.image); final ProgressBar spinner = (ProgressBar) imageLayout.findViewById(R.id.loading); imageLoader.displayImage(images.get(position), imageView, options, new ImageLoadingListener() { @Override public void onLoadingStarted() { spinner.setVisibility(View.VISIBLE); } @Override public void onLoadingFailed(FailReason failReason) { String message = null; switch (failReason) { case IO_ERROR: message = "Input/Output error"; break; case OUT_OF_MEMORY: message = "Out Of Memory error"; break; case UNKNOWN: message = "Unknown error"; break; default: break; } Toast.makeText(ImagePagerActivity.this, message, Toast.LENGTH_SHORT).show(); spinner.setVisibility(View.GONE); } @Override public void onLoadingComplete(Bitmap bitmap) { spinner.setVisibility(View.GONE); } @Override public void onLoadingCancelled() { spinner.setVisibility(View.GONE); } }); view.addView(imageLayout, 0); return imageLayout; }
private void getAlbum(Album album) { tracksProgressBar.setVisibility(View.VISIBLE); QueryManager.getInstance().getAlbumInfo(album, new GetResponseCallback() { @Override public void onDataReceived(ReadyResult result) { if (checkForError(result, Params.ApiSource.LASTFM)) { tracksProgressBar.setVisibility(View.GONE); return; } List<Object> list = (List<Object>) result.getObject(); fillWithTracklist((List<Track>) list.get(1)); Album album1 = (Album) list.get(0); imageLoader.displayImage(album1.getImageUrl(), albumCoverImageView, options, new ImageLoadingListener() { @Override public void onLoadingStarted() { } @Override public void onLoadingFailed(FailReason failReason) { progressBar.setVisibility(View.GONE); } @Override public void onLoadingComplete(Bitmap bitmap) { progressBar.setVisibility(View.GONE); } @Override public void onLoadingCancelled() { progressBar.setVisibility(View.GONE); } }); artistTextView.setText(album1.getArtist()); titleTextView.setText(album1.getTitle()); otherTextView.setText(album1.getPublishDate()); tracksProgressBar.setVisibility(View.GONE); } }); }
public void setListener(ImageLoadingListener listener) { mListener = listener; }
/** * Adds load image task to execution pool. Image will be returned with * {@link ImageLoadingListener#onLoadingComplete(String, android.view.View, android.graphics.Bitmap)} callback}. * <br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param targetImageSize Minimal size for {@link Bitmap} which will be returned in * {@linkplain ImageLoadingListener#onLoadingComplete(String, android.view.View, * android.graphics.Bitmap)} callback}. Downloaded image will be decoded * and scaled to {@link Bitmap} of the size which is <b>equal or larger</b> (usually a bit * larger) than incoming targetImageSize. * @param options {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptions Options} for image * decoding and displaying. If <b>null</b> - default display image options * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) * from configuration} will be used.<br /> * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires * events on UI thread. * @param progressListener {@linkplain com.nostra13.universalimageloader.core.assist.ImageLoadingProgressListener * Listener} for image loading progress. Listener fires events on UI thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before */ public void loadImage(String uri, ImageSize targetImageSize, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) { checkConfiguration(); if (targetImageSize == null) { targetImageSize = configuration.getMaxImageSize(); } if (options == null) { options = configuration.defaultDisplayImageOptions; } ImageNonViewAware imageAware = new ImageNonViewAware(uri, targetImageSize, ViewScaleType.CROP); displayImage(uri, imageAware, options, listener, progressListener); }
/** * Adds display image task to execution pool. Image will be set to ImageAware when it's turn.<br /> * Default {@linkplain DisplayImageOptions display image options} from {@linkplain ImageLoaderConfiguration * configuration} will be used.<br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param imageAware {@linkplain com.nostra13.universalimageloader.core.imageaware.ImageAware Image aware view} * which should display image * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires events on * UI thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before * @throws IllegalArgumentException if passed <b>imageAware</b> is null */ public void displayImage(String uri, ImageAware imageAware, ImageLoadingListener listener) { displayImage(uri, imageAware, null, listener, null); }
/** * Adds display image task to execution pool. Image will be set to ImageAware when it's turn.<br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param imageAware {@linkplain com.nostra13.universalimageloader.core.imageaware.ImageAware Image aware view} * which should display image * @param options {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptions Options} for image * decoding and displaying. If <b>null</b> - default display image options * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) * from configuration} will be used. * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires events on * UI thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before * @throws IllegalArgumentException if passed <b>imageAware</b> is null */ public void displayImage(String uri, ImageAware imageAware, DisplayImageOptions options, ImageLoadingListener listener) { displayImage(uri, imageAware, options, listener, null); }
/** * Adds display image task to execution pool. Image will be set to ImageView when it's turn.<br /> * Default {@linkplain DisplayImageOptions display image options} from {@linkplain ImageLoaderConfiguration * configuration} will be used.<br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param imageView {@link ImageView} which should display image * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires events on * UI thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before * @throws IllegalArgumentException if passed <b>imageView</b> is null */ public void displayImage(String uri, ImageView imageView, ImageLoadingListener listener) { displayImage(uri, new ImageViewAware(imageView), null, listener, null); }
/** * Adds display image task to execution pool. Image will be set to ImageView when it's turn.<br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param imageView {@link ImageView} which should display image * @param options {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptions Options} for image * decoding and displaying. If <b>null</b> - default display image options * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) * from configuration} will be used. * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires events on * UI thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before * @throws IllegalArgumentException if passed <b>imageView</b> is null */ public void displayImage(String uri, ImageView imageView, DisplayImageOptions options, ImageLoadingListener listener) { displayImage(uri, imageView, options, listener, null); }
/** * Adds display image task to execution pool. Image will be set to ImageView when it's turn.<br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param imageView {@link ImageView} which should display image * @param options {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptions Options} for image * decoding and displaying. If <b>null</b> - default display image options * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) * from configuration} will be used. * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires * events on UI thread. * @param progressListener {@linkplain com.nostra13.universalimageloader.core.assist.ImageLoadingProgressListener * Listener} for image loading progress. Listener fires events on UI thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before * @throws IllegalArgumentException if passed <b>imageView</b> is null */ public void displayImage(String uri, ImageView imageView, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) { displayImage(uri, new ImageViewAware(imageView), options, listener, progressListener); }
/** * Adds load image task to execution pool. Image will be returned with * {@link ImageLoadingListener#onLoadingComplete(String, android.view.View, android.graphics.Bitmap)} callback}. * <br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires events on UI * thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before */ public void loadImage(String uri, ImageLoadingListener listener) { loadImage(uri, null, null, listener, null); }
/** * Adds load image task to execution pool. Image will be returned with * {@link ImageLoadingListener#onLoadingComplete(String, android.view.View, android.graphics.Bitmap)} callback}. * <br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param targetImageSize Minimal size for {@link Bitmap} which will be returned in * {@linkplain ImageLoadingListener#onLoadingComplete(String, android.view.View, * android.graphics.Bitmap)} callback}. Downloaded image will be decoded * and scaled to {@link Bitmap} of the size which is <b>equal or larger</b> (usually a bit * larger) than incoming targetImageSize. * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires * events on UI thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before */ public void loadImage(String uri, ImageSize targetImageSize, ImageLoadingListener listener) { loadImage(uri, targetImageSize, null, listener, null); }
/** * Adds load image task to execution pool. Image will be returned with * {@link ImageLoadingListener#onLoadingComplete(String, android.view.View, android.graphics.Bitmap)} callback}. * <br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param options {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptions Options} for image * decoding and displaying. If <b>null</b> - default display image options * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) from * configuration} will be used.<br /> * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires events on UI * thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before */ public void loadImage(String uri, DisplayImageOptions options, ImageLoadingListener listener) { loadImage(uri, null, options, listener, null); }
/** * Adds load image task to execution pool. Image will be returned with * {@link ImageLoadingListener#onLoadingComplete(String, android.view.View, android.graphics.Bitmap)} callback}. * <br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param targetImageSize Minimal size for {@link Bitmap} which will be returned in * {@linkplain ImageLoadingListener#onLoadingComplete(String, android.view.View, * android.graphics.Bitmap)} callback}. Downloaded image will be decoded * and scaled to {@link Bitmap} of the size which is <b>equal or larger</b> (usually a bit * larger) than incoming targetImageSize. * @param options {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptions Options} for image * decoding and displaying. If <b>null</b> - default display image options * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) * from configuration} will be used.<br /> * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires * events on UI thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before */ public void loadImage(String uri, ImageSize targetImageSize, DisplayImageOptions options, ImageLoadingListener listener) { loadImage(uri, targetImageSize, options, listener, null); }
/** * Adds display image task to execution pool. Image will be set to ImageView when it's turn.<br /> * Default {@linkplain DisplayImageOptions display image options} from {@linkplain ImageLoaderConfiguration * configuration} will be used.<br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param imageView {@link ImageView} which should display image * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires events on UI * thread. * * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before * @throws IllegalArgumentException if passed <b>imageView</b> is null */ public void displayImage(String uri, ImageView imageView, ImageLoadingListener listener) { displayImage(uri, imageView, null, listener); }
/** * Adds load image task to execution pool. Image will be returned with * {@link ImageLoadingListener#onLoadingComplete(Bitmap) callback}.<br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires events on UI * thread. * * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before */ public void loadImage(String uri, ImageLoadingListener listener) { loadImage(uri, null, null, listener); }
/** * Adds load image task to execution pool. Image will be returned with * {@link ImageLoadingListener#onLoadingComplete(Bitmap) callback}.<br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param minImageSize Minimal size for {@link Bitmap} which will be returned in * {@linkplain ImageLoadingListener#onLoadingComplete(Bitmap) callback}. Downloaded image will be decoded * and scaled to {@link Bitmap} of the size which is <b>equal or larger</b> (usually a bit larger) than * incoming minImageSize . * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires events on UI * thread. * * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before */ public void loadImage(String uri, ImageSize minImageSize, ImageLoadingListener listener) { loadImage(uri, minImageSize, null, listener); }
/** * Adds load image task to execution pool. Image will be returned with * {@link ImageLoadingListener#onLoadingComplete(Bitmap) callback}.<br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param options {@linkplain DisplayImageOptions Display image options} for image displaying. If <b>null</b> - * default display image options * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) from * configuration} will be used.<br /> * Incoming options should contain {@link FakeBitmapDisplayer} as displayer. * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires events on UI * thread. * * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before */ public void loadImage(String uri, DisplayImageOptions options, ImageLoadingListener listener) { loadImage(uri, null, options, listener); }
/** * Loads the specified uri using the passed {@link DisplayImageOptions} * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param options {@linkplain DisplayImageOptions Display image options} for image displaying. If <b>null</b> - * default display image options * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) from * configuration} will be used. * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires events on UI * thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before * @throws IllegalArgumentException if passed <b>imageView</b> is null */ public void setImage(String uri, DisplayImageOptions options, ImageLoadingListener listener) { ImageLoader.getInstance().displayImage(uri, this, options, listener); }