use of com.bluelinelabs.conductor.demo.util.AnimUtils.TransitionEndListener in project Conductor by bluelinelabs.
the class FabToDialogTransitionChangeHandler method executePropertyChanges.
@Override
public void executePropertyChanges(@NonNull ViewGroup container, @Nullable View from, @Nullable View to, @NonNull Transition transition, boolean isPush) {
if (isPush) {
fabParent.removeView(fab);
container.addView(to);
/*
* After the transition is finished we have to add the fab back to the original container.
* Because otherwise we will be lost when trying to transition back.
* Set it to invisible because we don't want it to jump back after the transition
*/
transition.addListener(new AnimUtils.TransitionEndListener() {
@Override
public void onTransitionCompleted(Transition transition) {
fab.setVisibility(View.GONE);
fabParent.addView(fab);
fab = null;
fabParent = null;
}
});
} else {
dialogBackground.setVisibility(View.INVISIBLE);
fabParent.addView(fab);
container.removeView(from);
transition.addListener(new TransitionEndListener() {
@Override
public void onTransitionCompleted(Transition transition) {
fabParent.removeView(dialogBackground);
dialogBackground = null;
}
});
}
}
Aggregations