Search in sources :

Example 1 with TextSizeEnterSharedElementCallback

use of com.hannesdorfmann.mosby3.sample.mail.ui.transition.TextSizeEnterSharedElementCallback in project mosby by sockeqwe.

the class DetailsFragment method initTransitions.

@TargetApi(21)
private void initTransitions() {
    Window window = getActivity().getWindow();
    window.setEnterTransition(new ExplodeFadeEnterTransition(senderNameView, senderMailView, separatorLine));
    window.setExitTransition(new ExcludedExplodeTransition());
    window.setReenterTransition(new ExcludedExplodeTransition());
    window.setReturnTransition(new ExcludedExplodeTransition());
    TransitionSet textSizeSet = new TransitionSet();
    textSizeSet.addTransition(TransitionInflater.from(getActivity()).inflateTransition(android.R.transition.move));
    TextSizeTransition textSizeTransition = new TextSizeTransition();
    textSizeTransition.addTarget(R.id.subject);
    textSizeTransition.addTarget(getString(R.string.shared_mail_subject));
    textSizeSet.addTransition(textSizeTransition);
    textSizeSet.setOrdering(TransitionSet.ORDERING_TOGETHER);
    window.setSharedElementEnterTransition(textSizeSet);
    getActivity().setEnterSharedElementCallback(new TextSizeEnterSharedElementCallback(getActivity()));
}
Also used : Window(android.view.Window) TransitionSet(android.transition.TransitionSet) TextSizeTransition(com.hannesdorfmann.mosby3.sample.mail.ui.transition.TextSizeTransition) ExplodeFadeEnterTransition(com.hannesdorfmann.mosby3.sample.mail.ui.transition.ExplodeFadeEnterTransition) TextSizeEnterSharedElementCallback(com.hannesdorfmann.mosby3.sample.mail.ui.transition.TextSizeEnterSharedElementCallback) ExcludedExplodeTransition(com.hannesdorfmann.mosby3.sample.mail.ui.transition.ExcludedExplodeTransition) TargetApi(android.annotation.TargetApi)

Aggregations

TargetApi (android.annotation.TargetApi)1 TransitionSet (android.transition.TransitionSet)1 Window (android.view.Window)1 ExcludedExplodeTransition (com.hannesdorfmann.mosby3.sample.mail.ui.transition.ExcludedExplodeTransition)1 ExplodeFadeEnterTransition (com.hannesdorfmann.mosby3.sample.mail.ui.transition.ExplodeFadeEnterTransition)1 TextSizeEnterSharedElementCallback (com.hannesdorfmann.mosby3.sample.mail.ui.transition.TextSizeEnterSharedElementCallback)1 TextSizeTransition (com.hannesdorfmann.mosby3.sample.mail.ui.transition.TextSizeTransition)1