use of fr.free.nrw.commons.media.MediaDetailFragment 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();
}
}
use of fr.free.nrw.commons.media.MediaDetailFragment in project apps-android-commons by commons-app.
the class ReviewActivity method setUpMediaDetailOnOrientation.
/**
* set up media detail fragment after orientation change
*/
private void setUpMediaDetailOnOrientation() {
Fragment mediaDetailFragment = getSupportFragmentManager().findFragmentById(R.id.mediaDetailContainer);
if (mediaDetailFragment != null) {
mediaDetailContainer.setVisibility(View.VISIBLE);
reviewContainer.setVisibility(View.INVISIBLE);
getSupportFragmentManager().beginTransaction().replace(R.id.mediaDetailContainer, mediaDetailFragment).commit();
}
}
Aggregations