Howto show next row before animain is done
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 AlphaAnim开发者_如何学运维ation(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?
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.
精彩评论