Search in sources :

Example 1 with Transition

use of android.support.transition.Transition in project Memento-Calendar by alexstyl.

the class SearchActivity method exitTransitionWithAction.

private void exitTransitionWithAction(final Runnable endingAction) {
    Transition transition = FadeOutTransition.withAction(new SimpleTransitionListener() {

        @Override
        public void onTransitionEnd(Transition transition) {
            endingAction.run();
        }
    });
    TransitionManager.beginDelayedTransition(searchbar, transition);
    fader.hideContentOf(searchbar);
    TransitionManager.beginDelayedTransition(content, new Fade(Fade.OUT));
}
Also used : FadeOutTransition(com.alexstyl.specialdates.transition.FadeOutTransition) FadeInTransition(com.alexstyl.specialdates.transition.FadeInTransition) Transition(android.support.transition.Transition) SimpleTransitionListener(com.alexstyl.specialdates.transition.SimpleTransitionListener) Fade(android.support.transition.Fade)

Example 2 with Transition

use of android.support.transition.Transition in project weiui by kuaifan.

the class BottomNavigationViewEx method addAnimationListener.

private void addAnimationListener() {
    /**
     * 1. BottomNavigationMenuView mMenuView
     * 2. private final BottomNavigationAnimationHelperBase mAnimationHelper;
     * 3. private final TransitionSet mSet;
     */
    BottomNavigationMenuView mMenuView = getBottomNavigationMenuView();
    Object mAnimationHelper = getField(mMenuView.getClass(), mMenuView, "mAnimationHelper");
    TransitionSet mSet = getField(mAnimationHelper.getClass(), mAnimationHelper, "mSet");
    mSet.addListener(new Transition.TransitionListener() {

        @Override
        public void onTransitionStart(@NonNull Transition transition) {
        }

        @Override
        public void onTransitionEnd(@NonNull Transition transition) {
            refreshTextViewVisibility();
        }

        @Override
        public void onTransitionCancel(@NonNull Transition transition) {
            refreshTextViewVisibility();
        }

        @Override
        public void onTransitionPause(@NonNull Transition transition) {
        }

        @Override
        public void onTransitionResume(@NonNull Transition transition) {
        }
    });
}
Also used : TransitionSet(android.support.transition.TransitionSet) Transition(android.support.transition.Transition) BottomNavigationMenuView(android.support.design.internal.BottomNavigationMenuView)

Example 3 with Transition

use of android.support.transition.Transition in project Memento-Calendar by alexstyl.

the class SearchTransitioner method transitionToSearch.

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void transitionToSearch() {
    if (transitioning) {
        return;
    }
    if (supportsTransitions()) {
        Transition transition = FadeOutTransition.withAction(navigateToSearchWhenDone());
        TransitionManager.beginDelayedTransition(toolbar, transition);
        ViewCompat.setElevation(toolbarHolder, activity.getResources().getDimensionPixelSize(R.dimen.toolbar_elevation));
        expandToolbar();
        viewFader.hideContentOf(toolbar);
        TransitionManager.beginDelayedTransition(activityContent, new Fade(Fade.OUT));
        activityContent.setVisibility(GONE);
    } else {
        navigator.toSearch(activity);
    }
}
Also used : FadeInTransition(com.alexstyl.specialdates.transition.FadeInTransition) FadeOutTransition(com.alexstyl.specialdates.transition.FadeOutTransition) Transition(android.support.transition.Transition) Fade(android.support.transition.Fade) TargetApi(android.annotation.TargetApi)

Aggregations

Transition (android.support.transition.Transition)3 Fade (android.support.transition.Fade)2 FadeInTransition (com.alexstyl.specialdates.transition.FadeInTransition)2 FadeOutTransition (com.alexstyl.specialdates.transition.FadeOutTransition)2 TargetApi (android.annotation.TargetApi)1 BottomNavigationMenuView (android.support.design.internal.BottomNavigationMenuView)1 TransitionSet (android.support.transition.TransitionSet)1 SimpleTransitionListener (com.alexstyl.specialdates.transition.SimpleTransitionListener)1