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();
}
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();
}
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();
}
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);
}
}
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;
}
Aggregations