mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	search API duplicate images fixed
This commit is contained in:
		
							parent
							
								
									ecebe4c584
								
							
						
					
					
						commit
						87b6568abe
					
				
					 1 changed files with 8 additions and 5 deletions
				
			
		|  | @ -158,11 +158,15 @@ public class SearchImageFragment extends CommonsDaggerSupportFragment { | |||
|      * @param mediaList List of media to be added | ||||
|      */ | ||||
|     private void handlePaginationSuccess(List<Media> mediaList) { | ||||
|         queryList.addAll(mediaList); | ||||
|         progressBar.setVisibility(View.GONE); | ||||
|         imagesAdapter.addAll(mediaList); | ||||
|         imagesAdapter.notifyDataSetChanged(); | ||||
|         ((SearchActivity)getContext()).viewPagerNotifyDataSetChanged(); | ||||
|         if (mediaList.size()!=0){ | ||||
|             if (!queryList.get(queryList.size()-1).getFilename().equals(mediaList.get(mediaList.size()-1).getFilename())) { | ||||
|                 queryList.addAll(mediaList); | ||||
|                 imagesAdapter.addAll(mediaList); | ||||
|                 imagesAdapter.notifyDataSetChanged(); | ||||
|                 ((SearchActivity)getContext()).viewPagerNotifyDataSetChanged(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|  | @ -197,7 +201,6 @@ public class SearchImageFragment extends CommonsDaggerSupportFragment { | |||
|     private void handleError(Throwable throwable) { | ||||
|         Timber.e(throwable, "Error occurred while loading queried images"); | ||||
|         try { | ||||
|             initErrorView(); | ||||
|             ViewUtil.showSnackbar(imagesRecyclerView, R.string.error_loading_images); | ||||
|         }catch (Exception e){ | ||||
|             e.printStackTrace(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ujjwal Agrawal
						Ujjwal Agrawal