Example usage for android.app FragmentTransaction setTransition

List of usage examples for android.app FragmentTransaction setTransition

Introduction

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

Prototype

public abstract FragmentTransaction setTransition(@Transit int transit);

Source Link

Document

Select a standard transition animation for this transaction.

Usage

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

/**
 * ??./*from ww w . jav a  2 s. co m*/
 * @param context the context
 * @param indeterminateDrawable
 * @param message the message
 * @param abDialogOnRefreshListener
 */
public static AbLoadDialogFragment showLoadPanel(Context context, int indeterminateDrawable, String message,
        AbDialogOnLoadListener abDialogOnLoadListener) {
    FragmentActivity activity = (FragmentActivity) context;
    AbLoadDialogFragment newFragment = AbLoadDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            android.R.style.Theme_Light_Panel);
    newFragment.setIndeterminateDrawable(indeterminateDrawable);
    newFragment.setMessage(message);
    newFragment.setAbDialogOnLoadListener(abDialogOnLoadListener);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

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

/**
 * ??.// www. ja  v a 2 s  .com
 * @param context the context
 * @param indeterminateDrawable
 * @param message the message
 * @param abDialogOnRefreshListener
 */
public static AbRefreshDialogFragment showRefreshDialog(Context context, int indeterminateDrawable,
        String message) {
    FragmentActivity activity = (FragmentActivity) context;
    AbRefreshDialogFragment newFragment = AbRefreshDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            android.R.style.Theme_Holo_Light_Dialog);
    newFragment.setIndeterminateDrawable(indeterminateDrawable);
    newFragment.setMessage(message);
    newFragment.setAbDialogOnLoadListener(null);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

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

/**
 * ??./*from   ww w .  jav a  2s .co  m*/
 * @param context
 * @param indeterminateDrawable
 * @param message
 * @param abDialogOnRefreshListener
 * @return
 */
public static AbRefreshDialogFragment showRefreshDialog(Context context, int indeterminateDrawable,
        String message, AbDialogOnLoadListener abDialogOnLoadListener) {
    FragmentActivity activity = (FragmentActivity) context;
    AbRefreshDialogFragment newFragment = AbRefreshDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            android.R.style.Theme_Holo_Light_Dialog);
    newFragment.setIndeterminateDrawable(indeterminateDrawable);
    newFragment.setMessage(message);
    newFragment.setAbDialogOnLoadListener(abDialogOnLoadListener);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

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

/**
 * ??.//w w  w .j a  v a 2s. c  o m
 * @param context the context
 * @param indeterminateDrawable
 * @param message the message
 */
public static AbRefreshDialogFragment showRefreshPanel(Context context, int indeterminateDrawable,
        String message) {
    FragmentActivity activity = (FragmentActivity) context;
    AbRefreshDialogFragment newFragment = AbRefreshDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            android.R.style.Theme_Light_Panel);
    newFragment.setIndeterminateDrawable(indeterminateDrawable);
    newFragment.setMessage(message);
    newFragment.setAbDialogOnLoadListener(null);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

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

/**
 * ??.//from   w  ww  .ja  v a 2s. c o m
 * @param context
 * @param indeterminateDrawable
 * @param message
 * @param abDialogOnRefreshListener
 * @return
 */
public static AbRefreshDialogFragment showRefreshPanel(Context context, int indeterminateDrawable,
        String message, AbDialogOnLoadListener abDialogOnLoadListener) {
    FragmentActivity activity = (FragmentActivity) context;
    AbRefreshDialogFragment newFragment = AbRefreshDialogFragment.newInstance(DialogFragment.STYLE_NO_TITLE,
            android.R.style.Theme_Light_Panel);
    newFragment.setIndeterminateDrawable(indeterminateDrawable);
    newFragment.setMessage(message);
    newFragment.setAbDialogOnLoadListener(abDialogOnLoadListener);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

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

/**
 * ?string?./*from   www  .  ja  v a 2s  .  c  om*/
 * 
 * @param context
 * @param icon
 * @param title
 *            ?
 * @param message
 *            ???
 * @param onClickListener
 *            ?
 */
public static TCAlertDialogFragment showAlertDialog(Context context, int icon, String title, String message,
        TCAlertDialogFragmentOnClickListener onClickListener) {
    FragmentActivity activity = (FragmentActivity) context;
    TCAlertDialogFragment newFragment = TCAlertDialogFragment.newInstance(icon, title, message, null,
            onClickListener);
    FragmentManager fm = activity.getFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    // 
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, dialogTag);
    return newFragment;
}

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

/**
 * ?????View//  w ww .j av  a 2s.  c o m
 * @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:com.ab.util.AbDialogUtil.java

/**
 * ??Fragment./*ww  w  . j  a va2s .  co  m*/
 * @param context the context
 */
public static void removeDialog(Context context) {
    try {
        FragmentActivity activity = (FragmentActivity) context;
        FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
        //    
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE);
        Fragment prev = activity.getFragmentManager().findFragmentByTag(mDialogTag);
        if (prev != null) {
            ft.remove(prev);
        }
        ft.addToBackStack(null);
        ft.commit();
    } catch (Exception e) {
        //?Activity??
        e.printStackTrace();
    }
}

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

/**
 * ??.//w  ww  .j  ava2  s . 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);
    FragmentManager fm = activity.getFragmentManager();
    android.app.FragmentTransaction ft = fm.beginTransaction();
    // 
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(fm, dialogTag);
    return newFragment;
}

From source file:com.pszh.ablibrary.util.AbDialogUtil.java

/**
 * ?string?.//from   www.  ja v a 2s .  co m
 * @param context
 * @param icon
 * @param title ?
 * @param message ???
 * @param onClickListener ?
 */
public static AbAlertDialogFragment showAlertDialog(Context context, int icon, String title, String message,
        AbAlertDialogFragment.AbDialogOnClickListener onClickListener) {
    FragmentActivity activity = (FragmentActivity) context;
    AbAlertDialogFragment newFragment = AbAlertDialogFragment.newInstance(icon, title, message, null,
            onClickListener);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    //    
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}