Fixes #2815 - Nominating for deletion is cancelled on leaving the media details (#4295)

* fix issue with nominating for deletion

* Fix UI issue

* minor improvements

* fix App crash

* Added Javadoc and other minor improvements

* Updated string name

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
This commit is contained in:
Pratham Pahariya 2021-06-04 07:45:39 +05:30 committed by GitHub
parent 76b30678da
commit ca18763e4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 224 additions and 38 deletions

View file

@ -169,6 +169,22 @@ public class BookmarkListRootFragment extends CommonsDaggerSupportFragment imple
return null;
}
/**
* 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);
}
}
/**
* This method is called on success of API call for featured images or mobile uploads. The
* viewpager will notified that number of items have changed.