Example usage for android.view ViewGroup setLayoutAnimationListener

List of usage examples for android.view ViewGroup setLayoutAnimationListener

Introduction

In this page you can find the example usage for android.view ViewGroup setLayoutAnimationListener.

Prototype

public void setLayoutAnimationListener(Animation.AnimationListener animationListener) 

Source Link

Document

Specifies the animation listener to which layout animation events must be sent.

Usage

From source file:com.android.contacts.list.MultiSelectContactsListFragment.java

protected void setLayoutAnimation(final ViewGroup view, int animationId) {
    if (view == null) {
        return;/* w w w.j a  v a  2  s  .  c om*/
    }
    view.setLayoutAnimationListener(new Animation.AnimationListener() {
        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            view.setLayoutAnimation(null);
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    view.setLayoutAnimation(AnimationUtils.loadLayoutAnimation(getActivity(), animationId));
}