Search in sources :

Example 6 with MediaDetailPagerFragment

use of fr.free.nrw.commons.media.MediaDetailPagerFragment in project apps-android-commons by commons-app.

the class ContributionsActivity method showDetail.

/** Replace whatever is in the current contributionsFragmentContainer view with mediaDetailPagerFragment,
    /   and preserve previous state in back stack.
    /   Called when user selects a contribution. */
private void showDetail(int i) {
    if (mediaDetails == null || !mediaDetails.isVisible()) {
        mediaDetails = new MediaDetailPagerFragment();
        this.getSupportFragmentManager().beginTransaction().replace(R.id.contributionsFragmentContainer, mediaDetails).addToBackStack(null).commit();
        this.getSupportFragmentManager().executePendingTransactions();
    }
    mediaDetails.showImage(i);
}
Also used : MediaDetailPagerFragment(fr.free.nrw.commons.media.MediaDetailPagerFragment)

Example 7 with MediaDetailPagerFragment

use of fr.free.nrw.commons.media.MediaDetailPagerFragment in project apps-android-commons by commons-app.

the class ContributionsFragment method refreshNominatedMedia.

/**
 * Reload media detail fragment once media is nominated
 *
 * @param index item position that has been nominated
 */
@Override
public void refreshNominatedMedia(int index) {
    if (mediaDetailPagerFragment != null && !contributionsListFragment.isVisible()) {
        removeFragment(mediaDetailPagerFragment);
        mediaDetailPagerFragment = new MediaDetailPagerFragment(false, true);
        mediaDetailPagerFragment.showImage(index);
        showMediaDetailPagerFragment();
    }
}
Also used : MediaDetailPagerFragment(fr.free.nrw.commons.media.MediaDetailPagerFragment)

Example 8 with MediaDetailPagerFragment

use of fr.free.nrw.commons.media.MediaDetailPagerFragment in project apps-android-commons by commons-app.

the class CategoryDetailsActivity method onMediaClicked.

/**
 * This method is called onClick of media inside category details (CategoryImageListFragment).
 */
@Override
public void onMediaClicked(int position) {
    tabLayout.setVisibility(View.GONE);
    viewPager.setVisibility(View.GONE);
    mediaContainer.setVisibility(View.VISIBLE);
    if (mediaDetails == null || !mediaDetails.isVisible()) {
        // set isFeaturedImage true for featured images, to include author field on media detail
        mediaDetails = new MediaDetailPagerFragment(false, true);
        FragmentManager supportFragmentManager = getSupportFragmentManager();
        supportFragmentManager.beginTransaction().replace(R.id.mediaContainer, mediaDetails).addToBackStack(null).commit();
        supportFragmentManager.executePendingTransactions();
    }
    mediaDetails.showImage(position);
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) MediaDetailPagerFragment(fr.free.nrw.commons.media.MediaDetailPagerFragment)

Example 9 with MediaDetailPagerFragment

use of fr.free.nrw.commons.media.MediaDetailPagerFragment in project apps-android-commons by commons-app.

the class BookmarkListRootFragment method refreshNominatedMedia.

/**
 * Reload media detail fragment once media is nominated
 *
 * @param index item position that has been nominated
 */
@Override
public void refreshNominatedMedia(int index) {
    if (mediaDetails != null && !listFragment.isVisible()) {
        removeFragment(mediaDetails);
        mediaDetails = new MediaDetailPagerFragment(false, true);
        ((BookmarkFragment) getParentFragment()).setScroll(false);
        setFragment(mediaDetails, listFragment);
        mediaDetails.showImage(index);
    }
}
Also used : MediaDetailPagerFragment(fr.free.nrw.commons.media.MediaDetailPagerFragment)

Example 10 with MediaDetailPagerFragment

use of fr.free.nrw.commons.media.MediaDetailPagerFragment in project apps-android-commons by commons-app.

the class BookmarkListRootFragment method onItemClick.

@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    Log.d("deneme8", "on media clicked");
    container.setVisibility(View.VISIBLE);
    ((BookmarkFragment) getParentFragment()).tabLayout.setVisibility(View.GONE);
    mediaDetails = new MediaDetailPagerFragment(false, true);
    ((BookmarkFragment) getParentFragment()).setScroll(false);
    setFragment(mediaDetails, listFragment);
    mediaDetails.showImage(position);
}
Also used : MediaDetailPagerFragment(fr.free.nrw.commons.media.MediaDetailPagerFragment)

Aggregations

MediaDetailPagerFragment (fr.free.nrw.commons.media.MediaDetailPagerFragment)10 FragmentManager (androidx.fragment.app.FragmentManager)3