Search in sources :

Example 71 with FragmentManager

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

the class SavedAccessPointsWifiSettings2Test method onCreate_shouldNewSavedNetworkTracker.

@Test
public void onCreate_shouldNewSavedNetworkTracker() {
    mSettings = new TestFragment();
    final FragmentManager fragmentManager = mActivity.getSupportFragmentManager();
    final FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.add(mSettings, null);
    fragmentTransaction.commit();
    final Bundle bundle = new Bundle();
    mSettings.onCreate(bundle);
    assertThat(mSettings.mSavedNetworkTracker).isNotNull();
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentTransaction(androidx.fragment.app.FragmentTransaction) Bundle(android.os.Bundle) Test(org.junit.Test)

Example 72 with FragmentManager

use of androidx.fragment.app.FragmentManager 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 73 with FragmentManager

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

the class ClearAdbKeysWarningDialog method show.

public static void show(Fragment host) {
    final FragmentManager manager = host.getActivity().getSupportFragmentManager();
    if (manager.findFragmentByTag(TAG) == null) {
        final ClearAdbKeysWarningDialog dialog = new ClearAdbKeysWarningDialog();
        dialog.setTargetFragment(host, 0);
        dialog.show(manager, TAG);
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager)

Example 74 with FragmentManager

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

the class DisableLogPersistWarningDialog method show.

public static void show(LogPersistDialogHost host) {
    if (!(host instanceof Fragment)) {
        return;
    }
    final Fragment hostFragment = (Fragment) host;
    final FragmentManager manager = hostFragment.getActivity().getSupportFragmentManager();
    if (manager.findFragmentByTag(TAG) == null) {
        final DisableLogPersistWarningDialog dialog = new DisableLogPersistWarningDialog();
        dialog.setTargetFragment(hostFragment, 0);
        dialog.show(manager, TAG);
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) Fragment(androidx.fragment.app.Fragment) InstrumentedDialogFragment(com.android.settings.core.instrumentation.InstrumentedDialogFragment)

Example 75 with FragmentManager

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

the class EnableOemUnlockSettingWarningDialog method show.

public static void show(Fragment host) {
    final FragmentManager manager = host.getActivity().getSupportFragmentManager();
    if (manager.findFragmentByTag(TAG) == null) {
        final EnableOemUnlockSettingWarningDialog dialog = new EnableOemUnlockSettingWarningDialog();
        dialog.setTargetFragment(host, 0);
        dialog.show(manager, TAG);
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager)

Aggregations

FragmentManager (androidx.fragment.app.FragmentManager)163 FragmentTransaction (androidx.fragment.app.FragmentTransaction)55 Fragment (androidx.fragment.app.Fragment)42 Bundle (android.os.Bundle)28 Test (org.junit.Test)15 Intent (android.content.Intent)13 FragmentActivity (androidx.fragment.app.FragmentActivity)10 Activity (android.app.Activity)6 View (android.view.View)6 DialogFragment (androidx.fragment.app.DialogFragment)6 TaskRetainerFragment (com.owncloud.android.ui.fragment.TaskRetainerFragment)5 Context (android.content.Context)4 DialogInterface (android.content.DialogInterface)3 LayoutInflater (android.view.LayoutInflater)3 MenuInflater (android.view.MenuInflater)3 Window (android.view.Window)3 TextView (android.widget.TextView)3 AlertDialog (androidx.appcompat.app.AlertDialog)3 AppCompatActivity (androidx.appcompat.app.AppCompatActivity)3 ViewModelProvider (androidx.lifecycle.ViewModelProvider)3