Java Code Examples for android.transition.Transition#excludeTarget()

The following examples show how to use android.transition.Transition#excludeTarget() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StreamActivity.java    From Twire with GNU General Public License v3.0 6 votes vote down vote up
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private TransitionSet constructTransitions() {
    int[] slideTargets = {R.id.ChatRecyclerView, R.id.chat_input, R.id.chat_input_divider};

    Transition slideTransition = new Slide(Gravity.BOTTOM);
    Transition fadeTransition = new Fade();

    for (int slideTarget : slideTargets) {
        slideTransition.addTarget(slideTarget);
        fadeTransition.excludeTarget(slideTarget, true);
    }

    TransitionSet set = new TransitionSet();
    set.addTransition(slideTransition);
    set.addTransition(fadeTransition);
    return set;
}
 
Example 2
Source File: LiveStreamActivity.java    From Pocket-Plays-for-Twitch with GNU General Public License v3.0 6 votes vote down vote up
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
private TransitionSet constructTransitions() {
	int[] slideTargets = {R.id.ChatRecyclerView, R.id.chat_input, R.id.chat_input_divider};

	Transition slideTransition = new Slide(Gravity.BOTTOM);
	Transition fadeTransition = new Fade();

	for (int slideTarget : slideTargets) {
		slideTransition.addTarget(slideTarget);
		fadeTransition.excludeTarget(slideTarget, true);
	}

	TransitionSet set = new TransitionSet();
	set.addTransition(slideTransition);
	set.addTransition(fadeTransition);
	return set;
}
 
Example 3
Source File: ViewActivity.java    From recurrence with GNU General Public License v3.0 5 votes vote down vote up
public void setupTransitions() {
    // Add shared element transition animation if on Lollipop or later
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        // Enter transitions
        TransitionSet setEnter = new TransitionSet();

        Transition slideDown = new Explode();
        slideDown.addTarget(headerView);
        slideDown.excludeTarget(scrollView, true);
        slideDown.setDuration(500);
        setEnter.addTransition(slideDown);

        Transition fadeOut = new Slide(Gravity.BOTTOM);
        fadeOut.addTarget(scrollView);
        fadeOut.setDuration(500);
        setEnter.addTransition(fadeOut);

        // Exit transitions
        TransitionSet setExit = new TransitionSet();

        Transition slideDown2 = new Explode();
        slideDown2.addTarget(headerView);
        slideDown2.setDuration(570);
        setExit.addTransition(slideDown2);

        Transition fadeOut2 = new Slide(Gravity.BOTTOM);
        fadeOut2.addTarget(scrollView);
        fadeOut2.setDuration(280);
        setExit.addTransition(fadeOut2);

        getWindow().setEnterTransition(setEnter);
        getWindow().setReturnTransition(setExit);
    }
}
 
Example 4
Source File: FragmentTransitionCompat21.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
public static void excludeTarget(Object transitionObject, View view, boolean exclude) {
    Transition transition = (Transition) transitionObject;
    transition.excludeTarget(view, exclude);
}