fix: hide the thumbnail card on fragments other than MediaDetailFragment

This commit is contained in:
Rohit Verma 2025-04-02 16:31:02 +05:30
parent e15d8b156d
commit 9002978292

View file

@ -387,6 +387,11 @@ class UploadActivity : BaseActivity(), UploadContract.View, UploadBaseFragment.C
override fun onUploadMediaDeleted(index: Int) {
fragments!!.removeAt(index) //Remove the corresponding fragment
uploadableFiles.removeAt(index) //Remove the files from the list
if(fragments!![currentSelectedPosition] !is UploadMediaDetailFragment) {
// Should hide the top card current fragment is not the media detail fragment
showHideTopCard(false)
}
thumbnailsAdapter!!.notifyItemRemoved(index) //Notify the thumbnails adapter
uploadImagesAdapter!!.notifyDataSetChanged() //Notify the ViewPager
}