Skip to content

Commit

Permalink
Attempt to fix koin crash (InsertKoinIO/koin#992)
Browse files Browse the repository at this point in the history
  • Loading branch information
b-lam committed May 14, 2021
1 parent 745027a commit c7c6b26
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
3 changes: 0 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ android {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
ndk {
debugSymbolLevel 'FULL'
}
}
debug {
debuggable true
Expand Down
38 changes: 34 additions & 4 deletions app/src/main/java/com/b_lam/resplash/di/WorkerModule.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.b_lam.resplash.di

import androidx.work.WorkerParameters
import com.b_lam.resplash.worker.AutoWallpaperWorker
import com.b_lam.resplash.worker.DownloadWorker
import com.b_lam.resplash.worker.FutureAutoWallpaperWorker
Expand All @@ -9,8 +10,37 @@ import org.koin.dsl.module

val workerModule = module {

worker { AutoWallpaperWorker(get(), get(), get(), get(), get(), get()) }
worker { FutureAutoWallpaperWorker(get(), get(), get()) }
worker { DownloadWorker(get(), get(), get(), get()) }
worker { MuzeiWorker(get(), get(), get(), get()) }
worker { (workerParams: WorkerParameters) ->
AutoWallpaperWorker(
context = get(),
params = workerParams,
photoRepository = get(),
autoWallpaperRepository = get(),
downloadService = get(),
notificationManager = get()
)
}
worker { (workerParams: WorkerParameters) ->
FutureAutoWallpaperWorker(
context = get(),
params = workerParams,
sharedPreferencesRepository = get()
)
}
worker { (workerParams: WorkerParameters) ->
DownloadWorker(
context = get(),
params = workerParams,
downloadService = get(),
notificationManager = get()
)
}
worker { (workerParams: WorkerParameters) ->
MuzeiWorker(
context = get(),
params = workerParams,
photoRepository = get(),
autoWallpaperRepository = get()
)
}
}
4 changes: 2 additions & 2 deletions app/src/main/java/com/b_lam/resplash/worker/DownloadWorker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import java.util.*

class DownloadWorker(
private val context: Context,
parameters: WorkerParameters,
params: WorkerParameters,
private val downloadService: DownloadService,
private val notificationManager: NotificationManager
) : CoroutineWorker(context, parameters) {
) : CoroutineWorker(context, params) {

override suspend fun doWork(): Result {
val url = inputData.getString(KEY_INPUT_URL) ?: return Result.failure()
Expand Down

0 comments on commit c7c6b26

Please sign in to comment.