Search in sources :

Example 16 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project Cangol-uiframe by Cangol.

the class TabDrawerNavigationFragmentActivityDelegate method setDrawer.

public void setDrawer(int gravity, BaseFragment fragment) {
    fragment.setUserVisibleHint(false);
    FragmentTransaction t = mActivity.getSupportFragmentManager().beginTransaction();
    t.replace(gravity == Gravity.LEFT ? R.id.left_view : R.id.right_view, fragment, "DrawerFragment_" + gravity);
    t.commitAllowingStateLoss();
    mActivity.getSupportFragmentManager().executePendingTransactions();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction)

Example 17 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project paper-onboarding-android by Ramotion.

the class FragmentsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fragments_activity_layout);
    fragmentManager = getSupportFragmentManager();
    final PaperOnboardingFragment onBoardingFragment = PaperOnboardingFragment.newInstance(getDataForOnboarding());
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.add(R.id.fragment_container, onBoardingFragment);
    fragmentTransaction.commit();
    onBoardingFragment.setOnRightOutListener(new PaperOnboardingOnRightOutListener() {

        @Override
        public void onRightOut() {
            FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
            Fragment bf = new BlankFragment();
            fragmentTransaction.replace(R.id.fragment_container, bf);
            fragmentTransaction.commit();
        }
    });
}
Also used : PaperOnboardingFragment(com.ramotion.paperonboarding.PaperOnboardingFragment) FragmentTransaction(androidx.fragment.app.FragmentTransaction) Fragment(androidx.fragment.app.Fragment) PaperOnboardingFragment(com.ramotion.paperonboarding.PaperOnboardingFragment) PaperOnboardingOnRightOutListener(com.ramotion.paperonboarding.listeners.PaperOnboardingOnRightOutListener)

Example 18 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project Signal-Android by WhisperSystems.

the class PaymentRecipientSelectionFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    toolbar = view.findViewById(R.id.payment_recipient_selection_fragment_toolbar);
    toolbar.setNavigationOnClickListener(v -> Navigation.findNavController(v).popBackStack());
    contactFilterView = view.findViewById(R.id.contact_filter_edit_text);
    Bundle arguments = new Bundle();
    arguments.putBoolean(ContactSelectionListFragment.REFRESHABLE, false);
    arguments.putInt(ContactSelectionListFragment.DISPLAY_MODE, DisplayMode.FLAG_PUSH | DisplayMode.FLAG_HIDE_NEW);
    arguments.putBoolean(ContactSelectionListFragment.CAN_SELECT_SELF, false);
    Fragment child = getChildFragmentManager().findFragmentById(R.id.contact_selection_list_fragment_holder);
    if (child == null) {
        FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
        contactsFragment = new ContactSelectionListFragment();
        contactsFragment.setArguments(arguments);
        transaction.add(R.id.contact_selection_list_fragment_holder, contactsFragment);
        transaction.commit();
    } else {
        contactsFragment = (ContactSelectionListFragment) child;
    }
    initializeSearch();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) Bundle(android.os.Bundle) ContactSelectionListFragment(org.thoughtcrime.securesms.ContactSelectionListFragment) Fragment(androidx.fragment.app.Fragment) LoggingFragment(org.thoughtcrime.securesms.LoggingFragment) ContactSelectionListFragment(org.thoughtcrime.securesms.ContactSelectionListFragment)

Example 19 with FragmentTransaction

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

the class ForwardedActivity method initFragment.

private void initFragment(AccountJid account, UserJid user) {
    if (fragment == null)
        fragment = ForwardedFragment.newInstance(account, user, messageId);
    FragmentTransaction fTrans = getSupportFragmentManager().beginTransaction();
    fTrans.replace(R.id.container, fragment);
    fTrans.commit();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction)

Example 20 with FragmentTransaction

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

the class ChatFragment method showForwardPanel.

private void showForwardPanel(List<String> forwardIds) {
    List<String> ids = new ArrayList<>(forwardIds);
    Activity activity = getActivity();
    if (activity != null && !activity.isFinishing()) {
        FragmentManager fragmentManager = getChildFragmentManager();
        forwardPanel = ForwardPanel.newInstance(ids);
        FragmentTransaction fTrans = fragmentManager.beginTransaction();
        fTrans.replace(R.id.secondBottomPanel, forwardPanel);
        fTrans.commit();
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentTransaction(androidx.fragment.app.FragmentTransaction) ArrayList(java.util.ArrayList) QuestionActivity(com.xabber.android.ui.activity.QuestionActivity) ChatActivity(com.xabber.android.ui.activity.ChatActivity) ContactEditActivity(com.xabber.android.ui.activity.ContactEditActivity) ContactActivity(com.xabber.android.ui.activity.ContactActivity) Activity(android.app.Activity)

Aggregations

FragmentTransaction (androidx.fragment.app.FragmentTransaction)176 Fragment (androidx.fragment.app.Fragment)57 FragmentManager (androidx.fragment.app.FragmentManager)53 Bundle (android.os.Bundle)25 Test (org.junit.Test)14 DialogFragment (androidx.fragment.app.DialogFragment)10 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