Search in sources :

Example 91 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project boilerplate by koush.

the class DrawerActivity method beginContentFragmentTransaction.

public FragmentTransaction beginContentFragmentTransaction(final Fragment content, final String breadcrumb) {
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    if (breadcrumb != null && null != getSupportFragmentManager().findFragmentById(R.id.main_content))
        ft.addToBackStack(breadcrumb);
    // ft.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);
    // ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    ft.replace(R.id.main_content, content);
    return ft;
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction)

Example 92 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project Conversations by siacs.

the class StartConversationActivity method showPublicChannelDialog.

private void showPublicChannelDialog() {
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    Fragment prev = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
    if (prev != null) {
        ft.remove(prev);
    }
    ft.addToBackStack(null);
    CreatePublicChannelDialog dialog = CreatePublicChannelDialog.newInstance(mActivatedAccounts);
    dialog.show(ft, FRAGMENT_TAG_DIALOG);
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) Fragment(androidx.fragment.app.Fragment) SwipeRefreshListFragment(eu.siacs.conversations.ui.widget.SwipeRefreshListFragment)

Example 93 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project Conversations by siacs.

the class StartConversationActivity method showCreateContactDialog.

@SuppressLint("InflateParams")
protected void showCreateContactDialog(final String prefilledJid, final Invite invite) {
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    Fragment prev = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
    if (prev != null) {
        ft.remove(prev);
    }
    ft.addToBackStack(null);
    EnterJidDialog dialog = EnterJidDialog.newInstance(mActivatedAccounts, getString(R.string.add_contact), getString(R.string.add), prefilledJid, invite == null ? null : invite.account, invite == null || !invite.hasFingerprints(), true);
    dialog.setOnEnterJidDialogPositiveListener((accountJid, contactJid) -> {
        if (!xmppConnectionServiceBound) {
            return false;
        }
        final Account account = xmppConnectionService.findAccountByJid(accountJid);
        if (account == null) {
            return true;
        }
        final Contact contact = account.getRoster().getContact(contactJid);
        if (invite != null && invite.getName() != null) {
            contact.setServerName(invite.getName());
        }
        if (contact.isSelf()) {
            switchToConversation(contact);
            return true;
        } else if (contact.showInRoster()) {
            throw new EnterJidDialog.JidError(getString(R.string.contact_already_exists));
        } else {
            final String preAuth = invite == null ? null : invite.getParameter(XmppUri.PARAMETER_PRE_AUTH);
            xmppConnectionService.createContact(contact, true, preAuth);
            if (invite != null && invite.hasFingerprints()) {
                xmppConnectionService.verifyFingerprints(contact, invite.getFingerprints());
            }
            switchToConversationDoNotAppend(contact, invite == null ? null : invite.getBody());
            return true;
        }
    });
    dialog.show(ft, FRAGMENT_TAG_DIALOG);
}
Also used : Account(eu.siacs.conversations.entities.Account) FragmentTransaction(androidx.fragment.app.FragmentTransaction) Fragment(androidx.fragment.app.Fragment) SwipeRefreshListFragment(eu.siacs.conversations.ui.widget.SwipeRefreshListFragment) Contact(eu.siacs.conversations.entities.Contact) SuppressLint(android.annotation.SuppressLint)

Example 94 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project Conversations by siacs.

the class StartConversationActivity method showCreatePrivateGroupChatDialog.

private void showCreatePrivateGroupChatDialog() {
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    Fragment prev = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
    if (prev != null) {
        ft.remove(prev);
    }
    ft.addToBackStack(null);
    CreatePrivateGroupChatDialog createConferenceFragment = CreatePrivateGroupChatDialog.newInstance(mActivatedAccounts);
    createConferenceFragment.show(ft, FRAGMENT_TAG_DIALOG);
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) Fragment(androidx.fragment.app.Fragment) SwipeRefreshListFragment(eu.siacs.conversations.ui.widget.SwipeRefreshListFragment)

Example 95 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project Conversations by siacs.

the class StartConversationActivity method showJoinConferenceDialog.

@SuppressLint("InflateParams")
protected void showJoinConferenceDialog(final String prefilledJid) {
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    Fragment prev = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
    if (prev != null) {
        ft.remove(prev);
    }
    ft.addToBackStack(null);
    JoinConferenceDialog joinConferenceFragment = JoinConferenceDialog.newInstance(prefilledJid, mActivatedAccounts);
    joinConferenceFragment.show(ft, FRAGMENT_TAG_DIALOG);
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) Fragment(androidx.fragment.app.Fragment) SwipeRefreshListFragment(eu.siacs.conversations.ui.widget.SwipeRefreshListFragment) SuppressLint(android.annotation.SuppressLint)

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