mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	ImageFragment.kt: unnecessary initialisation after exiting media preview was removed from passSelectedImages
This commit is contained in:
		
							parent
							
								
									323f069a69
								
							
						
					
					
						commit
						eb4edece2b
					
				
					 2 changed files with 4 additions and 11 deletions
				
			
		|  | @ -41,7 +41,6 @@ import fr.free.nrw.commons.R | |||
| import fr.free.nrw.commons.customselector.database.NotForUploadStatus | ||||
| import fr.free.nrw.commons.customselector.database.NotForUploadStatusDao | ||||
| import fr.free.nrw.commons.customselector.helper.CustomSelectorConstants | ||||
| import fr.free.nrw.commons.customselector.helper.CustomSelectorConstants.SHOULD_REFRESH | ||||
| import fr.free.nrw.commons.customselector.listeners.FolderClickListener | ||||
| import fr.free.nrw.commons.customselector.listeners.ImageSelectListener | ||||
| import fr.free.nrw.commons.customselector.model.Image | ||||
|  | @ -237,8 +236,7 @@ class CustomSelectorActivity : | |||
|             val selectedImages: ArrayList<Image> = | ||||
|                 data!! | ||||
|                     .getParcelableArrayListExtra(CustomSelectorConstants.NEW_SELECTED_IMAGES)!! | ||||
|             val shouldRefresh = data.getBooleanExtra(SHOULD_REFRESH, false) | ||||
|             imageFragment?.passSelectedImages(selectedImages, shouldRefresh) | ||||
|             viewModel?.selectedImages?.value = selectedImages | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -279,6 +279,9 @@ class ImageFragment : | |||
|                 filteredImages = ImageHelper.filterImages(images, bucketId) | ||||
|                 allImages = ArrayList(filteredImages) | ||||
|                 imageAdapter.init(filteredImages, allImages, TreeMap(), uploadingContributions) | ||||
|                 viewModel?.selectedImages?.value?.let { selectedImages -> | ||||
|                     imageAdapter.setSelectedImages(selectedImages) | ||||
|                 } | ||||
|                 imageAdapter.notifyDataSetChanged() | ||||
|                 selectorRV?.let { | ||||
|                     it.visibility = View.VISIBLE | ||||
|  | @ -383,14 +386,6 @@ class ImageFragment : | |||
|         selectedImages: ArrayList<Image>, | ||||
|         shouldRefresh: Boolean, | ||||
|     ) { | ||||
|         imageAdapter.setSelectedImages(selectedImages) | ||||
| 
 | ||||
|         val uploadingContributions = getUploadingContributions() | ||||
| 
 | ||||
|         if (!showAlreadyActionedImages && shouldRefresh) { | ||||
|             imageAdapter.init(filteredImages, allImages, TreeMap(), uploadingContributions) | ||||
|             imageAdapter.setSelectedImages(selectedImages) | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lachie Major
						Lachie Major