-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d6be19
commit 377920d
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
app/src/main/java/com/karumi/jetpack/superheroes/worker/ThanosWorker.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.karumi.jetpack.superheroes.worker | ||
|
||
import android.content.Context | ||
import android.util.Log | ||
import androidx.work.Worker | ||
import androidx.work.WorkerParameters | ||
import com.karumi.jetpack.superheroes.data.repository.LocalSuperHeroDataSource | ||
import org.kodein.di.KodeinAware | ||
import org.kodein.di.android.closestKodein | ||
import org.kodein.di.erased.instance | ||
|
||
class ThanosWorker( | ||
context: Context, | ||
params: WorkerParameters | ||
) : Worker(context, params), KodeinAware { | ||
|
||
override val kodein by closestKodein(context) | ||
private val localSuperHeroesDataSource: LocalSuperHeroDataSource by instance() | ||
|
||
override fun doWork(): Result { | ||
Log.d("GERSIO", "doWork!") | ||
localSuperHeroesDataSource.deleteRandomHalf() | ||
return Result.success() | ||
} | ||
} |