diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-06 00:43:57 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-06 00:43:57 -0700 |
commit | c4e22f5512570d05178711ba90c28eb6dc288253 (patch) | |
tree | 520e84e0956ba886620328642814d3126a852d5d /app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt | |
parent | 39a09a3ec1b62fe2c82bf1ad067515b1f974472b (diff) | |
download | frost-c4e22f5512570d05178711ba90c28eb6dc288253.tar.gz frost-c4e22f5512570d05178711ba90c28eb6dc288253.tar.bz2 frost-c4e22f5512570d05178711ba90c28eb6dc288253.zip |
Beautify accounts selector
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt index e8fb5a21..0542722f 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt @@ -11,6 +11,7 @@ import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.putString import com.pitchedapps.frost.web.FrostWebView import com.pitchedapps.frost.web.FrostWebViewCore +import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.Disposable /** @@ -18,14 +19,14 @@ import io.reactivex.disposables.Disposable */ -class WebFragment:Fragment() { +class WebFragment : Fragment() { companion object { private const val ARG_URL = "arg_url" fun newInstance(url: String) = WebFragment().putString(ARG_URL, url) } -// val refresh: SwipeRefreshLayout by lazy { frostWebView.refresh } + // val refresh: SwipeRefreshLayout by lazy { frostWebView.refresh } val web: FrostWebViewCore by lazy { frostWebView.web } lateinit var url: String lateinit private var frostWebView: FrostWebView @@ -65,8 +66,9 @@ class WebFragment:Fragment() { super.onAttach(context) refreshDisposable?.dispose() if (context is MainActivity) - refreshDisposable = context.refreshObservable.subscribe { - web.clearHistory() + refreshDisposable = context.refreshObservable.observeOn(AndroidSchedulers.mainThread()).subscribe { + clearHistory -> + if (clearHistory) web.clearHistory() web.loadBaseUrl() } } |