From 461425eb6054f18cea1990a4117fe8c78e888ddf Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 29 May 2017 19:47:52 -0700 Subject: Add icon tabs and webview observables --- app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/views') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt index e7314c20..62115276 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt @@ -15,6 +15,7 @@ import android.webkit.WebResourceRequest import android.webkit.WebView import android.webkit.WebViewClient import com.pitchedapps.frost.utils.L +import com.pitchedapps.frost.utils.ObservableContainer import io.reactivex.subjects.BehaviorSubject import io.reactivex.subjects.Subject @@ -31,14 +32,14 @@ enum class WebStatus { */ class FrostWebView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : WebView(context, attrs, defStyleAttr), NestedScrollingChild { +) : WebView(context, attrs, defStyleAttr), NestedScrollingChild, ObservableContainer { private val childHelper = NestedScrollingChildHelper(this) private var lastY: Int = 0 private val scrollOffset = IntArray(2) private val scrollConsumed = IntArray(2) private var nestedOffsetY: Int = 0 - val observable: Subject + override val observable: Subject init { isNestedScrollingEnabled = true @@ -60,6 +61,7 @@ class FrostWebView @JvmOverloads constructor( override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) { super.onPageStarted(view, url, favicon) observable.onNext(WebStatus.LOADING) + L.d("Loading $url") } override fun onPageFinished(view: WebView?, url: String?) { -- cgit v1.2.3