aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/activities/DebugActivity.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2020-02-23 16:06:45 -0800
committerAllan Wang <me@allanwang.ca>2020-02-23 16:06:45 -0800
commitc8b54fd10a08ed53eb7d21578a4fe990fe14e3bc (patch)
tree0841d112c8c00504ce10ca72ef39e403b69c595c /app/src/main/kotlin/com/pitchedapps/frost/activities/DebugActivity.kt
parent4d5aaf541dbfa7d521ebbc5f011a642c83c4b9c5 (diff)
downloadfrost-c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc.tar.gz
frost-c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc.tar.bz2
frost-c8b54fd10a08ed53eb7d21578a4fe990fe14e3bc.zip
Move prefs to service locator
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/activities/DebugActivity.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/DebugActivity.kt10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/DebugActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/DebugActivity.kt
index 47b096ab..509d3d12 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/DebugActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/DebugActivity.kt
@@ -38,11 +38,13 @@ import java.io.File
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
import kotlinx.coroutines.CoroutineExceptionHandler
+import org.koin.core.KoinComponent
+import org.koin.core.inject
/**
* Created by Allan Wang on 05/01/18.
*/
-class DebugActivity : KauBaseActivity() {
+class DebugActivity : KauBaseActivity(), KoinComponent {
companion object {
const val RESULT_URL = "extra_result_url"
@@ -51,6 +53,8 @@ class DebugActivity : KauBaseActivity() {
fun baseDir(context: Context) = File(context.externalCacheDir, "offline_debug")
}
+ private val prefs: Prefs by inject()
+
lateinit var binding: ActivityDebugBinding
override fun onCreate(savedInstanceState: Bundle?) {
@@ -76,8 +80,8 @@ class DebugActivity : KauBaseActivity() {
swipeRefresh.setOnRefreshListener(debugWebview::reload)
- fab.visible().setIcon(GoogleMaterial.Icon.gmd_bug_report, Prefs.iconColor)
- fab.backgroundTintList = ColorStateList.valueOf(Prefs.accentColor)
+ fab.visible().setIcon(GoogleMaterial.Icon.gmd_bug_report, prefs.iconColor)
+ fab.backgroundTintList = ColorStateList.valueOf(prefs.accentColor)
fab.setOnClickListener { _ ->
fab.hide()