aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-04 00:19:58 -0700
committerAllan Wang <me@allanwang.ca>2017-06-04 00:19:58 -0700
commit6fa685433e23ce56286c3fbcae9cf1ef7a1a6e68 (patch)
treeba67706c64882f471a2f560503e1c936c615b957 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
parent771fcb54fd3902d17f6cbad39217be3edbffa114 (diff)
downloadfrost-6fa685433e23ce56286c3fbcae9cf1ef7a1a6e68.tar.gz
frost-6fa685433e23ce56286c3fbcae9cf1ef7a1a6e68.tar.bz2
frost-6fa685433e23ce56286c3fbcae9cf1ef7a1a6e68.zip
Fix log webview and use leak canary
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
index 5c1aa5b1..fb5fd0e7 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
@@ -15,11 +15,12 @@ import com.pitchedapps.frost.utils.Prefs
import com.pitchedapps.frost.utils.launchNewTask
import com.pitchedapps.frost.views.circularReveal
import com.pitchedapps.frost.views.fadeOut
+import io.reactivex.subjects.Subject
/**
* Created by Allan Wang on 2017-05-31.
*/
-class FrostWebViewClient(val position: () -> Int) : WebViewClient() {
+class FrostWebViewClient(val refreshObservable: Subject<Boolean>) : WebViewClient() {
companion object {
//Collections of jewels mapped with url match -> id
@@ -33,6 +34,7 @@ class FrostWebViewClient(val position: () -> Int) : WebViewClient() {
override fun onPageStarted(view: WebView, url: String, favicon: Bitmap?) {
super.onPageStarted(view, url, favicon)
L.i("FWV Loading $url")
+ refreshObservable.onNext(true)
if (!url.contains(FACEBOOK_COM)) return
if (url.contains("logout.php")) {
FbCookie.logout(Prefs.userId)
@@ -46,6 +48,7 @@ class FrostWebViewClient(val position: () -> Int) : WebViewClient() {
override fun onPageFinished(view: WebView, url: String) {
super.onPageFinished(view, url)
+ refreshObservable.onNext(false)
if (!url.contains(FACEBOOK_COM)) return
CssAssets.HEADER.inject(view, {
view.circularReveal(offset = 150L)