aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-01-10 22:15:17 -0500
committerAllan Wang <me@allanwang.ca>2018-01-10 22:15:17 -0500
commit6e648bfc6b596eb4e49f8b37ca436e5ca12e9512 (patch)
tree062d4c53ee8b6982525fb2d74639aafe91539f42 /app/src/main
parentfd5f2a82eb968b5d50f586925ebb705249062446 (diff)
downloadfrost-6e648bfc6b596eb4e49f8b37ca436e5ca12e9512.tar.gz
frost-6e648bfc6b596eb4e49f8b37ca436e5ca12e9512.tar.bz2
frost-6e648bfc6b596eb4e49f8b37ca436e5ca12e9512.zip
Fix login webviewv1.7.7
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt13
1 files changed, 6 insertions, 7 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 a2f341ef..44172416 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt
@@ -31,12 +31,8 @@ class LoginWebView @JvmOverloads constructor(
private lateinit var loginCallback: (CookieModel) -> Unit
private lateinit var progressCallback: (Int) -> Unit
- init {
- FbCookie.reset(this::setupWebview)
- }
-
@SuppressLint("SetJavaScriptEnabled")
- fun setupWebview() {
+ private fun setupWebview() {
settings.javaScriptEnabled = true
setLayerType(View.LAYER_TYPE_HARDWARE, null)
webViewClient = LoginClient()
@@ -47,7 +43,10 @@ class LoginWebView @JvmOverloads constructor(
this.progressCallback = progressCallback
this.loginCallback = loginCallback
L.d { "Begin loading login" }
- loadUrl(FB_LOGIN_URL)
+ FbCookie.reset {
+ setupWebview()
+ loadUrl(FB_LOGIN_URL)
+ }
}
private inner class LoginClient : BaseWebViewClient() {
@@ -86,7 +85,7 @@ class LoginWebView @JvmOverloads constructor(
}
}
- inner class LoginChromeClient : WebChromeClient() {
+ private inner class LoginChromeClient : WebChromeClient() {
override fun onConsoleMessage(consoleMessage: ConsoleMessage): Boolean {
L.v { "Login Console ${consoleMessage.lineNumber()}: ${consoleMessage.message()}" }
return true