Search in sources :

Example 21 with FragmentTransaction

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

the class ChatFragment method hideForwardPanel.

private void hideForwardPanel() {
    forwardIds.clear();
    setUpInputViewButtons();
    Activity activity = getActivity();
    if (activity != null && !activity.isFinishing()) {
        FragmentManager fragmentManager = getChildFragmentManager();
        FragmentTransaction fTrans = fragmentManager.beginTransaction();
        fTrans.remove(forwardPanel);
        fTrans.commit();
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentTransaction(androidx.fragment.app.FragmentTransaction) 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)

Example 22 with FragmentTransaction

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

the class MediaKeyboard method onCloseEmojiSearchInternal.

private void onCloseEmojiSearchInternal(boolean showAfterCommit) {
    if (keyboardState == State.NORMAL) {
        return;
    }
    keyboardState = State.NORMAL;
    Fragment emojiSearch = fragmentManager.findFragmentByTag(EMOJI_SEARCH);
    if (emojiSearch == null) {
        return;
    }
    FragmentTransaction transaction = fragmentManager.beginTransaction().remove(emojiSearch).show(keyboardPagerFragment).setCustomAnimations(R.anim.fade_in, R.anim.fade_out);
    if (showAfterCommit) {
        transaction.runOnCommit(() -> show(latestKeyboardHeight, false));
    }
    transaction.commitAllowingStateLoss();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) EmojiSearchFragment(org.thoughtcrime.securesms.keyboard.emoji.search.EmojiSearchFragment) Fragment(androidx.fragment.app.Fragment) KeyboardPagerFragment(org.thoughtcrime.securesms.keyboard.KeyboardPagerFragment)

Example 23 with FragmentTransaction

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

the class AvatarSelectionActivity method onGalleryClicked.

@Override
public void onGalleryClicked() {
    if (isGalleryFirst() && popToRoot()) {
        return;
    }
    MediaGalleryFragment fragment = new MediaGalleryFragment();
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, fragment);
    if (isCameraFirst()) {
        transaction.addToBackStack(null);
    }
    transaction.commit();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) MediaGalleryFragment(org.thoughtcrime.securesms.mediasend.v2.gallery.MediaGalleryFragment)

Example 24 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project mobile-center-sdk-android by Microsoft.

the class PropertyActivity method addProperty.

private void addProperty() {
    TypedPropertyFragment fragment = new TypedPropertyFragment();
    Bundle bundle = new Bundle();
    bundle.putBoolean(TypedPropertyFragment.STRING_TYPE_ONLY_KEY, isStringTypeOnly());
    fragment.setArguments(bundle);
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(R.id.list, fragment).commit();
    mProperties.add(fragment);
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) Bundle(android.os.Bundle) TypedPropertyFragment(com.microsoft.appcenter.sasquatch.fragments.TypedPropertyFragment)

Example 25 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class WifiDppConfiguratorActivity method showAddDeviceFragment.

private void showAddDeviceFragment(boolean addToBackStack) {
    WifiDppAddDeviceFragment fragment = (WifiDppAddDeviceFragment) mFragmentManager.findFragmentByTag(WifiDppUtils.TAG_FRAGMENT_ADD_DEVICE);
    if (fragment == null) {
        fragment = new WifiDppAddDeviceFragment();
    } else {
        if (fragment.isVisible()) {
            return;
        }
        // When the fragment in back stack but not on top of the stack, we can simply pop
        // stack because current fragment transactions are arranged in an order
        mFragmentManager.popBackStackImmediate();
        return;
    }
    final FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();
    fragmentTransaction.replace(R.id.fragment_container, fragment, WifiDppUtils.TAG_FRAGMENT_ADD_DEVICE);
    if (addToBackStack) {
        fragmentTransaction.addToBackStack(/* name */
        null);
    }
    fragmentTransaction.commit();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction)

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