aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/injectors
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2021-04-17 17:08:19 -0700
committerAllan Wang <me@allanwang.ca>2021-04-17 17:08:19 -0700
commit39db7f4c3d7b8f3d68ef1a8881b69624b721f6c6 (patch)
treecb24b739861219861b651aa064a91432f30c681b /app/src/main/kotlin/com/pitchedapps/frost/injectors
parent88a5d17814ff9f7c44f79216510d405f057ae454 (diff)
downloadfrost-39db7f4c3d7b8f3d68ef1a8881b69624b721f6c6.tar.gz
frost-39db7f4c3d7b8f3d68ef1a8881b69624b721f6c6.tar.bz2
frost-39db7f4c3d7b8f3d68ef1a8881b69624b721f6c6.zip
Start hilt injection
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/injectors')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/injectors/ThemeProvider.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/ThemeProvider.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/ThemeProvider.kt
index 570f3719..f57b3a51 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/ThemeProvider.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/ThemeProvider.kt
@@ -30,8 +30,10 @@ import com.pitchedapps.frost.enums.Theme
import com.pitchedapps.frost.enums.ThemeCategory
import com.pitchedapps.frost.prefs.Prefs
import com.pitchedapps.frost.utils.L
+import dagger.hilt.android.qualifiers.ApplicationContext
import java.io.BufferedReader
import java.io.FileNotFoundException
+import javax.inject.Inject
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.koin.core.context.GlobalContext
@@ -40,7 +42,10 @@ import org.koin.core.context.GlobalContext
* Provides [InjectorContract] for each [ThemeCategory].
* Can be reloaded to take in changes from [Prefs]
*/
-class ThemeProvider(private val context: Context, private val prefs: Prefs) {
+class ThemeProvider @Inject internal constructor(
+ @ApplicationContext private val context: Context,
+ private val prefs: Prefs
+) {
private var theme: Theme = Theme.values[prefs.theme]