Search in sources :

Example 76 with FragmentTransaction

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;
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) PreferenceFrameLayout(android.preference.PreferenceFrameLayout) View(android.view.View)

Example 77 with FragmentTransaction

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();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction)

Example 78 with FragmentTransaction

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();
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentTransaction(androidx.fragment.app.FragmentTransaction) ContextualCardsFragment(com.android.settings.homepage.contextualcards.ContextualCardsFragment) Fragment(androidx.fragment.app.Fragment)

Example 79 with FragmentTransaction

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();
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) GifFragment(cuneyt.example.com.gifview.Fragments.GifFragment)

Example 80 with FragmentTransaction

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));
}
Also used : DbViewerFragment(com.amaze.filemanager.ui.fragments.DbViewerFragment) FragmentTransaction(androidx.fragment.app.FragmentTransaction) Bundle(android.os.Bundle) File(java.io.File)

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