Search in sources :

Example 46 with FragmentTransaction

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();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction)

Example 47 with FragmentTransaction

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();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction)

Example 48 with FragmentTransaction

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);
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) TracksChooserDialog(com.google.android.libraries.cast.companionlibrary.cast.tracks.ui.TracksChooserDialog) Fragment(androidx.fragment.app.Fragment)

Example 49 with FragmentTransaction

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;
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) Fragment(androidx.fragment.app.Fragment)

Example 50 with FragmentTransaction

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);
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentTransaction(androidx.fragment.app.FragmentTransaction)

Aggregations

FragmentTransaction (androidx.fragment.app.FragmentTransaction)186 Fragment (androidx.fragment.app.Fragment)58 FragmentManager (androidx.fragment.app.FragmentManager)53 Bundle (android.os.Bundle)28 Test (org.junit.Test)14 DialogFragment (androidx.fragment.app.DialogFragment)10 OCFileListFragment (com.owncloud.android.ui.fragment.OCFileListFragment)6 Intent (android.content.Intent)5 View (android.view.View)5 ActionBar (androidx.appcompat.app.ActionBar)4 Toolbar (androidx.appcompat.widget.Toolbar)4 SwipeRefreshListFragment (eu.siacs.conversations.ui.widget.SwipeRefreshListFragment)4 File (java.io.File)4 MediaGalleryFragment (org.thoughtcrime.securesms.mediasend.v2.gallery.MediaGalleryFragment)4 SuppressLint (android.annotation.SuppressLint)3 Activity (android.app.Activity)3 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)3 ProcessViewerFragment (com.amaze.filemanager.ui.fragments.ProcessViewerFragment)3 SslUntrustedCertDialog (com.owncloud.android.ui.dialog.SslUntrustedCertDialog)3 TargetApi (android.annotation.TargetApi)2