views:

29

answers:

1

I have tried to solve this for days but now i try my luck here.

I use an lazy load to show my images in a custom adaper. i want to fade in images as they ar download loaded.

This is working BUT the Thread stops while animation is ON

public void run()
    {
        if(bitmap!=null) {
    myProgressBar.setVisibility(View.INVISIBLE);
    imageView.setVisibility(View.VISIBLE);
    Animation animation = new AlphaAnimation(0.0f,1.0f);
    animation.setDuration(800);
    imageView.startAnimation(animation);
    imageView.setImageBitmap(bitmap);
        }else {
            myProgressBar.setVisibility(View.VISIBLE);
            imageView.setVisibility(View.INVISIBLE);
            imageView.setImageResource();
        }

what I want to do is to show next row even if the privius animaion not are finished.

Any ides?

A: 

This is so because the thread hasn't anything more to execute after the line

imageView.setImageBitmap(bitmap);

is reached.

Although you set a duration of 800 ms, Java doesn't wait on the startAnimation line until this 800 ms are over. If you want to stop your thread after the animation is completed I would recommend to use an AnimationListener to get notified when the animation ends.

Roflcoptr
this i the orginal versin of the imageloaderclass that im using: http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012 i added a progressbar and i want to fade the image in., the progressbar is there and the image fade in but the next image in other rows in the listview isent shown before the animation is done.
FoJjen