Search in sources :

Example 51 with FragmentTransaction

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

the class FileDisplayActivity method createMinFragments.

private void createMinFragments(Bundle savedInstanceState) {
    if (savedInstanceState == null) {
        OCFileListFragment listOfFiles = new OCFileListFragment();
        Bundle args = new Bundle();
        args.putBoolean(OCFileListFragment.ARG_ALLOW_CONTEXTUAL_ACTIONS, true);
        listOfFiles.setArguments(args);
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        transaction.add(R.id.left_fragment_container, listOfFiles, TAG_LIST_OF_FILES);
        transaction.commit();
    } else {
        getSupportFragmentManager().findFragmentByTag(TAG_LIST_OF_FILES);
    }
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) Bundle(android.os.Bundle) OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment)

Example 52 with FragmentTransaction

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

the class FileDisplayActivity method setSecondFragment.

/**
 * Replaces the second fragment managed by the activity with the received as a parameter.
 * <p>
 * Assumes never will be more than two fragments managed at the same time.
 *
 * @param fragment New second Fragment to set.
 */
// in future no dual pane
@Deprecated
private void setSecondFragment(Fragment fragment) {
    if (searchView != null) {
        searchView.post(new Runnable() {

            @Override
            public void run() {
                searchView.setQuery(searchQuery, true);
            }
        });
    }
    setDrawerIndicatorEnabled(false);
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.replace(R.id.right_fragment_container, fragment, TAG_SECOND_FRAGMENT);
    transaction.commit();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction)

Example 53 with FragmentTransaction

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

the class FolderPickerActivity method createFragments.

protected void createFragments() {
    OCFileListFragment listOfFiles = new OCFileListFragment();
    Bundle args = new Bundle();
    args.putBoolean(OCFileListFragment.ARG_ONLY_FOLDERS_CLICKABLE, true);
    args.putBoolean(OCFileListFragment.ARG_HIDE_FAB, true);
    args.putBoolean(OCFileListFragment.ARG_HIDE_ITEM_OPTIONS, true);
    args.putBoolean(OCFileListFragment.ARG_SEARCH_ONLY_FOLDER, mSearchOnlyFolders);
    listOfFiles.setArguments(args);
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(R.id.fragment_container, listOfFiles, TAG_LIST_OF_FOLDERS);
    transaction.commit();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) Bundle(android.os.Bundle) OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment)

Example 54 with FragmentTransaction

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

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)

Example 55 with FragmentTransaction

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

the class FilePickerActivity method createFragments.

@Override
protected void createFragments() {
    OCFileListFragment listOfFiles = new OCFileListFragment();
    Bundle args = new Bundle();
    args.putBoolean(OCFileListFragment.ARG_ONLY_FOLDERS_CLICKABLE, true);
    args.putBoolean(OCFileListFragment.ARG_HIDE_FAB, true);
    args.putBoolean(OCFileListFragment.ARG_HIDE_ITEM_OPTIONS, true);
    args.putBoolean(OCFileListFragment.ARG_SEARCH_ONLY_FOLDER, false);
    args.putBoolean(OCFileListFragment.ARG_FILE_SELECTABLE, true);
    args.putString(OCFileListFragment.ARG_MIMETYPE, getIntent().getStringExtra(OCFileListFragment.ARG_MIMETYPE));
    listOfFiles.setArguments(args);
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(R.id.fragment_container, listOfFiles, TAG_LIST_OF_FOLDERS);
    transaction.commit();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) Bundle(android.os.Bundle) OCFileListFragment(com.owncloud.android.ui.fragment.OCFileListFragment)

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