|
38 | 38 | import fr.free.nrw.commons.notification.Notification;
|
39 | 39 | import fr.free.nrw.commons.notification.NotificationController;
|
40 | 40 | import fr.free.nrw.commons.theme.BaseActivity;
|
| 41 | +import fr.free.nrw.commons.upload.UploadService.ServiceCallback; |
41 | 42 | import io.reactivex.disposables.Disposable;
|
42 | 43 | import java.util.List;
|
43 | 44 |
|
@@ -84,7 +85,7 @@ public class ContributionsFragment
|
84 | 85 | OnBackStackChangedListener,
|
85 | 86 | LocationUpdateListener,
|
86 | 87 | MediaDetailProvider,
|
87 |
| - ICampaignsView, ContributionsContract.View, Callback { |
| 88 | + ICampaignsView, ContributionsContract.View, Callback , ServiceCallback { |
88 | 89 | @Inject @Named("default_preferences") JsonKvStore store;
|
89 | 90 | @Inject NearbyController nearbyController;
|
90 | 91 | @Inject OkHttpJsonApiClient okHttpJsonApiClient;
|
@@ -135,6 +136,7 @@ public static ContributionsFragment newInstance() {
|
135 | 136 | public void onServiceConnected(ComponentName componentName, IBinder binder) {
|
136 | 137 | uploadService = (UploadService) ((UploadService.UploadServiceLocalBinder) binder)
|
137 | 138 | .getService();
|
| 139 | + uploadService.setServiceCallback(ContributionsFragment.this); |
138 | 140 | isUploadServiceConnected = true;
|
139 | 141 | }
|
140 | 142 |
|
@@ -520,6 +522,7 @@ public void onDestroy() {
|
520 | 522 |
|
521 | 523 | if (isUploadServiceConnected) {
|
522 | 524 | if (getActivity() != null) {
|
| 525 | + uploadService.setServiceCallback(null); |
523 | 526 | getActivity().unbindService(uploadServiceConnection);
|
524 | 527 | isUploadServiceConnected = false;
|
525 | 528 | }
|
@@ -666,5 +669,10 @@ public void backButtonClicked() {
|
666 | 669 | public MediaDetailPagerFragment getMediaDetailPagerFragment() {
|
667 | 670 | return mediaDetailPagerFragment;
|
668 | 671 | }
|
| 672 | + |
| 673 | + @Override |
| 674 | + public void updateUploadCount() { |
| 675 | + setUploadCount(); |
| 676 | + } |
669 | 677 | }
|
670 | 678 |
|
0 commit comments