Search in sources :

Example 71 with Fragment

use of androidx.fragment.app.Fragment in project J2ME-Loader by nikita36078.

the class DonationsActivity method onActivityResult.

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    FragmentManager fragmentManager = getSupportFragmentManager();
    Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
    if (fragment != null) {
        fragment.onActivityResult(requestCode, resultCode, data);
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) Fragment(androidx.fragment.app.Fragment) DonationsFragment(org.sufficientlysecure.donations.DonationsFragment)

Example 72 with Fragment

use of androidx.fragment.app.Fragment in project K6nele by Kaljurand.

the class Preferences method onPreferenceStartFragment.

@Override
public boolean onPreferenceStartFragment(PreferenceFragmentCompat caller, Preference pref) {
    // Instantiate the new Fragment
    final Bundle args = pref.getExtras();
    final Fragment fragment = getSupportFragmentManager().getFragmentFactory().instantiate(getClassLoader(), pref.getFragment());
    fragment.setArguments(args);
    fragment.setTargetFragment(caller, 0);
    // Replace the existing Fragment with the new Fragment
    getSupportFragmentManager().beginTransaction().replace(android.R.id.content, fragment).addToBackStack(null).commit();
    return true;
}
Also used : Bundle(android.os.Bundle) Fragment(androidx.fragment.app.Fragment)

Example 73 with Fragment

use of androidx.fragment.app.Fragment in project PocketHub by pockethub.

the class GistFilesPagerAdapter method getItem.

@Override
public Fragment getItem(final int position) {
    GistFile file = files[position];
    Fragment fragment = new GistFileFragment();
    Bundle args = new Bundle();
    args.putParcelable(EXTRA_GIST_FILE, file);
    fragment.setArguments(args);
    return fragment;
}
Also used : Bundle(android.os.Bundle) GistFile(com.meisolsson.githubsdk.model.GistFile) Fragment(androidx.fragment.app.Fragment)

Example 74 with Fragment

use of androidx.fragment.app.Fragment in project PocketHub by pockethub.

the class GistsPagerAdapter method getItem.

@Override
public Fragment getItem(int position) {
    Fragment fragment = new GistFragment();
    Bundle args = new Bundle();
    args.putString(EXTRA_GIST_ID, ids[position]);
    fragment.setArguments(args);
    return fragment;
}
Also used : Bundle(android.os.Bundle) Fragment(androidx.fragment.app.Fragment)

Example 75 with Fragment

use of androidx.fragment.app.Fragment in project PocketHub by pockethub.

the class FragmentPagerAdapter method clearAdapter.

/**
 * This methods clears any fragments that may not apply to the newly
 * selected org.
 *
 * @return this adapter
 */
public FragmentPagerAdapter clearAdapter() {
    if (tags.isEmpty()) {
        return this;
    }
    FragmentTransaction transaction = fragmentManager.beginTransaction();
    for (String tag : tags) {
        Fragment fragment = fragmentManager.findFragmentByTag(tag);
        if (fragment != null) {
            transaction.remove(fragment);
        }
    }
    transaction.commit();
    tags.clear();
    return this;
}
Also used : FragmentTransaction(androidx.fragment.app.FragmentTransaction) Fragment(androidx.fragment.app.Fragment)

Aggregations

Fragment (androidx.fragment.app.Fragment)239 FragmentTransaction (androidx.fragment.app.FragmentTransaction)54 Bundle (android.os.Bundle)46 FragmentManager (androidx.fragment.app.FragmentManager)38 FileFragment (com.owncloud.android.ui.fragment.FileFragment)23 DialogFragment (androidx.fragment.app.DialogFragment)22 View (android.view.View)21 FileDetailFragment (com.owncloud.android.ui.fragment.FileDetailFragment)20 OCFileListFragment (com.owncloud.android.ui.fragment.OCFileListFragment)20 Intent (android.content.Intent)19 SortingOrderDialogFragment (com.owncloud.android.ui.dialog.SortingOrderDialogFragment)19 GalleryFragment (com.owncloud.android.ui.fragment.GalleryFragment)18 TaskRetainerFragment (com.owncloud.android.ui.fragment.TaskRetainerFragment)18 UnifiedSearchFragment (com.owncloud.android.ui.fragment.UnifiedSearchFragment)18 PreviewImageFragment (com.owncloud.android.ui.preview.PreviewImageFragment)18 PreviewMediaFragment (com.owncloud.android.ui.preview.PreviewMediaFragment)18 PreviewTextFileFragment (com.owncloud.android.ui.preview.PreviewTextFileFragment)18 PreviewTextFragment (com.owncloud.android.ui.preview.PreviewTextFragment)18 PreviewTextStringFragment (com.owncloud.android.ui.preview.PreviewTextStringFragment)18 PreviewPdfFragment (com.owncloud.android.ui.preview.pdf.PreviewPdfFragment)18