Search in sources :

Example 21 with FragmentTransaction

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

the class ExpandedDesktop method removeFragment.

private void removeFragment() {
    FragmentManager fragmentManager = getChildFragmentManager();
    Fragment fragment = fragmentManager.findFragmentByTag(EXPANDED_DESKTOP_PREFERENCE_TAG);
    if (fragment != null) {
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        fragmentTransaction.remove(fragment).commit();
    }
}
Also used : FragmentManager(android.app.FragmentManager) FragmentTransaction(android.app.FragmentTransaction) SettingsPreferenceFragment(com.android.settings.SettingsPreferenceFragment) Fragment(android.app.Fragment)

Example 22 with FragmentTransaction

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

the class DirectoryFragment method create.

public static void create(FragmentManager fm, int type, RootInfo root, DocumentInfo doc, String query, int anim) {
    final Bundle args = new Bundle();
    args.putInt(Shared.EXTRA_TYPE, type);
    args.putParcelable(Shared.EXTRA_ROOT, root);
    args.putParcelable(Shared.EXTRA_DOC, doc);
    args.putString(Shared.EXTRA_QUERY, query);
    args.putParcelable(Shared.EXTRA_SELECTION, new Selection());
    final FragmentTransaction ft = fm.beginTransaction();
    AnimationView.setupAnimations(ft, anim, args);
    final DirectoryFragment fragment = new DirectoryFragment();
    fragment.setArguments(args);
    ft.replace(getFragmentId(), fragment);
    ft.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.app.FragmentTransaction) Bundle(android.os.Bundle) Selection(com.android.documentsui.dirlist.MultiSelectManager.Selection)

Example 23 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 24 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 25 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)

Aggregations

FragmentTransaction (android.app.FragmentTransaction)419 Fragment (android.app.Fragment)125 FragmentManager (android.app.FragmentManager)120 Bundle (android.os.Bundle)56 Test (org.junit.Test)36 FragmentActivity (android.support.v4.app.FragmentActivity)27 Intent (android.content.Intent)25 DialogFragment (android.app.DialogFragment)22 View (android.view.View)20 PreferenceFragment (android.support.v14.preference.PreferenceFragment)13 TextView (android.widget.TextView)12 MapCalibrationFragment (com.peterlaurence.trekadvisor.menu.mapcalibration.MapCalibrationFragment)8 MapImportFragment (com.peterlaurence.trekadvisor.menu.mapimport.MapImportFragment)8 MapListFragment (com.peterlaurence.trekadvisor.menu.maplist.MapListFragment)8 MapSettingsFragment (com.peterlaurence.trekadvisor.menu.maplist.MapSettingsFragment)8 MapViewFragment (com.peterlaurence.trekadvisor.menu.mapview.MapViewFragment)8 MarkerManageFragment (com.peterlaurence.trekadvisor.menu.mapview.components.markermanage.MarkerManageFragment)8 TracksManageFragment (com.peterlaurence.trekadvisor.menu.mapview.components.tracksmanage.TracksManageFragment)8 RecordFragment (com.peterlaurence.trekadvisor.menu.record.RecordFragment)8 Uri (android.net.Uri)7