Search in sources :

Example 1 with AbProgressDialogFragment

use of com.ningcui.mylibrary.viewLib.dialog.AbProgressDialogFragment in project JustAndroid by chinaltz.

the class AbDialogUtil method showProgressDialog.

/**
     * 显示进度框.
     *
     * @param context               the context
     * @param indeterminateDrawable 用默认请写0
     * @param message               the message
     * @param isCancelable          是否可以取消
     */
public static AbProgressDialogFragment showProgressDialog(Context context, int indeterminateDrawable, String message, boolean isCancelable) {
    FragmentActivity activity = (FragmentActivity) context;
    AbProgressDialogFragment newFragment = AbProgressDialogFragment.newInstance(indeterminateDrawable, message, isCancelable);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 指定一个系统转场动画   
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, dialogTag);
    return newFragment;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) AbProgressDialogFragment(com.ningcui.mylibrary.viewLib.dialog.AbProgressDialogFragment) FragmentTransaction(android.app.FragmentTransaction)

Aggregations

FragmentTransaction (android.app.FragmentTransaction)1 FragmentActivity (android.support.v4.app.FragmentActivity)1 AbProgressDialogFragment (com.ningcui.mylibrary.viewLib.dialog.AbProgressDialogFragment)1