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();
}
}
use of android.app.FragmentTransaction in project android_frameworks_base by DirtyUnicorns.
the class OperationDialogFragment method show.
public static void show(FragmentManager fm, @DialogType int dialogType, ArrayList<DocumentInfo> failedSrcList, DocumentStack dstStack, @OpType int operationType) {
final Bundle args = new Bundle();
args.putInt(FileOperationService.EXTRA_DIALOG_TYPE, dialogType);
args.putInt(FileOperationService.EXTRA_OPERATION, operationType);
args.putParcelableArrayList(FileOperationService.EXTRA_SRC_LIST, failedSrcList);
final FragmentTransaction ft = fm.beginTransaction();
final OperationDialogFragment fragment = new OperationDialogFragment();
fragment.setArguments(args);
ft.add(fragment, TAG);
ft.commitAllowingStateLoss();
}
use of android.app.FragmentTransaction in project android_frameworks_base by ParanoidAndroid.
the class ActionBarImpl method selectTab.
@Override
public void selectTab(Tab tab) {
if (getNavigationMode() != NAVIGATION_MODE_TABS) {
mSavedTabPosition = tab != null ? tab.getPosition() : INVALID_POSITION;
return;
}
final FragmentTransaction trans = mActivity.getFragmentManager().beginTransaction().disallowAddToBackStack();
if (mSelectedTab == tab) {
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabReselected(mSelectedTab, trans);
mTabScrollView.animateToTab(tab.getPosition());
}
} else {
mTabScrollView.setTabSelected(tab != null ? tab.getPosition() : Tab.INVALID_POSITION);
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabUnselected(mSelectedTab, trans);
}
mSelectedTab = (TabImpl) tab;
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabSelected(mSelectedTab, trans);
}
}
if (!trans.isEmpty()) {
trans.commit();
}
}
use of android.app.FragmentTransaction in project android_frameworks_base by AOSPA.
the class PreferenceActivity 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(com.android.internal.R.id.prefs, 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 android_frameworks_base by AOSPA.
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();
}
Aggregations