Search in sources :

Example 71 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project android_packages_apps_Settings by omnirom.

the class WifiDppConfiguratorActivity method showChooseSavedWifiNetworkFragment.

private void showChooseSavedWifiNetworkFragment(boolean addToBackStack) {
    WifiDppChooseSavedWifiNetworkFragment fragment = (WifiDppChooseSavedWifiNetworkFragment) mFragmentManager.findFragmentByTag(WifiDppUtils.TAG_FRAGMENT_CHOOSE_SAVED_WIFI_NETWORK);
    if (fragment == null) {
        fragment = new WifiDppChooseSavedWifiNetworkFragment();
    } 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_CHOOSE_SAVED_WIFI_NETWORK);
    if (addToBackStack) {
        fragmentTransaction.addToBackStack(/* name */
        null);
    }
    fragmentTransaction.commit();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction)

Example 72 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project android_packages_apps_Settings by omnirom.

the class WifiDppConfiguratorActivity method showQrCodeScannerFragment.

private void showQrCodeScannerFragment() {
    WifiDppQrCodeScannerFragment fragment = (WifiDppQrCodeScannerFragment) mFragmentManager.findFragmentByTag(WifiDppUtils.TAG_FRAGMENT_QR_CODE_SCANNER);
    if (fragment == null) {
        fragment = new WifiDppQrCodeScannerFragment();
    } 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_QR_CODE_SCANNER);
    fragmentTransaction.commit();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction)

Example 73 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project android_packages_apps_Settings by omnirom.

the class WifiDppChooseSavedWifiNetworkFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    // Embedded WifiNetworkListFragment as child fragment within
    // WifiDppChooseSavedWifiNetworkFragment.
    final FragmentManager fragmentManager = getChildFragmentManager();
    final WifiNetworkListFragment fragment = new WifiNetworkListFragment();
    final Bundle args = getArguments();
    if (args != null) {
        fragment.setArguments(args);
    }
    final FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.replace(R.id.wifi_network_list_container, fragment, TAG_FRAGMENT_WIFI_NETWORK_LIST);
    fragmentTransaction.commit();
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentTransaction(androidx.fragment.app.FragmentTransaction) Bundle(android.os.Bundle)

Example 74 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project android_packages_apps_Settings by omnirom.

the class WifiDppEnrolleeActivity method showQrCodeScannerFragment.

private void showQrCodeScannerFragment(String ssid) {
    WifiDppQrCodeScannerFragment fragment = (WifiDppQrCodeScannerFragment) mFragmentManager.findFragmentByTag(WifiDppUtils.TAG_FRAGMENT_QR_CODE_SCANNER);
    if (fragment == null) {
        fragment = new WifiDppQrCodeScannerFragment(ssid);
    } 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_QR_CODE_SCANNER);
    fragmentTransaction.commit();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction)

Example 75 with FragmentTransaction

use of androidx.fragment.app.FragmentTransaction in project android_packages_apps_Settings by omnirom.

the class AutomaticStorageManagementSwitchPreferenceControllerTest method togglingOffShouldTriggerWarningFragment.

@Test
public void togglingOffShouldTriggerWarningFragment() {
    final FragmentTransaction transaction = mock(FragmentTransaction.class);
    when(mFragmentManager.beginTransaction()).thenReturn(transaction);
    mController.onSwitchToggled(false);
    verify(transaction, never()).add(any(), eq(ActivationWarningFragment.TAG));
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) Test(org.junit.Test)

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