From 93b179c7f86bd4c7bd0cd75754eb393cfcaf967c Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 20 Aug 2017 14:27:26 -0700 Subject: Update themes --- .../main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt') 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 51dc2e99..d188d629 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt @@ -2,6 +2,7 @@ package com.pitchedapps.frost.web import android.annotation.SuppressLint import android.content.Context +import android.graphics.Color import android.util.AttributeSet import android.view.View import android.webkit.* @@ -56,12 +57,7 @@ class LoginWebView @JvmOverloads constructor( override fun onPageFinished(view: WebView, url: String?) { super.onPageFinished(view, url) checkForLogin(url) { id, cookie -> loginCallback(CookieModel(id, "", cookie)) } - if (url.isFacebookUrl) - view.jsInject(CssHider.HEADER, - CssHider.CORE, - Prefs.themeInjector, - callback = { if (!view.isVisible) view.fadeIn(offset = WEB_LOAD_DELAY) }) - else if (!view.isVisible) view.fadeIn() + if (!view.isVisible) view.fadeIn() } fun checkForLogin(url: String?, onFound: (id: Long, cookie: String) -> Unit) { @@ -76,7 +72,11 @@ class LoginWebView @JvmOverloads constructor( override fun onPageCommitVisible(view: WebView, url: String?) { super.onPageCommitVisible(view, url) - view.setBackgroundColor(Prefs.bgColor) + view.setBackgroundColor(Color.TRANSPARENT) + if (url.isFacebookUrl) + view.jsInject(CssHider.HEADER, + CssHider.CORE, + Prefs.themeInjector) } override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean { -- cgit v1.2.3