Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Universal Image Loader using 2 displayer

How can I add a FadeInBitmapDisplayer AND a RoundedBitmapDisplayer to my Image?

This is my DisplayImageOptions

options = new DisplayImageOptions.Builder()
.showStubImage(R.drawable.appwidget
.cacheInMemory().displayer(new FadeInBitmapDisplayer(1500))
.build();

And is it possible somehow to only use the FadeIn Effect once? And if it's loaded and I scroll down my list and scroll back up again it does not FadeIn a second time?

Thanks alot in advance!

like image 961
user754730 Avatar asked Nov 30 '22 22:11

user754730


1 Answers

How can I add a FadeInBitmapDisplayer AND a RoundedBitmapDisplayer to my Image?

No way in current version. You can create your own displayer (extend BitmapDisplayer) and copy code from FadeInBitmapDisplayer and RoundedBitmapDisplayer into your class.

And is it possible somehow to only use the FadeIn Effect once?

Almost everything is possible :) But it will be not so convenient.

You can keep displayed images URLs in some map (Map<String, Boolean> = [Image URL<->isDisplayed]) and check this map before imageLoader.displayImage(...) call. If image for current URL is in Map (i.e. image was displayed) then use options with only RoundedBitmapDisplayer. If image for current URL isn't in Map then use options with FadeInBitmapDisplayer+RoundedBitmapDisplayer displayer.

like image 73
nostra13 Avatar answered Dec 24 '22 21:12

nostra13