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.poloure.simplerss.Utilities.java

private static void switchToFragment(Fragment fragment, boolean addToBackStack) {
    if (fragment.isHidden()) {
        Fragment[] fragments = { s_fragmentFavourites, s_fragmentManage, s_fragmentFeeds, s_fragmentSettings };
        FragmentTransaction transaction = s_fragmentManager.beginTransaction();

        for (Fragment frag : fragments) {
            if (frag.isVisible()) {
                transaction.hide(frag);/*ww w.  j a v a2s. c  o  m*/
            }
        }
        transaction.show(fragment);
        if (addToBackStack) {
            transaction.addToBackStack(null);

            // Set the default transition for adding to the stack.
            transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        }
        transaction.commit();
        s_fragmentManager.executePendingTransactions();
        fragment.getActivity().invalidateOptionsMenu();
    }
}

From source file:com.ab.util.AbDialogUtil.java

/**
 * ??//w ww.ja  va 2s  .c om
 * @param view
 * @return
 */
public static AbSampleDialogFragment showFullScreenDialog(View view) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    // Create and show the dialog.
    AbSampleDialogFragment newFragment = AbSampleDialogFragment.newInstance(DialogFragment.STYLE_NORMAL,
            android.R.style.Theme_Black_NoTitleBar_Fullscreen);
    newFragment.setContentView(view);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //  
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

From source file:com.aoppp.gatewaymaster.dialogs.DialogUtil.java

/**
 * ?View.//  w w w .j a  v a2 s . c  om
 * @param view ?
 */
public static AlertDialogFragment showAlertDialog(View view) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    AlertDialogFragment newFragment = AlertDialogFragment.newInstance(0, null, null, view, null);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

From source file:com.bangqu.eshow.util.ESDialogUtil.java

/**
 * /*from w w  w  . ja  va  2  s .  co m*/
 * ???.
 * @param view
 * @param gravity ?
 * @param style
 * @return
 */
public static ESSampleDialogFragment showDialog(View view, int gravity, int style) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    // Create and show the dialog.
    ESSampleDialogFragment newFragment = ESSampleDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            style, gravity);
    newFragment.setContentView(view);

    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, dialogTag);

    return newFragment;
}

From source file:com.google.cast.samples.games.codelab.MainActivity.java

private void updateFragments() {
    if (isChangingConfigurations() || isFinishing() || isDestroyed()) {
        return;/*from   w w w . j  a  v  a  2s  .  c  om*/
    }

    Fragment fragment = mCastConnectionFragment;
    getFragmentManager().beginTransaction().replace(R.id.fragment_container, fragment)
            .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).commitAllowingStateLoss();
}

From source file:ab.util.AbDialogUtil.java

/**
 * ?????View//  w w w.  java  2 s . c  om
 * 
 * @param view
 * @return
 */
public static AbSampleDialogFragment showTipsDialog(View view) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    // Create and show the dialog.
    AbSampleDialogFragment newFragment = AbSampleDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            android.R.style.Theme_Holo_Light);
    newFragment.setContentView(view);

    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    // ?,content?fragment,Activity
    ft.add(android.R.id.content, newFragment, mDialogTag).addToBackStack(null).commit();

    return newFragment;
}

From source file:cn.org.eshow.framwork.util.AbDialogUtil.java

/**
 * // w w w .  j  a  v  a2  s . c om
 * ???.
 * @param view
 * @param gravity ?
 * @param style
 * @return
 */
public static AbSampleDialogFragment showDialog(View view, int gravity, int style) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    // Create and show the dialog.
    AbSampleDialogFragment newFragment = AbSampleDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            style, gravity);
    newFragment.setContentView(view);

    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, dialogTag);

    return newFragment;
}

From source file:com.tony.selene.dialog.AbDialogUtil.java

/**
 * //w  ww .java  2  s .c om
 * ???.
 * 
 * @param view
 * @param gravity
 *            ?
 * @param style
 * @return
 */
public static AbSampleDialogFragment showDialog(View view, int gravity, int style) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    // Create and show the dialog.
    AbSampleDialogFragment newFragment = AbSampleDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            style, gravity);
    newFragment.setContentView(view);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, dialogTag);

    return newFragment;
}

From source file:com.ab.util.AbDialogUtil.java

/**
 * //from  w w w  . j a  v  a  2 s.co  m
 * ???().
 * @param view
 * @param gravity ?
 * @return
 */
public static AbSampleDialogFragment showDialog(View view, int gravity) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    // Create and show the dialog.
    AbSampleDialogFragment newFragment = AbSampleDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            android.R.style.Theme_Holo_Light_Dialog, gravity);
    newFragment.setContentView(view);

    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);

    return newFragment;
}

From source file:com.aoppp.gatewaymaster.dialogs.DialogUtil.java

/**
 * ?String.// w w w .ja  v a2s .  c om
 * @param context
 *
 */
public static AlertDialogFragment showAlertDialog(Context context, String message) {
    FragmentActivity activity = (FragmentActivity) context;
    AlertDialogFragment newFragment = AlertDialogFragment.newInstance(0, null, message, null, null);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}