diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-13 00:42:31 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-13 00:42:31 -0700 |
commit | e4377fed20ce1e3f4a0b236271eecdb1fe573b7a (patch) | |
tree | aa0b14e328daa4ece41f65cfed5a4422f2c9e898 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt | |
parent | a7a37f8f5b1955f006a83d4713a2c6af500c28af (diff) | |
download | frost-e4377fed20ce1e3f4a0b236271eecdb1fe573b7a.tar.gz frost-e4377fed20ce1e3f4a0b236271eecdb1fe573b7a.tar.bz2 frost-e4377fed20ce1e3f4a0b236271eecdb1fe573b7a.zip |
Created js base for facebook menu
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt index 1d3f348a..f0596f7c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt @@ -12,6 +12,7 @@ import android.view.View import android.view.animation.DecelerateInterpolator import android.webkit.WebView import com.pitchedapps.frost.facebook.USER_AGENT_BASIC +import com.pitchedapps.frost.injectors.JsAssets import io.reactivex.Scheduler import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.Disposable @@ -38,6 +39,7 @@ class FrostWebViewCore @JvmOverloads constructor( val titleObservable: BehaviorSubject<String> // Only emits on different non http titles var baseUrl: String? = null + var baseJavascript: JsAssets? = null init { isNestedScrollingEnabled = true @@ -53,8 +55,8 @@ class FrostWebViewCore @JvmOverloads constructor( settings.userAgentString = USER_AGENT_BASIC // settings.domStorageEnabled = true setLayerType(View.LAYER_TYPE_HARDWARE, null) - setWebViewClient(FrostWebViewClient(refreshObservable)) - setWebChromeClient(FrostChromeClient(progressObservable, titleObservable)) + webViewClient = FrostWebViewClient(refreshObservable) + webChromeClient = FrostChromeClient(progressObservable, titleObservable) addJavascriptInterface(FrostJSI(context), "Frost") } @@ -63,7 +65,9 @@ class FrostWebViewCore @JvmOverloads constructor( super.loadUrl(url) } - fun loadBaseUrl() = loadUrl(baseUrl) + fun loadBaseUrl() { + loadUrl(baseUrl) + } fun addTitleListener(subscriber: (title: String) -> Unit, scheduler: Scheduler = AndroidSchedulers.mainThread()): Disposable = titleObservable.observeOn(scheduler).subscribe(subscriber) |