diff options
author | Allan Wang <me@allanwang.ca> | 2021-11-23 18:29:05 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 18:29:05 -0800 |
commit | 120ad1520db9184ebfa00885066e06a9f976e5f6 (patch) | |
tree | 50835fa79cf15ff348be386c46cea0a05552ba74 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt | |
parent | e246b35323e27dd18fa48910e5ca95669b53f8b0 (diff) | |
parent | db646e23ce0047461e68be1af7021ce6171ac850 (diff) | |
download | frost-120ad1520db9184ebfa00885066e06a9f976e5f6.tar.gz frost-120ad1520db9184ebfa00885066e06a9f976e5f6.tar.bz2 frost-120ad1520db9184ebfa00885066e06a9f976e5f6.zip |
Merge pull request #1857 from AllanWang/flows
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt index 61a76e70..90345aa2 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt @@ -34,7 +34,6 @@ import com.pitchedapps.frost.contracts.WebFileChooser import com.pitchedapps.frost.injectors.ThemeProvider import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.views.FrostWebView -import kotlinx.coroutines.channels.SendChannel /** * Created by Allan Wang on 2017-05-31. @@ -51,9 +50,10 @@ class FrostChromeClient( private val webFileChooser: WebFileChooser, ) : WebChromeClient() { - private val refresh: SendChannel<Boolean> = web.parent.refreshChannel - private val progress: SendChannel<Int> = web.parent.progressChannel - private val title: SendChannel<String> = web.parent.titleChannel +// private val refresh: SendChannel<Boolean> = web.parent.refreshChannel + private val refreshEmit = web.parent.refreshEmit + private val progressEmit = web.parent.progressEmit + private val titleEmit = web.parent.titleEmit private val context = web.context!! override fun getDefaultVideoPoster(): Bitmap? = @@ -68,12 +68,12 @@ class FrostChromeClient( override fun onReceivedTitle(view: WebView, title: String) { super.onReceivedTitle(view, title) if (title.startsWith("http")) return - this.title.offer(title) + titleEmit(title) } override fun onProgressChanged(view: WebView, newProgress: Int) { super.onProgressChanged(view, newProgress) - progress.offer(newProgress) + progressEmit(newProgress) } override fun onShowFileChooser( @@ -87,8 +87,8 @@ class FrostChromeClient( private fun JsResult.frostCancel() { cancel() - refresh.offer(false) - progress.offer(100) + refreshEmit(false) + progressEmit(100) } override fun onJsAlert( |