aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt
index 33a4875f..37e06db9 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt
@@ -42,6 +42,8 @@ import com.pitchedapps.frost.utils.Prefs
import com.pitchedapps.frost.utils.isFacebookUrl
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.coroutineScope
+import org.koin.core.KoinComponent
+import org.koin.core.inject
/**
* Created by Allan Wang on 2017-05-29.
@@ -50,8 +52,10 @@ class LoginWebView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
-) : WebView(context, attrs, defStyleAttr) {
+) : WebView(context, attrs, defStyleAttr), KoinComponent {
+ private val fbCookie: FbCookie by inject()
+ private val prefs: Prefs by inject()
private val completable: CompletableDeferred<CookieEntity> = CompletableDeferred()
private lateinit var progressCallback: (Int) -> Unit
@@ -69,7 +73,7 @@ class LoginWebView @JvmOverloads constructor(
this@LoginWebView.progressCallback = progressCallback
L.d { "Begin loading login" }
launchMain {
- FbCookie.reset()
+ fbCookie.reset()
setupWebview()
loadUrl(FB_LOGIN_URL)
}
@@ -101,7 +105,8 @@ class LoginWebView @JvmOverloads constructor(
if (url.isFacebookUrl)
view.jsInject(
CssHider.CORE,
- Prefs.themeInjector
+ prefs.themeInjector,
+ prefs = prefs
)
}