Example usage for android.app FragmentTransaction setCustomAnimations

List of usage examples for android.app FragmentTransaction setCustomAnimations

Introduction

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

Prototype

public abstract FragmentTransaction setCustomAnimations(@AnimatorRes int enter, @AnimatorRes int exit,
        @AnimatorRes int popEnter, @AnimatorRes int popExit);

Source Link

Document

Set specific animation resources to run for the fragments that are entering and exiting in this transaction.

Usage

From source file:io.digibyte.tools.animation.BRAnimator.java

public static void showMenuFragment(Activity app) {
    if (app == null) {
        Log.e(TAG, "showReceiveFragment: app is null");
        return;//from   w w  w  . j  a  v a  2  s  .  c o  m
    }
    FragmentTransaction transaction = app.getFragmentManager().beginTransaction();
    transaction.setCustomAnimations(0, 0, 0, R.animator.plain_300);
    transaction.add(android.R.id.content, new FragmentMenu(), FragmentMenu.class.getName());
    transaction.addToBackStack(FragmentMenu.class.getName());
    transaction.commit();

}

From source file:io.digibyte.tools.animation.BRAnimator.java

public static void showGreetingsMessage(Activity app) {
    if (app == null) {
        Log.e(TAG, "showGreetingsMessage: app is null");
        return;/*from   w  w w  . ja v a 2s . c om*/
    }
    FragmentTransaction transaction = app.getFragmentManager().beginTransaction();
    transaction.setCustomAnimations(0, 0, 0, R.animator.plain_300);
    transaction.add(android.R.id.content, new FragmentGreetings(), FragmentGreetings.class.getName());
    transaction.addToBackStack(FragmentGreetings.class.getName());
    transaction.commit();

}

From source file:io.digibyte.tools.animation.BRAnimator.java

public static void showBreadSignal(Activity activity, String title, String iconDescription, int drawableId,
        BROnSignalCompletion completion) {
    fragmentSignal = new FragmentSignal();
    Bundle bundle = new Bundle();
    bundle.putString(FragmentSignal.TITLE, title);
    bundle.putString(FragmentSignal.ICON_DESCRIPTION, iconDescription);
    fragmentSignal.setCompletion(completion);
    bundle.putInt(FragmentSignal.RES_ID, drawableId);
    fragmentSignal.setArguments(bundle);
    FragmentTransaction transaction = activity.getFragmentManager().beginTransaction();
    transaction.setCustomAnimations(R.animator.from_bottom, R.animator.to_bottom, R.animator.from_bottom,
            R.animator.to_bottom);/*from   w w w .  ja va  2s  .co  m*/
    transaction.add(android.R.id.content, fragmentSignal, fragmentSignal.getClass().getName());
    transaction.addToBackStack(null);
    if (!activity.isDestroyed())
        transaction.commit();
}

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

/**
 * //w w  w  . ja  v a 2s . c o m
 * ???.
 * @param view
 * @param animEnter
 * @param animExit
 * @param animPopEnter
 * @param animPopExit
 * @param gravity
 * @param onCancelListener
 * @return
 */
public static AbSampleDialogFragment showDialog(View view, int animEnter, int animExit, int animPopEnter,
        int animPopExit, int gravity, int style, DialogInterface.OnCancelListener onCancelListener) {
    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.setCustomAnimations(animEnter, animExit, animPopEnter, animPopExit);
    newFragment.setOnCancelListener(onCancelListener);
    newFragment.show(ft, dialogTag);
    return newFragment;
}

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

/**
 * // www  . j  a va2 s.  c  om
 * ???.
 * @param view
 * @param animEnter
 * @param animExit
 * @param animPopEnter
 * @param animPopExit
 * @param gravity ?
 * @return
 */
public static AbSampleDialogFragment showDialog(View view, int animEnter, int animExit, int animPopEnter,
        int animPopExit, 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.setCustomAnimations(animEnter, animExit, animPopEnter, animPopExit);
    newFragment.show(ft, dialogTag);
    return newFragment;
}

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

/**
 * /*from   w w  w  .ja  v a  2 s. c o  m*/
 * ???.
 * @param view
 * @param animEnter
 * @param animExit
 * @param animPopEnter
 * @param animPopExit
 * @param gravity
 * @param onCancelListener
 * @return
 */
public static ESSampleDialogFragment showDialog(View view, int animEnter, int animExit, int animPopEnter,
        int animPopExit, int gravity, int style, DialogInterface.OnCancelListener onCancelListener) {
    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.setCustomAnimations(animEnter, animExit, animPopEnter, animPopExit);
    newFragment.setOnCancelListener(onCancelListener);
    newFragment.show(ft, dialogTag);
    return newFragment;
}

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

/**
 * //from   w ww  .  j a  v  a 2 s. c om
 * ???.
 * @param view
 * @param animEnter
 * @param animExit
 * @param animPopEnter
 * @param animPopExit
 * @param gravity ?
 * @return
 */
public static ESSampleDialogFragment showDialog(View view, int animEnter, int animExit, int animPopEnter,
        int animPopExit, 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.setCustomAnimations(animEnter, animExit, animPopEnter, animPopExit);
    newFragment.show(ft, dialogTag);
    return newFragment;
}

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

/**
 * //  www  .  j a va 2  s  . c om
 * ???().
 * @param view
 * @param animEnter
 * @param animExit
 * @param animPopEnter
 * @param animPopExit
 * @param gravity ?
 * @return
 */
public static AbSampleDialogFragment showDialog(View view, int animEnter, int animExit, int animPopEnter,
        int animPopExit, 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.setCustomAnimations(animEnter, animExit, animPopEnter, animPopExit);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

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

/**
 * //from   www .  jav a2 s  . co m
 * ???().
 * @param view
 * @param animEnter
 * @param animExit
 * @param animPopEnter
 * @param animPopExit
 * @param gravity ?
 * @return
 */
public static AbSampleDialogFragment showDialog(View view, int animEnter, int animExit, int animPopEnter,
        int animPopExit, 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.setCustomAnimations(animEnter, animExit, animPopEnter, animPopExit);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}

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

/**
 * //from  w  w w .  ja v  a2s  .c  o  m
 * ???.
 * 
 * @param view
 * @param animEnter
 * @param animExit
 * @param animPopEnter
 * @param animPopExit
 * @param gravity
 *            ?
 * @return
 */
public static AbSampleDialogFragment showDialog(View view, int animEnter, int animExit, int animPopEnter,
        int animPopExit, 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.setCustomAnimations(animEnter, animExit, animPopEnter, animPopExit);
    newFragment.show(ft, dialogTag);
    return newFragment;
}