Skip to content Skip to sidebar Skip to footer

Wait For Other View Animation End

I have the following layout snippet: Copy

Solution 2:

This is not an answer but a ready-to use code snippet that you may try to examine what is happening.

mContainer = (ViewGroup) v.findViewById(R.id.container);
if (Build.VERSION.SDK_INT >= 11) {
    mLayoutTransition = mContainer.getLayoutTransition();

    if (mLayoutTransition != null) {
        mLayoutTransition.addTransitionListener(newLayoutTransition.TransitionListener() {

            @OverridepublicvoidstartTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) {
                Log.d("\n\n startTransition: in "+container+" view "+view+" type "+ descr(transitionType));
            }

            @OverridepublicvoidendTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType) {
                Log.d("\n\n endTransition: in "+container+" view "+view+" type "+ descr(transitionType));
            }

            Stringdescr(int transitionType) {
                String[] m = newString[]{"CHANGE_APPEARING","CHANGE_DISAPPEARING","APPEARING","DISAPPEARING"};
                return"" + transitionType + ": " + m[transitionType&3] + " changing="+( transitionType&LayoutTransition.CHANGING);
            }
        });
    }
}

For me, the container view is a LinearLayout and the event of interest is:

publicvoidendTransition(LayoutTransition transition, ViewGroup container, View view, int transitionType){ // UI threadif (transitionType == LayoutTransition.DISAPPEARING) {
        // start 2nd animation, it will be done while another view is moved
    }
}

Post a Comment for "Wait For Other View Animation End"