Search in sources :

Example 1 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project orgzly-android by orgzly.

the class DisplayManager method displaySavedSearches.

public static void displaySavedSearches(FragmentManager fragmentManager) {
    if (isFragmentDisplayed(fragmentManager, SavedSearchesFragment.getFRAGMENT_TAG()) != null) {
        return;
    }
    Fragment fragment = SavedSearchesFragment.getInstance();
    FragmentTransaction t = fragmentManager.beginTransaction().setCustomAnimations(R.anim.fragment_enter, R.anim.fragment_exit, R.anim.fragment_enter, R.anim.fragment_exit).addToBackStack(null).replace(R.id.single_pane_container, fragment, SavedSearchesFragment.getFRAGMENT_TAG());
    t.commit();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) SearchFragment(com.orgzly.android.ui.notes.query.search.SearchFragment) AgendaFragment(com.orgzly.android.ui.notes.query.agenda.AgendaFragment) SavedSearchesFragment(com.orgzly.android.ui.savedsearches.SavedSearchesFragment) SavedSearchFragment(com.orgzly.android.ui.savedsearch.SavedSearchFragment) Fragment(androidx.fragment.app.Fragment) BookPrefaceFragment(com.orgzly.android.ui.notes.book.BookPrefaceFragment) BooksFragment(com.orgzly.android.ui.books.BooksFragment) NoteFragment(com.orgzly.android.ui.note.NoteFragment) BookFragment(com.orgzly.android.ui.notes.book.BookFragment)

Example 2 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project k-9 by k9mail.

the class AccountSetupCheckSettings method showDialogFragment.

private void showDialogFragment(int dialogId, String customMessage) {
    if (mDestroyed) {
        return;
    }
    mProgressBar.setIndeterminate(false);
    DialogFragment fragment;
    if (dialogId == R.id.dialog_account_setup_error) {
        fragment = ConfirmationDialogFragment.newInstance(dialogId, getString(R.string.account_setup_failed_dlg_title), customMessage, getString(R.string.account_setup_failed_dlg_edit_details_action), getString(R.string.account_setup_failed_dlg_continue_action));
    } else {
        throw new RuntimeException("Called showDialog(int) with unknown dialog id.");
    }
    FragmentTransaction ta = getSupportFragmentManager().beginTransaction();
    ta.add(fragment, getDialogTag(dialogId));
    ta.commitAllowingStateLoss();
// TODO: commitAllowingStateLoss() is used to prevent https://code.google.com/p/android/issues/detail?id=23761
// but is a bad...
// fragment.show(ta, getDialogTag(dialogId));
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) ConfirmationDialogFragment(com.fsck.k9.fragment.ConfirmationDialogFragment) DialogFragment(androidx.fragment.app.DialogFragment)

Example 3 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project Timber by naman14.

the class NavigationUtils method navigateToArtist.

@TargetApi(21)
public static void navigateToArtist(Activity context, long artistID, Pair<View, String> transitionViews) {
    FragmentTransaction transaction = ((AppCompatActivity) context).getSupportFragmentManager().beginTransaction();
    Fragment fragment;
    transaction.setCustomAnimations(R.anim.activity_fade_in, R.anim.activity_fade_out, R.anim.activity_fade_in, R.anim.activity_fade_out);
    fragment = ArtistDetailFragment.newInstance(artistID, false, null);
    transaction.hide(((AppCompatActivity) context).getSupportFragmentManager().findFragmentById(R.id.fragment_container));
    transaction.add(R.id.fragment_container, fragment);
    transaction.addToBackStack(null).commit();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) AppCompatActivity(androidx.appcompat.app.AppCompatActivity) ArtistDetailFragment(com.naman14.timber.fragments.ArtistDetailFragment) Fragment(androidx.fragment.app.Fragment) AlbumDetailFragment(com.naman14.timber.fragments.AlbumDetailFragment) TargetApi(android.annotation.TargetApi)

Example 4 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project android by owncloud.

the class FolderPickerActivity method createFragments.

private void createFragments() {
    OCFileListFragment listOfFiles = OCFileListFragment.newInstance(true, FileListOption.ALL_FILES, true, true, false);
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(R.id.fragment_container, listOfFiles, TAG_LIST_OF_FOLDERS);
    transaction.commit();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment)

Example 5 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project android by owncloud.

the class FileActivity method showUntrustedCertDialog.

/**
 * Show untrusted cert dialog
 */
public void showUntrustedCertDialog(RemoteOperationResult result) {
    // Show a dialog with the certificate info
    FragmentManager fm = getSupportFragmentManager();
    SslUntrustedCertDialog dialog = (SslUntrustedCertDialog) fm.findFragmentByTag(DIALOG_UNTRUSTED_CERT);
    if (dialog == null) {
        dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException) result.getException());
        FragmentTransaction ft = fm.beginTransaction();
        dialog.show(ft, DIALOG_UNTRUSTED_CERT);
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentTransaction(androidx.fragment.app.FragmentTransaction) SslUntrustedCertDialog(com.owncloud.android.ui.dialog.SslUntrustedCertDialog) CertificateCombinedException(com.owncloud.android.lib.common.network.CertificateCombinedException)

Aggregations

FragmentTransaction (androidx.fragment.app.FragmentTransaction)168 Fragment (androidx.fragment.app.Fragment)54 FragmentManager (androidx.fragment.app.FragmentManager)47 Bundle (android.os.Bundle)25 Test (org.junit.Test)14 DialogFragment (androidx.fragment.app.DialogFragment)9 OCFileListFragment (com.owncloud.android.ui.fragment.OCFileListFragment)6 View (android.view.View)5 Intent (android.content.Intent)4 ActionBar (androidx.appcompat.app.ActionBar)4 Toolbar (androidx.appcompat.widget.Toolbar)4 SwipeRefreshListFragment (eu.siacs.conversations.ui.widget.SwipeRefreshListFragment)4 MediaGalleryFragment (org.thoughtcrime.securesms.mediasend.v2.gallery.MediaGalleryFragment)4 SuppressLint (android.annotation.SuppressLint)3 Activity (android.app.Activity)3 FragmentActivity (androidx.fragment.app.FragmentActivity)3 SslUntrustedCertDialog (com.owncloud.android.ui.dialog.SslUntrustedCertDialog)3 TargetApi (android.annotation.TargetApi)2 PreferenceFrameLayout (android.preference.PreferenceFrameLayout)2 VisibleForTesting (androidx.annotation.VisibleForTesting)2