mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-30 22:34:02 +01:00
Convert dependency inject ("di") package to kotlin (#5976)
* Convert a batch of easier modules * Convert the NetworkingModule to kotlin * Converted the ApplicationlessInjection to kotlin * Convert CommonsDaggerAppCompatActivity to kotlin * Convert CommonsDaggerContentProvider to kotlin * Convert CommonsDaggerIntentService to kotlin * Convert CommonsDaggerService to kotlin * Convert CommonsDaggerSupportFragment to kotlin * Convert CommonsDaggerBroadcastReceiver to kotlin * Convert CommonsApplicationModule to kotlin * Fix imports and make them consistent
This commit is contained in:
parent
dac3657536
commit
1e5521b434
41 changed files with 1274 additions and 1465 deletions
|
|
@ -3,6 +3,7 @@ package fr.free.nrw.commons.contributions
|
|||
import androidx.paging.PagedList.BoundaryCallback
|
||||
import fr.free.nrw.commons.auth.SessionManager
|
||||
import fr.free.nrw.commons.di.CommonsApplicationModule
|
||||
import fr.free.nrw.commons.di.CommonsApplicationModule.Companion.IO_THREAD
|
||||
import fr.free.nrw.commons.media.MediaClient
|
||||
import io.reactivex.Scheduler
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
|
|
@ -20,7 +21,7 @@ class ContributionBoundaryCallback
|
|||
private val repository: ContributionsRepository,
|
||||
private val sessionManager: SessionManager,
|
||||
private val mediaClient: MediaClient,
|
||||
@param:Named(CommonsApplicationModule.IO_THREAD) private val ioThreadScheduler: Scheduler,
|
||||
@param:Named(IO_THREAD) private val ioThreadScheduler: Scheduler,
|
||||
) : BoundaryCallback<Contribution>() {
|
||||
private val compositeDisposable: CompositeDisposable = CompositeDisposable()
|
||||
var userName: String? = null
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package fr.free.nrw.commons.contributions;
|
||||
|
||||
import static fr.free.nrw.commons.di.CommonsApplicationModule.IO_THREAD;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.paging.DataSource;
|
||||
|
|
@ -34,7 +36,7 @@ public class ContributionsListPresenter implements UserActionListener {
|
|||
final ContributionBoundaryCallback contributionBoundaryCallback,
|
||||
final ContributionsRemoteDataSource contributionsRemoteDataSource,
|
||||
final ContributionsRepository repository,
|
||||
@Named(CommonsApplicationModule.IO_THREAD) final Scheduler ioThreadScheduler) {
|
||||
@Named(IO_THREAD) final Scheduler ioThreadScheduler) {
|
||||
this.contributionBoundaryCallback = contributionBoundaryCallback;
|
||||
this.repository = repository;
|
||||
this.ioThreadScheduler = ioThreadScheduler;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package fr.free.nrw.commons.contributions;
|
||||
|
||||
import static fr.free.nrw.commons.di.CommonsApplicationModule.IO_THREAD;
|
||||
import static fr.free.nrw.commons.utils.ImageUtils.IMAGE_OK;
|
||||
|
||||
import androidx.work.ExistingWorkPolicy;
|
||||
|
|
@ -31,7 +32,7 @@ public class ContributionsPresenter implements UserActionListener {
|
|||
@Inject
|
||||
ContributionsPresenter(ContributionsRepository repository,
|
||||
UploadRepository uploadRepository,
|
||||
@Named(CommonsApplicationModule.IO_THREAD) Scheduler ioThreadScheduler) {
|
||||
@Named(IO_THREAD) Scheduler ioThreadScheduler) {
|
||||
this.contributionsRepository = repository;
|
||||
this.uploadRepository = uploadRepository;
|
||||
this.ioThreadScheduler = ioThreadScheduler;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package fr.free.nrw.commons.contributions
|
||||
|
||||
import androidx.paging.ItemKeyedDataSource
|
||||
import fr.free.nrw.commons.di.CommonsApplicationModule
|
||||
import fr.free.nrw.commons.di.CommonsApplicationModule.Companion.IO_THREAD
|
||||
import fr.free.nrw.commons.media.MediaClient
|
||||
import io.reactivex.Scheduler
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
|
|
@ -16,7 +16,7 @@ class ContributionsRemoteDataSource
|
|||
@Inject
|
||||
constructor(
|
||||
private val mediaClient: MediaClient,
|
||||
@param:Named(CommonsApplicationModule.IO_THREAD) private val ioThreadScheduler: Scheduler,
|
||||
@param:Named(IO_THREAD) private val ioThreadScheduler: Scheduler,
|
||||
) : ItemKeyedDataSource<Int, Contribution>() {
|
||||
private val compositeDisposable: CompositeDisposable = CompositeDisposable()
|
||||
var userName: String? = null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue