Example usage for android.app FragmentTransaction TRANSIT_FRAGMENT_FADE

List of usage examples for android.app FragmentTransaction TRANSIT_FRAGMENT_FADE

Introduction

In this page you can find the example usage for android.app FragmentTransaction TRANSIT_FRAGMENT_FADE.

Prototype

int TRANSIT_FRAGMENT_FADE

To view the source code for android.app FragmentTransaction TRANSIT_FRAGMENT_FADE.

Click Source Link

Document

Fragment should simply fade in or out; that is, no strong navigation associated with it except that it is appearing or disappearing for some reason.

Usage

From source file:android.app.FragmentManager.java

public static int reverseTransit(int transit) {
    int rev = 0;//from   w  ww. j  ava 2  s . c o m
    switch (transit) {
    case FragmentTransaction.TRANSIT_FRAGMENT_OPEN:
        rev = FragmentTransaction.TRANSIT_FRAGMENT_CLOSE;
        break;
    case FragmentTransaction.TRANSIT_FRAGMENT_CLOSE:
        rev = FragmentTransaction.TRANSIT_FRAGMENT_OPEN;
        break;
    case FragmentTransaction.TRANSIT_FRAGMENT_FADE:
        rev = FragmentTransaction.TRANSIT_FRAGMENT_FADE;
        break;
    }
    return rev;

}

From source file:android.app.FragmentManager.java

public static int transitToStyleIndex(int transit, boolean enter) {
    int animAttr = -1;
    switch (transit) {
    case FragmentTransaction.TRANSIT_FRAGMENT_OPEN:
        animAttr = enter ? com.android.internal.R.styleable.FragmentAnimation_fragmentOpenEnterAnimation
                : com.android.internal.R.styleable.FragmentAnimation_fragmentOpenExitAnimation;
        break;//  w w  w . j av a  2 s . c  o  m
    case FragmentTransaction.TRANSIT_FRAGMENT_CLOSE:
        animAttr = enter ? com.android.internal.R.styleable.FragmentAnimation_fragmentCloseEnterAnimation
                : com.android.internal.R.styleable.FragmentAnimation_fragmentCloseExitAnimation;
        break;
    case FragmentTransaction.TRANSIT_FRAGMENT_FADE:
        animAttr = enter ? com.android.internal.R.styleable.FragmentAnimation_fragmentFadeEnterAnimation
                : com.android.internal.R.styleable.FragmentAnimation_fragmentFadeExitAnimation;
        break;
    }
    return animAttr;
}