RxJava2 binding APIs for Android WebView with Kotlin.
implementation "com.github.satoshun.RxWebView:rxwebview:${latest-version}"
If you want a all events from WebViewClient,
we can use a RxWebViewClient#events
method.
val webview = WebView(context)
webview.events().subscribe() // emits all WebView eventss
If you want a specific event like a onPageFinished
,
we can use a RxWebViewClient#events
+ ofType
operator.
val webview = WebView(context)
webView.events()
.ofType(OnPageFinished::class.java) // only OnPageFinished
.subscribe()
If you want to a hook events from WebViewClient
, we can give a custom WebViewClient.
webview.events(delegate = CustomWebViewClient()).subscribe()
All data type defined in this.
If you want a all events from WebChromeClient.
val webview = WebView(context)
webview.chromeEvents().subscribe()
If you want to a hook events from WebChromeClient
, we can give a custom WebChromeClient.
webview.chromeEvents(delegate = customWebChromeClient).subscribe()
All data type defined in this
This project inspired by RxBinding. It was very helpful. thx!