List of usage examples for android.transition TransitionSet getTransitionAt
public Transition getTransitionAt(int index)
From source file:Main.java
public static @Nullable Transition findTransition(@NonNull TransitionSet set, @NonNull Class<? extends Transition> clazz) { for (int i = 0; i < set.getTransitionCount(); i++) { Transition transition = set.getTransitionAt(i); if (transition.getClass() == clazz) { return transition; }/*from w ww .j a va 2 s .c o m*/ if (transition instanceof TransitionSet) { Transition child = findTransition((TransitionSet) transition, clazz); if (child != null) return child; } } return null; }
From source file:Main.java
public static @Nullable Transition findTransition(@NonNull TransitionSet set, @NonNull Class<? extends Transition> clazz, @IdRes int targetId) { for (int i = 0; i < set.getTransitionCount(); i++) { Transition transition = set.getTransitionAt(i); if (transition.getClass() == clazz) { if (transition.getTargetIds().contains(targetId)) { return transition; }//from www . j av a 2 s . c o m } if (transition instanceof TransitionSet) { Transition child = findTransition((TransitionSet) transition, clazz, targetId); if (child != null) return child; } } return null; }