aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-20 14:27:26 -0700
committerAllan Wang <me@allanwang.ca>2017-08-20 14:27:26 -0700
commit93b179c7f86bd4c7bd0cd75754eb393cfcaf967c (patch)
treea6fac519cf08652dbbe8219ea17fa5b9531d41f8 /app/src/main/kotlin
parent238c263376d2db2ef7bff765155832fa95309cf1 (diff)
downloadfrost-93b179c7f86bd4c7bd0cd75754eb393cfcaf967c.tar.gz
frost-93b179c7f86bd4c7bd0cd75754eb393cfcaf967c.tar.bz2
frost-93b179c7f86bd4c7bd0cd75754eb393cfcaf967c.zip
Update themes
Diffstat (limited to 'app/src/main/kotlin')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt1
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/LoginWebView.kt14
2 files changed, 8 insertions, 7 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
index 8335be7f..a961972f 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
@@ -71,6 +71,7 @@ open class FrostWebViewClient(val webCore: FrostWebViewCore) : BaseWebViewClient
view.jsInject(
CssAssets.ROUND_ICONS.maybe(Prefs.showRoundedIcons),
CssHider.HEADER,
+ CssHider.CORE,
CssHider.PEOPLE_YOU_MAY_KNOW.maybe(!Prefs.showSuggestedFriends && IS_FROST_PRO),
Prefs.themeInjector,
CssHider.NON_RECENT.maybe(webCore.url?.contains("?sk=h_chr") ?: false))
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 {