Search in sources :

Example 66 with FragmentTransaction

use of android.app.FragmentTransaction in project android_frameworks_base by ResurrectionRemix.

the class RootsFragment method show.

public static void show(FragmentManager fm, Intent includeApps) {
    final Bundle args = new Bundle();
    args.putParcelable(EXTRA_INCLUDE_APPS, includeApps);
    final RootsFragment fragment = new RootsFragment();
    fragment.setArguments(args);
    final FragmentTransaction ft = fm.beginTransaction();
    ft.replace(R.id.container_roots, fragment);
    ft.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.app.FragmentTransaction) Bundle(android.os.Bundle)

Example 67 with FragmentTransaction

use of android.app.FragmentTransaction in project android_frameworks_base by ResurrectionRemix.

the class SaveFragment method show.

public static void show(FragmentManager fm, String mimeType, String displayName) {
    final Bundle args = new Bundle();
    args.putString(EXTRA_MIME_TYPE, mimeType);
    args.putString(EXTRA_DISPLAY_NAME, displayName);
    final SaveFragment fragment = new SaveFragment();
    fragment.setArguments(args);
    final FragmentTransaction ft = fm.beginTransaction();
    ft.replace(R.id.container_save, fragment, TAG);
    ft.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.app.FragmentTransaction) Bundle(android.os.Bundle)

Example 68 with FragmentTransaction

use of android.app.FragmentTransaction in project android_frameworks_base by ResurrectionRemix.

the class PrintActivity method showFragment.

private void showFragment(Fragment newFragment) {
    FragmentTransaction transaction = getFragmentManager().beginTransaction();
    Fragment oldFragment = getFragmentManager().findFragmentByTag(FRAGMENT_TAG);
    if (oldFragment != null) {
        transaction.remove(oldFragment);
    }
    if (newFragment != null) {
        transaction.add(R.id.embedded_content_container, newFragment, FRAGMENT_TAG);
    }
    transaction.commitAllowingStateLoss();
    getFragmentManager().executePendingTransactions();
}
Also used : FragmentTransaction(android.app.FragmentTransaction) DialogFragment(android.app.DialogFragment) Fragment(android.app.Fragment)

Example 69 with FragmentTransaction

use of android.app.FragmentTransaction in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ColorPickerPreference method showFragment.

private void showFragment(Bundle state) {
    SettingsActivity sa = null;
    if (getContext() instanceof ContextThemeWrapper) {
        if (((ContextThemeWrapper) getContext()).getBaseContext() instanceof SettingsActivity) {
            sa = (SettingsActivity) ((ContextThemeWrapper) getContext()).getBaseContext();
        }
    }
    if (sa == null) {
        return;
    }
    Bundle arguments;
    if (state != null) {
        arguments = new Bundle(state);
    } else {
        SharedPreferences prefs = sa.getSharedPreferences("color_picker_fragment", Activity.MODE_PRIVATE);
        boolean showHelpScreen = prefs.getBoolean("show_help_screen", true);
        arguments = new Bundle();
        arguments.putInt("new_color", mValue);
        arguments.putInt("old_color", mValue);
        arguments.putBoolean("help_screen_visible", showHelpScreen);
    }
    arguments.putInt("initial_color", mValue);
    arguments.putInt("reset_color_1", mResetColor1);
    arguments.putInt("reset_color_2", mResetColor2);
    arguments.putCharSequence("reset_color_1_title", mResetColor1Title);
    arguments.putCharSequence("reset_color_2_title", mResetColor2Title);
    arguments.putBoolean("alpha_slider_visible", mAlphaSliderVisible);
    mPickerFragment = new ColorPickerFragment();
    mPickerFragment.setArguments(arguments);
    mPickerFragment.setOnColorChangedListener(this);
    FragmentTransaction transaction = sa.getFragmentManager().beginTransaction();
    transaction.replace(R.id.main_content, mPickerFragment);
    transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    transaction.addToBackStack(":settings:prefs");
    transaction.setBreadCrumbTitle(R.string.color_picker_fragment_title);
    transaction.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.app.FragmentTransaction) ContextThemeWrapper(android.view.ContextThemeWrapper) SharedPreferences(android.content.SharedPreferences) Bundle(android.os.Bundle) ColorPickerFragment(net.margaritov.preference.colorpicker.fragment.ColorPickerFragment) SettingsActivity(com.android.settings.SettingsActivity)

Example 70 with FragmentTransaction

use of android.app.FragmentTransaction in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class BackgroundCheckSummary method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // initialize the inflater
    mInflater = inflater;
    View rootView = mInflater.inflate(R.layout.background_check_summary, container, false);
    // only when the view is added.
    if (container instanceof PreferenceFrameLayout) {
        ((PreferenceFrameLayout.LayoutParams) rootView.getLayoutParams()).removeBorders = true;
    }
    FragmentTransaction ft = getChildFragmentManager().beginTransaction();
    ft.add(R.id.appops_content, new AppOpsCategory(AppOpsState.RUN_IN_BACKGROUND_TEMPLATE, true), "appops");
    ft.commitAllowingStateLoss();
    return rootView;
}
Also used : FragmentTransaction(android.app.FragmentTransaction) PreferenceFrameLayout(android.preference.PreferenceFrameLayout) View(android.view.View)

Aggregations

FragmentTransaction (android.app.FragmentTransaction)266 FragmentManager (android.app.FragmentManager)84 Fragment (android.app.Fragment)82 Bundle (android.os.Bundle)44 DialogFragment (android.app.DialogFragment)20 Intent (android.content.Intent)18 FragmentActivity (android.support.v4.app.FragmentActivity)16 PreferenceFragment (android.support.v14.preference.PreferenceFragment)7 HashMap (java.util.HashMap)7 View (android.view.View)6 File (java.io.File)6 SuppressLint (android.annotation.SuppressLint)5 Uri (android.net.Uri)5 StorageManager (android.os.storage.StorageManager)5 VolumeInfo (android.os.storage.VolumeInfo)5 Fade (android.transition.Fade)5 TextView (android.widget.TextView)5 Selection (com.android.documentsui.dirlist.MultiSelectManager.Selection)5 IOException (java.io.IOException)5 Map (java.util.Map)4