diff options
author | Allan Wang <me@allanwang.ca> | 2017-05-29 19:47:52 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-05-29 19:47:52 -0700 |
commit | 461425eb6054f18cea1990a4117fe8c78e888ddf (patch) | |
tree | 98c8d84cfb231479cf88c3cc413b7c4a8366e42b /app/src/main/kotlin/com/pitchedapps/frost/views | |
parent | e33120d454aeb72acc2c1315bddea31dd2f15bb2 (diff) | |
download | frost-461425eb6054f18cea1990a4117fe8c78e888ddf.tar.gz frost-461425eb6054f18cea1990a4117fe8c78e888ddf.tar.bz2 frost-461425eb6054f18cea1990a4117fe8c78e888ddf.zip |
Add icon tabs and webview observables
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/views')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt | 6 |
1 files changed, 4 insertions, 2 deletions
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<WebStatus> { 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<WebStatus> + override val observable: Subject<WebStatus> 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?) { |