Search in sources :

Example 81 with FragmentManager

use of androidx.fragment.app.FragmentManager in project apps-android-commons by commons-app.

the class ContributionsListFragment method showAddImageToWikipediaInstructions.

/**
 * Display confirmation dialog with instructions when the user tries to add image to wikipedia
 *
 * @param contribution
 */
private void showAddImageToWikipediaInstructions(Contribution contribution) {
    FragmentManager fragmentManager = getFragmentManager();
    WikipediaInstructionsDialogFragment fragment = WikipediaInstructionsDialogFragment.newInstance(contribution);
    fragment.setCallback(this::onConfirmClicked);
    fragment.show(fragmentManager, "WikimediaFragment");
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager)

Example 82 with FragmentManager

use of androidx.fragment.app.FragmentManager in project apps-android-commons by commons-app.

the class ReviewActivity method setUpMediaDetailFragment.

/**
 * set up the media detail fragment when click on the review image
 */
private void setUpMediaDetailFragment() {
    if (mediaDetailContainer.getVisibility() == View.GONE && media != null) {
        mediaDetailContainer.setVisibility(View.VISIBLE);
        reviewContainer.setVisibility(View.INVISIBLE);
        FragmentManager fragmentManager = getSupportFragmentManager();
        mediaDetailFragment = new MediaDetailFragment();
        Bundle bundle = new Bundle();
        bundle.putParcelable("media", media);
        mediaDetailFragment.setArguments(bundle);
        fragmentManager.beginTransaction().add(R.id.mediaDetailContainer, mediaDetailFragment).addToBackStack("MediaDetail").commit();
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) Bundle(android.os.Bundle) MediaDetailFragment(fr.free.nrw.commons.media.MediaDetailFragment)

Example 83 with FragmentManager

use of androidx.fragment.app.FragmentManager in project mopub-android-mediation by mopub.

the class MoPubSampleActivity method onImpressionsMenu.

private void onImpressionsMenu() {
    final FragmentManager manager = getSupportFragmentManager();
    if (manager.findFragmentByTag(IMPRESSIONS_FRAGMENT_TAG) == null) {
        ImpressionsInfoFragment fragment = ImpressionsInfoFragment.newInstance(new ArrayList<>(mImpressionsList));
        manager.beginTransaction().replace(R.id.fragment_container, fragment, IMPRESSIONS_FRAGMENT_TAG).addToBackStack(IMPRESSIONS_FRAGMENT_TAG).commit();
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager)

Example 84 with FragmentManager

use of androidx.fragment.app.FragmentManager in project mopub-android-mediation by mopub.

the class MoPubSampleActivity method onClearLogs.

private void onClearLogs() {
    FragmentManager manager = getSupportFragmentManager();
    final ImpressionsInfoFragment fragment = (ImpressionsInfoFragment) manager.findFragmentByTag(IMPRESSIONS_FRAGMENT_TAG);
    if (fragment != null) {
        fragment.onClear();
    }
    mImpressionsList.clear();
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager)

Example 85 with FragmentManager

use of androidx.fragment.app.FragmentManager in project Signal-Android by WhisperSystems.

the class MmsPreferencesActivity method onCreate.

@Override
protected void onCreate(Bundle icicle, boolean ready) {
    assert getSupportActionBar() != null;
    this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    Fragment fragment = new MmsPreferencesFragment();
    FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.replace(android.R.id.content, fragment);
    fragmentTransaction.commit();
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) FragmentTransaction(androidx.fragment.app.FragmentTransaction) Fragment(androidx.fragment.app.Fragment)

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