aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-09-24 16:18:23 -0400
committerGitHub <noreply@github.com>2017-09-24 16:18:23 -0400
commitc4453c85557d2dbf24fa72def544335fe5782182 (patch)
treeb18c2f85cb8917d238b2013e7098cba801728141 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
parent3c85f0e84b4aa3062a25c978ea88497f4c1e6f25 (diff)
downloadfrost-c4453c85557d2dbf24fa72def544335fe5782182.tar.gz
frost-c4453c85557d2dbf24fa72def544335fe5782182.tar.bz2
frost-c4453c85557d2dbf24fa72def544335fe5782182.zip
Fix background color for non facebook pages (#335)
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt12
1 files changed, 9 insertions, 3 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 c398469c..31aaaa6f 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt
@@ -50,7 +50,6 @@ open class FrostWebViewClient(val webCore: FrostWebViewCore) : BaseWebViewClient
refreshObservable.onNext(true)
}
-
fun launchLogin(c: Context) {
if (c is MainActivity && c.cookies().isNotEmpty())
c.launchNewTask(SelectorActivity::class.java, c.cookies())
@@ -58,8 +57,15 @@ open class FrostWebViewClient(val webCore: FrostWebViewCore) : BaseWebViewClient
c.launchNewTask(LoginActivity::class.java)
}
- private fun injectBackgroundColor()
- = webCore.setBackgroundColor(if (isMain) Color.TRANSPARENT else Prefs.bgColor.withAlpha(255))
+ private fun injectBackgroundColor() {
+ webCore.setBackgroundColor(
+ when {
+ isMain -> Color.TRANSPARENT
+ webCore.url.isFacebookUrl -> Prefs.bgColor.withAlpha(255)
+ else -> Color.WHITE
+ }
+ )
+ }
override fun onPageCommitVisible(view: WebView, url: String?) {