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();
}
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();
}
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();
}
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();
}
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));
}
Aggregations