Search in sources :

Example 36 with FragmentTransaction

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

the class PickFragment method show.

public static void show(FragmentManager fm) {
    // Fragment can be restored by FragmentManager automatically.
    if (get(fm) != null) {
        return;
    }
    final PickFragment fragment = new PickFragment();
    final FragmentTransaction ft = fm.beginTransaction();
    ft.replace(R.id.container_save, fragment, TAG);
    ft.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.app.FragmentTransaction)

Example 37 with FragmentTransaction

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

the class RecentsCreateFragment method show.

public static void show(FragmentManager fm) {
    final RecentsCreateFragment fragment = new RecentsCreateFragment();
    final FragmentTransaction ft = fm.beginTransaction();
    ft.replace(R.id.container_directory, fragment);
    ft.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.app.FragmentTransaction)

Example 38 with FragmentTransaction

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

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 39 with FragmentTransaction

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

the class BiDiTestActivity method onListItemClick.

private void onListItemClick(ListView lv, View v, int position, long id) {
    // Show the test
    Map<String, Object> map = (Map<String, Object>) lv.getItemAtPosition(position);
    int fragmentId = (Integer) map.get(KEY_FRAGMENT_ID);
    Fragment fragment = getFragmentManager().findFragmentById(fragmentId);
    if (fragment == null) {
        try {
            // Create an instance of the test
            Class<? extends Fragment> clazz = (Class<? extends Fragment>) map.get(KEY_CLASS);
            fragment = clazz.newInstance();
            // Replace the old test fragment with the new one
            FragmentTransaction ft = getFragmentManager().beginTransaction();
            ft.replace(R.id.testframe, fragment);
            ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
            ft.commit();
        } catch (InstantiationException e) {
        } catch (IllegalAccessException e) {
        }
    }
}
Also used : FragmentTransaction(android.app.FragmentTransaction) HashMap(java.util.HashMap) Map(java.util.Map) Fragment(android.app.Fragment)

Example 40 with FragmentTransaction

use of android.app.FragmentTransaction in project Etar-Calendar by Etar-Group.

the class SelectVisibleCalendarsActivity method onCreate.

@Override
protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    dynamicTheme.onCreate(this);
    setContentView(R.layout.simple_frame_layout);
    mController = CalendarController.getInstance(this);
    mFragment = (SelectVisibleCalendarsFragment) getFragmentManager().findFragmentById(R.id.main_frame);
    if (mFragment == null) {
        mFragment = new SelectVisibleCalendarsFragment(R.layout.calendar_sync_item);
        FragmentTransaction ft = getFragmentManager().beginTransaction();
        ft.replace(R.id.main_frame, mFragment);
        ft.show(mFragment);
        ft.commit();
    }
}
Also used : FragmentTransaction(android.app.FragmentTransaction)

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