Example usage for android.app FragmentTransaction TRANSIT_FRAGMENT_OPEN

List of usage examples for android.app FragmentTransaction TRANSIT_FRAGMENT_OPEN

Introduction

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

Prototype

int TRANSIT_FRAGMENT_OPEN

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

Click Source Link

Document

Fragment is being added onto the stack

Usage

From source file:com.hijacker.MainActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.reset:
        stop(PROCESS_AIRODUMP);/*from ww  w .j  a  va  2  s  . c om*/
        Tile.clear();
        Tile.onCountsChanged();
        Airodump.startClean();
        return true;

    case R.id.stop_run:
        if (Airodump.isRunning())
            stop(PROCESS_AIRODUMP);
        else
            Airodump.start();
        return true;

    case R.id.stop_aireplay:
        stop(PROCESS_AIREPLAY);
        return true;

    case R.id.filter:
        new FiltersDialog().show(mFragmentManager, "FiltersDialog");
        return true;

    case R.id.settings:
        if (currentFragment != FRAGMENT_SETTINGS) {
            FragmentTransaction ft = mFragmentManager.beginTransaction();
            ft.replace(R.id.fragment1, new SettingsFragment());
            ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
            ft.addToBackStack(null);
            ft.commitAllowingStateLoss();
        }
        return true;

    case R.id.export:
        new ExportDialog().show(mFragmentManager, "ExportDialog");
        return true;

    default:
        return super.onOptionsItemSelected(item);
    }
}

From source file:com.hijacker.MainActivity.java

static void isolate(String mac) {
    is_ap = getAPByMac(mac);/*from w  ww .java 2 s  . c om*/
    if (is_ap != null) {
        IsolatedFragment.exit_on = mFragmentManager.getBackStackEntryCount();
        FragmentTransaction ft = mFragmentManager.beginTransaction();
        ft.replace(R.id.fragment1, new IsolatedFragment());
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        ft.addToBackStack(null);
        ft.commitAllowingStateLoss();
    }
    Tile.filter();
    if (debug) {
        if (is_ap == null)
            Log.d("HIJACKER/Main", "No AP isolated");
        else
            Log.d("HIJACKER/Main", "AP with MAC " + mac + " isolated");
    }
}

From source file:android.app.FragmentManager.java

public static int reverseTransit(int transit) {
    int rev = 0;//  w  w  w.ja  v  a  2s  .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;//from  ww  w  .j a v  a2  s.co  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;
}

From source file:com.android.mail.compose.ComposeActivity.java

private void showWaitFragment(Account account) {
    WaitFragment fragment = getWaitFragment();
    if (fragment != null) {
        fragment.updateAccount(account);
    } else {/*from  www. j a  v a2s  .  c o m*/
        findViewById(R.id.wait).setVisibility(View.VISIBLE);
        replaceFragment(WaitFragment.newInstance(account, false /* expectingMessages */),
                FragmentTransaction.TRANSIT_FRAGMENT_OPEN, TAG_WAIT);
    }
}