Search in sources :

Example 31 with FragmentTransaction

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

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

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

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

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

the class SettingsActivity method startPreferenceFragment.

/**
     * Start a new fragment.
     *
     * @param fragment The fragment to start
     * @param push If true, the current fragment will be pushed onto the back stack.  If false,
     * the current fragment will be replaced.
     */
public void startPreferenceFragment(Fragment fragment, boolean push) {
    FragmentTransaction transaction = getFragmentManager().beginTransaction();
    transaction.replace(R.id.main_content, fragment);
    if (push) {
        transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
        transaction.addToBackStack(BACK_STACK_PREFS);
    } else {
        transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    }
    transaction.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.app.FragmentTransaction)

Example 34 with FragmentTransaction

use of android.app.FragmentTransaction in project cw-omnibus by commonsguy.

the class MainActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    ViewPager pager = (ViewPager) findViewById(R.id.pager);
    if (pager == null) {
        if (getFragmentManager().findFragmentById(R.id.editor1) == null) {
            SamplePagerAdapter adapter = buildAdapter();
            FragmentTransaction ft = getFragmentManager().beginTransaction();
            populateColumn(getFragmentManager(), ft, adapter, 0, R.id.editor1);
            populateColumn(getFragmentManager(), ft, adapter, 1, R.id.editor2);
            populateColumn(getFragmentManager(), ft, adapter, 2, R.id.editor3);
            ft.commit();
        }
    } else {
        SamplePagerAdapter adapter = buildAdapter();
        pager.setAdapter(adapter);
    }
}
Also used : FragmentTransaction(android.app.FragmentTransaction) ViewPager(android.support.v4.view.ViewPager)

Example 35 with FragmentTransaction

use of android.app.FragmentTransaction in project superCleanMaster by joyoyao.

the class DialogUtil method showAlertDialog.

/**
	 * 显示一个一般的对话框(String内容).
	 * @param context
	 *
	 */
public static AlertDialogFragment showAlertDialog(Context context, String message) {
    FragmentActivity activity = (FragmentActivity) context;
    AlertDialogFragment newFragment = AlertDialogFragment.newInstance(0, null, message, null, null);
    FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
    // 指定一个系统转场动画   
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    newFragment.show(ft, mDialogTag);
    return newFragment;
}
Also used : FragmentActivity(android.support.v4.app.FragmentActivity) 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