0

I am having trouble with my layout animation.

The layout is a listview, and as the listview is loaded it has its rows slided into screen from left (android.R.anim.slide_in_left) with some delay after each childe, using the LayoutAnimationController.

Everything works nicely.

I also have a method that deletes all rows.

I tried to animate this using the same technique, just animation slides the rows out of the screen (android.R.anim.slide_out_right). This however does not seem to work, the rows dont get animated and if I scroll through the listView only some randomly seem to slide out. Its weird.

What could be the problem or if this is expected behaviour, whats the workaround?

P.S. If we coulde get this to work, is there a way to set something like a animation listener when using the layout animation controller? so I could actually delete the rows in the onAnimationEnd() method. Usual stuff.

Thanks !

urSus
  • 12,492
  • 12
  • 69
  • 89

1 Answers1

0

this may or may not help, but worth a shot:

I'm using a layout and listening globally for any change.

fLayout.getViewTreeObserver().addOnGlobalLayoutListener(
                new OnGlobalLayoutListener() {
                    @Override
                    public void onGlobalLayout() {
                        Log.d(LOG_TAG, "fLayout global layout");
                        fLayout.getViewTreeObserver().removeGlobalOnLayoutListener(this);
                        //code here
});
kevinl
  • 4,194
  • 6
  • 37
  • 55