mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
Fixes #3790- Use WorkManagers to upload contributions (#4298)
* Fixes #3790
Use WorkManagers to process upload contributions
** Removed UploadService and Added UploadWorker to process contributions Upload
** Made nescessary changes to remove the usages of the Service from the classes
** UI Fxies- Minor changes in the retry and cancel uplaod icons to give them a clickable area of 48 dp
* Fixes #3790
Use WorkManagers to process upload contributions
** Removed UploadService and Added UploadWorker to process contributions Upload
** Made nescessary changes to remove the usages of the Service from the classes
** UI Fxies- Minor changes in the retry and cancel uplaod icons to give them a clickable area of 48 dp
* Updated JavaDocs in UploadWorker, Fixed Test cases
* Updated JavaDocs in UploadWorker, Fixed Test cases
* Updated gradle
* Revert "Updated gradle"
This reverts commit c8979fe6dc.
* rolledback to compileSDKVersion 28, fixed tests
* Don't call the show notifications on the main thread
* Bug Fix- Duplicate contributions, handle upload stash errors
This commit is contained in:
parent
fd2a7a9c56
commit
ecbff7e3b8
36 changed files with 692 additions and 802 deletions
|
|
@ -8,6 +8,7 @@ import android.content.Context;
|
|||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import dagger.android.AndroidInjector;
|
||||
|
|
@ -25,6 +26,7 @@ import dagger.android.support.HasSupportFragmentInjector;
|
|||
*/
|
||||
public class ApplicationlessInjection
|
||||
implements
|
||||
HasAndroidInjector,
|
||||
HasActivityInjector,
|
||||
HasFragmentInjector,
|
||||
HasSupportFragmentInjector,
|
||||
|
|
@ -34,6 +36,7 @@ public class ApplicationlessInjection
|
|||
|
||||
private static ApplicationlessInjection instance = null;
|
||||
|
||||
@Inject DispatchingAndroidInjector<Object> androidInjector;
|
||||
@Inject DispatchingAndroidInjector<Activity> activityInjector;
|
||||
@Inject DispatchingAndroidInjector<BroadcastReceiver> broadcastReceiverInjector;
|
||||
@Inject DispatchingAndroidInjector<android.app.Fragment> fragmentInjector;
|
||||
|
|
@ -49,6 +52,11 @@ public class ApplicationlessInjection
|
|||
commonsApplicationComponent.inject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AndroidInjector<Object> androidInjector() {
|
||||
return androidInjector;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DispatchingAndroidInjector<Activity> activityInjector() {
|
||||
return activityInjector;
|
||||
|
|
@ -94,5 +102,4 @@ public class ApplicationlessInjection
|
|||
|
||||
return instance;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import fr.free.nrw.commons.explore.categories.CategoriesModule;
|
|||
import fr.free.nrw.commons.navtab.MoreBottomSheetFragment;
|
||||
import fr.free.nrw.commons.navtab.MoreBottomSheetLoggedOutFragment;
|
||||
import fr.free.nrw.commons.navtab.NavTabLayout;
|
||||
import fr.free.nrw.commons.upload.worker.UploadWorker;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Component;
|
||||
|
|
@ -47,6 +48,8 @@ import fr.free.nrw.commons.widget.PicOfDayAppWidget;
|
|||
public interface CommonsApplicationComponent extends AndroidInjector<ApplicationlessInjection> {
|
||||
void inject(CommonsApplication application);
|
||||
|
||||
void inject(UploadWorker worker);
|
||||
|
||||
void inject(LoginActivity activity);
|
||||
|
||||
void inject(SettingsFragment fragment);
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ public class CommonsApplicationModule {
|
|||
@Provides
|
||||
public UploadController providesUploadController(SessionManager sessionManager,
|
||||
@Named("default_preferences") JsonKvStore kvStore,
|
||||
Context context) {
|
||||
Context context, ContributionDao contributionDao) {
|
||||
return new UploadController(sessionManager, context, kvStore);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package fr.free.nrw.commons.di;
|
|||
import dagger.Module;
|
||||
import dagger.android.ContributesAndroidInjector;
|
||||
import fr.free.nrw.commons.auth.WikiAccountAuthenticatorService;
|
||||
import fr.free.nrw.commons.upload.UploadService;
|
||||
|
||||
/**
|
||||
* This Class Represents the Module for dependency injection (using dagger)
|
||||
|
|
@ -14,9 +13,6 @@ import fr.free.nrw.commons.upload.UploadService;
|
|||
@SuppressWarnings({"WeakerAccess", "unused"})
|
||||
public abstract class ServiceBuilderModule {
|
||||
|
||||
@ContributesAndroidInjector
|
||||
abstract UploadService bindUploadService();
|
||||
|
||||
@ContributesAndroidInjector
|
||||
abstract WikiAccountAuthenticatorService bindWikiAccountAuthenticatorService();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue