I am using Universal Image Loader to "lazy load" my images from the web. Is it possible to use the fade in animation but fade in "from black" instead of "from white"? My app has a black background and I'd like it to smoothly fade it as opposed to "flash" in that the current effect looks like.
Here is the code that is working that fades from white
DisplayImageOptions options;
options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.drawable.no_poster)
.showImageForEmptyUri(R.drawable.no_poster)
.showImageOnFail(R.drawable.no_poster)
.displayer(new FadeInBitmapDisplayer(500))
.cacheInMemory(true)
.cacheOnDisc(true)
.build();
ImageView myPosterView = (ImageView)findViewById(R.id.movieposterlarge);
imageLoader.displayImage(movie_poster, myPosterView,options);
This seems to work for me.
options = new DisplayImageOptions.Builder()
.showImageOnLoading(android.R.color.black)
.showImageForEmptyUri(android.R.color.black)
Note, you also have to set the background of whatever view you are using to black also:
<GridView
android:id="@+id/gridview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="0dp"
android:background="@color/Black"
android:horizontalSpacing="0dp"
android:numColumns="1"
android:padding="0dp"
android:stretchMode="columnWidth"
android:verticalSpacing="10dp" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With