use of androidx.fragment.app.FragmentTransaction in project IITB-App by wncc.
the class Utils method updateFragment.
/**
* Update the open fragment
*/
public static final void updateFragment(Fragment fragment, FragmentActivity fragmentActivity) {
FragmentTransaction ft = fragmentActivity.getSupportFragmentManager().beginTransaction();
ft.setCustomAnimations(R.anim.slide_in_up, R.anim.fade_out, R.anim.fade_in, R.anim.slide_out_down);
ft.replace(R.id.framelayout_for_fragment, fragment, getTag(fragment));
ft.addToBackStack(getTag(fragment));
ft.commit();
}
use of androidx.fragment.app.FragmentTransaction in project ARCamera by escnqh.
the class MainActivity method changeFragment.
private void changeFragment(int position) {
FragmentTransaction transaction = fragmentManager.beginTransaction();
hideFragment(transaction);
switch(position) {
case 0:
toolbarchange = 0;
onPrepareOptionsMenu(mainMenu);
if (mainpageFragment == null) {
mainpageFragment = MainpageFragment.newInstance("");
transaction.add(R.id.frame_fragment, mainpageFragment);
} else {
transaction.show(mainpageFragment);
}
break;
case 1:
toolbarchange = 1;
onPrepareOptionsMenu(mainMenu);
if (workspageFragment == null) {
workspageFragment = WorkspageFragment.newInstance("");
transaction.add(R.id.frame_fragment, workspageFragment);
} else {
transaction.show(workspageFragment);
}
break;
case 2:
toolbarchange = 2;
onPrepareOptionsMenu(mainMenu);
if (userpageFragment == null) {
userpageFragment = UserpageFragment.newInstance("");
transaction.add(R.id.frame_fragment, userpageFragment);
} else {
transaction.show(userpageFragment);
}
break;
default:
break;
}
transaction.commit();
}
use of androidx.fragment.app.FragmentTransaction in project zype-android by zype.
the class VideoCastControllerActivity method showTracksChooserDialog.
private void showTracksChooserDialog() throws TransientNetworkDisconnectionException, NoConnectionException {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag(DIALOG_TAG);
if (prev != null) {
transaction.remove(prev);
}
transaction.addToBackStack(null);
// Create and show the dialog.
TracksChooserDialog dialogFragment = TracksChooserDialog.newInstance(mCastManager.getRemoteMediaInformation());
dialogFragment.show(transaction, DIALOG_TAG);
}
use of androidx.fragment.app.FragmentTransaction in project PocketHub by pockethub.
the class FragmentPagerAdapter method clearAdapter.
/**
* This methods clears any fragments that may not apply to the newly
* selected org.
*
* @return this adapter
*/
public FragmentPagerAdapter clearAdapter() {
if (tags.isEmpty()) {
return this;
}
FragmentTransaction transaction = fragmentManager.beginTransaction();
for (String tag : tags) {
Fragment fragment = fragmentManager.findFragmentByTag(tag);
if (fragment != null) {
transaction.remove(fragment);
}
}
transaction.commit();
tags.clear();
return this;
}
use of androidx.fragment.app.FragmentTransaction in project android by nextcloud.
the class SyncedFoldersActivity method onSyncFolderSettingsClick.
@Override
public void onSyncFolderSettingsClick(int section, SyncedFolderDisplayItem syncedFolderDisplayItem) {
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.addToBackStack(null);
syncedFolderPreferencesDialogFragment = SyncedFolderPreferencesDialogFragment.newInstance(syncedFolderDisplayItem, section);
syncedFolderPreferencesDialogFragment.show(ft, SYNCED_FOLDER_PREFERENCES_DIALOG_TAG);
}
Aggregations