Search in sources :

Example 56 with FragmentTransaction

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

the class ConflictsResolveActivity method startDialog.

private void startDialog() {
    Optional<User> userOptional = getUser();
    if (!userOptional.isPresent()) {
        Log_OC.e(TAG, "User not present");
        showErrorAndFinish();
    }
    // Check whether the file is contained in the current Account
    Fragment prev = getSupportFragmentManager().findFragmentByTag("conflictDialog");
    FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
    if (prev != null) {
        fragmentTransaction.remove(prev);
    }
    if (existingFile != null && getStorageManager().fileExists(newFile.getRemotePath())) {
        ConflictsResolveDialog dialog = ConflictsResolveDialog.newInstance(existingFile, newFile, userOptional.get());
        dialog.show(fragmentTransaction, "conflictDialog");
    } else {
        // Account was changed to a different one - just finish
        Log_OC.e(TAG, "Account was changed, finishing");
        showErrorAndFinish();
    }
}
Also used : User(com.nextcloud.client.account.User) FragmentTransaction(androidx.fragment.app.FragmentTransaction) Fragment(androidx.fragment.app.Fragment) ConflictsResolveDialog(com.owncloud.android.ui.dialog.ConflictsResolveDialog)

Example 57 with FragmentTransaction

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

the class ContactsPreferenceActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.contacts_preference);
    // setup toolbar
    setupToolbar();
    // setup drawer
    // setupDrawer(R.id.nav_contacts); // TODO needed?
    // show sidebar?
    boolean showSidebar = getIntent().getBooleanExtra(EXTRA_SHOW_SIDEBAR, true);
    if (!showSidebar) {
        setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
        if (getSupportActionBar() != null) {
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        }
        if (mDrawerToggle != null) {
            mDrawerToggle.setDrawerIndicatorEnabled(false);
        }
    }
    Intent intent = getIntent();
    if (savedInstanceState == null) {
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        if (intent == null || intent.getParcelableExtra(EXTRA_FILE) == null || intent.getParcelableExtra(EXTRA_USER) == null) {
            BackupFragment fragment = BackupFragment.create(showSidebar);
            transaction.add(R.id.frame_container, fragment);
        } else {
            OCFile file = intent.getParcelableExtra(EXTRA_FILE);
            User user = intent.getParcelableExtra(EXTRA_USER);
            BackupListFragment contactListFragment = BackupListFragment.newInstance(file, user);
            transaction.add(R.id.frame_container, contactListFragment);
        }
        transaction.commit();
    }
}
Also used : OCFile(com.owncloud.android.datamodel.OCFile) FragmentTransaction(androidx.fragment.app.FragmentTransaction) User(com.nextcloud.client.account.User) BackupFragment(com.owncloud.android.ui.fragment.contactsbackup.BackupFragment) Intent(android.content.Intent) BackupListFragment(com.owncloud.android.ui.fragment.contactsbackup.BackupListFragment)

Example 58 with FragmentTransaction

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

the class AuthenticatorActivity method showUntrustedCertDialog.

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

Example 59 with FragmentTransaction

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

the class DisplayUtils method openSortingOrderDialogFragment.

public static void openSortingOrderDialogFragment(FragmentManager supportFragmentManager, FileSortOrder sortOrder) {
    FragmentTransaction fragmentTransaction = supportFragmentManager.beginTransaction();
    fragmentTransaction.addToBackStack(null);
    SortingOrderDialogFragment.newInstance(sortOrder).show(fragmentTransaction, SORTING_ORDER_FRAGMENT);
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction)

Example 60 with FragmentTransaction

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

the class FileOperationsHelper method sendFiles.

public void sendFiles(Set<OCFile> files) {
    // Show dialog
    FragmentManager fm = fileActivity.getSupportFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    ft.addToBackStack(null);
    SendFilesDialog sendFilesDialog = SendFilesDialog.newInstance(files);
    sendFilesDialog.show(ft, "TAG_SEND_SHARE_DIALOG");
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentTransaction(androidx.fragment.app.FragmentTransaction) SendFilesDialog(com.owncloud.android.ui.dialog.SendFilesDialog)

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