List of usage examples for android.view ViewGroup addOnAttachStateChangeListener
public void addOnAttachStateChangeListener(OnAttachStateChangeListener listener)
From source file:android.support.transition.TransitionManager.java
private static void sceneChangeRunTransition(final ViewGroup sceneRoot, final Transition transition) { if (transition != null && sceneRoot != null) { MultiListener listener = new MultiListener(transition, sceneRoot); sceneRoot.addOnAttachStateChangeListener(listener); sceneRoot.getViewTreeObserver().addOnPreDrawListener(listener); }/*from w w w. j a va 2 s. com*/ }
From source file:android.support.transition.TransitionManagerPort.java
private static void sceneChangeRunTransition(final ViewGroup sceneRoot, final TransitionPort transition) { if (transition != null && sceneRoot != null) { MultiListener listener = new MultiListener(transition, sceneRoot); sceneRoot.addOnAttachStateChangeListener(listener); sceneRoot.getViewTreeObserver().addOnPreDrawListener(listener); }/*w w w .j ava2 s . c o m*/ }
From source file:com.transitionseverywhere.TransitionManager.java
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1) private static void sceneChangeRunTransition(final ViewGroup sceneRoot, final Transition transition) { if (transition != null && sceneRoot != null && isTransitionsAllowed()) { ViewGroupOverlayUtils.initializeOverlay(sceneRoot); MultiListener listener = new MultiListener(transition, sceneRoot); sceneRoot.addOnAttachStateChangeListener(listener); sceneRoot.getViewTreeObserver().addOnPreDrawListener(listener); } else {//from w w w . j a v a2s. c o m sPendingTransitions.remove(sceneRoot); } }