Search in sources :

Example 41 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project YourAppIdea by Michenux.

the class ChangeLogHelper method showChangeLogFromVersion.

public void showChangeLogFromVersion(int resTitle, int resCloseLabel, int resChangeLog, int fromVersion, FragmentActivity fragmentActivity) {
    String changeLog = getHTMLChangelog(resChangeLog, fragmentActivity.getResources(), fromVersion, fragmentActivity);
    if (!TextUtils.isEmpty(changeLog)) {
        FragmentManager fm = fragmentActivity.getSupportFragmentManager();
        ChangeLogDialogFragment dialogFragment = ChangeLogDialogFragment.newInstance(resTitle, resCloseLabel, changeLog);
        dialogFragment.show(fm, null);
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager)

Example 42 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project JustAndroid by chinaltz.

the class AbDialogUtil method removeDialog.

/**
     * 移除Fragment.
     *
     * @param context the context
     */
public static void removeDialog(final Context context) {
    try {
        FragmentActivity activity = (FragmentActivity) context;
        FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
        // 指定一个系统转场动画
        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE);
        Fragment prev = activity.getFragmentManager().findFragmentByTag(dialogTag);
        if (prev != null) {
            ft.remove(prev);
        }
        //不能加入到back栈
        //ft.addToBackStack(null);
        ft.commit();
    } catch (Exception e) {
        //可能有Activity已经被销毁的异常
        e.printStackTrace();
    }
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) FragmentTransaction(android.app.FragmentTransaction) Fragment(android.app.Fragment) AbSampleDialogFragment(com.ningcui.mylibrary.viewLib.dialog.AbSampleDialogFragment) AbProgressDialogFragment(com.ningcui.mylibrary.viewLib.dialog.AbProgressDialogFragment) AbAlertDialogFragment(com.ningcui.mylibrary.viewLib.dialog.AbAlertDialogFragment) DialogFragment(android.app.DialogFragment) AbProgressHorizontalDialogFragment(com.ningcui.mylibrary.viewLib.dialog.AbProgressHorizontalDialogFragment)

Example 43 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project JustAndroid by chinaltz.

the class AbDialogUtil method showFullScreenDialog.

/**
     * 显示一个全屏对话框.
     *
     * @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, Gravity.CENTER);
    newFragment.setContentView(view);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 指定一个系统转场动画 
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, dialogTag);
    return newFragment;
}
Also used : AbSampleDialogFragment(com.ningcui.mylibrary.viewLib.dialog.AbSampleDialogFragment) FragmentActivity(android.support.v4.app.FragmentActivity) FragmentTransaction(android.app.FragmentTransaction)

Example 44 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project JustAndroid by chinaltz.

the class AbDialogUtil method showAlertDialog.

/**
     * 显示一个普通对话框.
     *
     * @param view 对话框View
     */
public static AbAlertDialogFragment showAlertDialog(View view) {
    FragmentActivity activity = (FragmentActivity) view.getContext();
    AbAlertDialogFragment alertDialogFragment = new AbAlertDialogFragment();
    alertDialogFragment.setContentView(view);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 指定一个系统转场动画
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    alertDialogFragment.show(ft, dialogTag);
    return alertDialogFragment;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) FragmentTransaction(android.app.FragmentTransaction) AbAlertDialogFragment(com.ningcui.mylibrary.viewLib.dialog.AbAlertDialogFragment)

Example 45 with FragmentActivity

use of android.support.v4.app.FragmentActivity in project simplefacebook by androidquery.

the class PQuery method forward.

public void forward(FragmentActivity act, int requestCode, int resultCode, Intent data) {
    if (data == null)
        return;
    String method = data.getStringExtra(FW_CB);
    AQUtility.debug("being forwarded!", method);
    if (method == null)
        return;
    int id = data.getIntExtra(FW_ID, -1);
    if (id != -1) {
        Fragment f = act.getSupportFragmentManager().findFragmentById(id);
        AQUtility.debug("fr", f);
        if (f != null) {
            AQUtility.invokeHandler(f, method, false, true, FW_SIG, requestCode, resultCode, data);
        }
    }
}
Also used : LayoutString(com.androidquery.simplefeed.ui.LayoutString) Fragment(android.support.v4.app.Fragment)

Aggregations

FragmentActivity (android.support.v4.app.FragmentActivity)84 FragmentTransaction (android.app.FragmentTransaction)16 FragmentManager (android.support.v4.app.FragmentManager)16 FragmentTransaction (android.support.v4.app.FragmentTransaction)16 Fragment (android.support.v4.app.Fragment)11 Intent (android.content.Intent)6 Bundle (android.os.Bundle)5 View (android.view.View)4 DialogFragment (android.support.v4.app.DialogFragment)3 MediaControllerCompat (android.support.v4.media.session.MediaControllerCompat)3 SearchView (android.widget.SearchView)3 TextView (android.widget.TextView)3 Fragment (android.app.Fragment)2 ActionBar (android.support.v7.app.ActionBar)2 AppCompatActivity (android.support.v7.app.AppCompatActivity)2 MediaRouteDialogFactory (android.support.v7.app.MediaRouteDialogFactory)2 RecyclerView (android.support.v7.widget.RecyclerView)2 InjectView (butterknife.InjectView)2 RequestManager (com.bumptech.glide.RequestManager)2 FacebookException (com.facebook.FacebookException)2