use of android.transition.Transition.TransitionListener in project packages_apps_Contacts by AOKP.
the class ExpandingEntryCardView method expand.
private void expand() {
ChangeBounds boundsTransition = new ChangeBounds();
boundsTransition.setDuration(DURATION_EXPAND_ANIMATION_CHANGE_BOUNDS);
Fade fadeIn = new Fade(Fade.IN);
fadeIn.setDuration(DURATION_EXPAND_ANIMATION_FADE_IN);
fadeIn.setStartDelay(DELAY_EXPAND_ANIMATION_FADE_IN);
TransitionSet transitionSet = new TransitionSet();
transitionSet.addTransition(boundsTransition);
transitionSet.addTransition(fadeIn);
transitionSet.excludeTarget(R.id.text, /* exclude = */
true);
final ViewGroup transitionViewContainer = mAnimationViewGroup == null ? this : mAnimationViewGroup;
transitionSet.addListener(new TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
mListener.onExpand();
}
@Override
public void onTransitionEnd(Transition transition) {
mListener.onExpandDone();
}
@Override
public void onTransitionCancel(Transition transition) {
}
@Override
public void onTransitionPause(Transition transition) {
}
@Override
public void onTransitionResume(Transition transition) {
}
});
TransitionManager.beginDelayedTransition(transitionViewContainer, transitionSet);
mIsExpanded = true;
// In order to insert new entries, we may need to inflate them for the first time
inflateAllEntries(LayoutInflater.from(getContext()));
insertEntriesIntoViewGroup();
updateExpandCollapseButton(getCollapseButtonText(), DURATION_EXPAND_ANIMATION_CHANGE_BOUNDS);
}
use of android.transition.Transition.TransitionListener in project Conductor by bluelinelabs.
the class ArcFadeMoveChangeHandler method getSharedElementTransition.
@Nullable
@Override
public Transition getSharedElementTransition(@NonNull ViewGroup container, @Nullable final View from, @Nullable View to, boolean isPush) {
Transition transition = new TransitionSet().addTransition(new ChangeBounds()).addTransition(new ChangeClipBounds()).addTransition(new ChangeTransform());
transition.setPathMotion(new ArcMotion());
// The framework doesn't totally fade out the "from" shared element, so we'll hide it manually once it's safe.
transition.addListener(new TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
if (from != null) {
for (String name : sharedElementNames) {
View namedView = TransitionUtils.findNamedView(from, name);
if (namedView != null) {
namedView.setVisibility(View.INVISIBLE);
}
}
}
}
@Override
public void onTransitionEnd(Transition transition) {
}
@Override
public void onTransitionCancel(Transition transition) {
}
@Override
public void onTransitionPause(Transition transition) {
}
@Override
public void onTransitionResume(Transition transition) {
}
});
return transition;
}
use of android.transition.Transition.TransitionListener in project Conductor by bluelinelabs.
the class TransitionChangeHandler method performChange.
@Override
public void performChange(@NonNull final ViewGroup container, @Nullable final View from, @Nullable final View to, final boolean isPush, @NonNull final ControllerChangeCompletedListener changeListener) {
if (canceled) {
changeListener.onChangeCompleted();
return;
}
if (needsImmediateCompletion) {
executePropertyChanges(container, from, to, null, isPush);
changeListener.onChangeCompleted();
return;
}
final Transition transition = getTransition(container, from, to, isPush);
transition.addListener(new TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
}
@Override
public void onTransitionEnd(Transition transition) {
changeListener.onChangeCompleted();
}
@Override
public void onTransitionCancel(Transition transition) {
changeListener.onChangeCompleted();
}
@Override
public void onTransitionPause(Transition transition) {
}
@Override
public void onTransitionResume(Transition transition) {
}
});
prepareForTransition(container, from, to, transition, isPush, new OnTransitionPreparedListener() {
@Override
public void onPrepared() {
if (!canceled) {
TransitionManager.beginDelayedTransition(container, transition);
executePropertyChanges(container, from, to, transition, isPush);
}
}
});
}
Aggregations