use of androidx.fragment.app.FragmentTransaction in project android_packages_apps_Settings by omnirom.
the class BackgroundCheckSummary method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// initialize the inflater
mInflater = inflater;
View rootView = mInflater.inflate(R.layout.background_check_summary, container, false);
// only when the view is added.
if (container instanceof PreferenceFrameLayout) {
((PreferenceFrameLayout.LayoutParams) rootView.getLayoutParams()).removeBorders = true;
}
FragmentTransaction ft = getChildFragmentManager().beginTransaction();
ft.add(R.id.appops_content, new AppOpsCategory(AppOpsState.RUN_IN_BACKGROUND_TEMPLATE), "appops");
ft.commitAllowingStateLoss();
return rootView;
}
use of androidx.fragment.app.FragmentTransaction in project android_packages_apps_Settings by omnirom.
the class AdbQrCodeActivity method onCreate.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
AdbQrcodeScannerFragment fragment = (AdbQrcodeScannerFragment) mFragmentManager.findFragmentByTag(TAG_FRAGMENT_ADB_QR_CODE_SCANNER);
if (fragment == null) {
fragment = new AdbQrcodeScannerFragment();
} 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, TAG_FRAGMENT_ADB_QR_CODE_SCANNER);
fragmentTransaction.commit();
}
use of androidx.fragment.app.FragmentTransaction in project android_packages_apps_Settings by omnirom.
the class SettingsHomepageActivity method showFragment.
private void showFragment(Fragment fragment, int id) {
final FragmentManager fragmentManager = getSupportFragmentManager();
final FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
final Fragment showFragment = fragmentManager.findFragmentById(id);
if (showFragment == null) {
fragmentTransaction.add(id, fragment);
} else {
fragmentTransaction.show(showFragment);
}
fragmentTransaction.commit();
}
use of androidx.fragment.app.FragmentTransaction in project GifView by Cutta.
the class MainActivity method openFragment.
public void openFragment() {
FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
GifFragment fragmentLocal = GifFragment.newInstance();
fragmentLocal.setHasOptionsMenu(true);
trans.replace(R.id.frame, fragmentLocal, fragmentLocal.getTAG());
trans.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
trans.addToBackStack(fragmentLocal.getTAG());
trans.commitAllowingStateLoss();
}
use of androidx.fragment.app.FragmentTransaction in project AmazeFileManager by TeamAmaze.
the class DatabaseViewerActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_db_viewer);
toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
boolean useNewStack = getBoolean(PREFERENCE_TEXTEDITOR_NEWSTACK);
getSupportActionBar().setDisplayHomeAsUpEnabled(!useNewStack);
path = getIntent().getStringExtra("path");
pathFile = new File(path);
listView = findViewById(R.id.listView);
load(pathFile);
listView.setOnItemClickListener((parent, view, position, id) -> {
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
DbViewerFragment fragment = new DbViewerFragment();
Bundle bundle = new Bundle();
bundle.putString("table", arrayList.get(position));
fragment.setArguments(bundle);
fragmentTransaction.add(R.id.content_frame, fragment);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
});
initStatusBarResources(findViewById(R.id.parentdb));
}
Aggregations