mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	fixes - #1984 -Upload count does not get updated right away post successful upload
->implements the Callback method to update total number of media uploaded
This commit is contained in:
		
							parent
							
								
									3ad16d120f
								
							
						
					
					
						commit
						8384ad03dc
					
				
					 2 changed files with 23 additions and 1 deletions
				
			
		|  | @ -38,6 +38,7 @@ import fr.free.nrw.commons.auth.SessionManager; | |||
| import fr.free.nrw.commons.notification.Notification; | ||||
| import fr.free.nrw.commons.notification.NotificationController; | ||||
| import fr.free.nrw.commons.theme.BaseActivity; | ||||
| import fr.free.nrw.commons.upload.UploadService.ServiceCallback; | ||||
| import io.reactivex.disposables.Disposable; | ||||
| import java.util.List; | ||||
| 
 | ||||
|  | @ -84,7 +85,7 @@ public class ContributionsFragment | |||
|         OnBackStackChangedListener, | ||||
|         LocationUpdateListener, | ||||
|     MediaDetailProvider, | ||||
|     ICampaignsView, ContributionsContract.View, Callback { | ||||
|     ICampaignsView, ContributionsContract.View, Callback , ServiceCallback { | ||||
|     @Inject @Named("default_preferences") JsonKvStore store; | ||||
|     @Inject NearbyController nearbyController; | ||||
|     @Inject OkHttpJsonApiClient okHttpJsonApiClient; | ||||
|  | @ -135,6 +136,7 @@ public class ContributionsFragment | |||
|         public void onServiceConnected(ComponentName componentName, IBinder binder) { | ||||
|             uploadService = (UploadService) ((UploadService.UploadServiceLocalBinder) binder) | ||||
|                     .getService(); | ||||
|             uploadService.setServiceCallback(ContributionsFragment.this); | ||||
|             isUploadServiceConnected = true; | ||||
|         } | ||||
| 
 | ||||
|  | @ -520,6 +522,7 @@ public class ContributionsFragment | |||
| 
 | ||||
|             if (isUploadServiceConnected) { | ||||
|                 if (getActivity() != null) { | ||||
|                     uploadService.setServiceCallback(null); | ||||
|                     getActivity().unbindService(uploadServiceConnection); | ||||
|                     isUploadServiceConnected = false; | ||||
|                 } | ||||
|  | @ -666,5 +669,10 @@ public class ContributionsFragment | |||
|     public MediaDetailPagerFragment getMediaDetailPagerFragment() { | ||||
|         return mediaDetailPagerFragment; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void updateUploadCount() { | ||||
|         setUploadCount(); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Prince kushwaha
						Prince kushwaha