aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2021-04-18 18:30:03 -0700
committerGitHub <noreply@github.com>2021-04-18 18:30:03 -0700
commitbf55dbf9b46cd8826987ee6e556307e24f3d46cc (patch)
treeaaca512641e6e4503859c4cb97a29a9296669f9d /app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt
parent88a5d17814ff9f7c44f79216510d405f057ae454 (diff)
parent997362de5aab00f8d258b6fe8a058a8b3e018694 (diff)
downloadfrost-bf55dbf9b46cd8826987ee6e556307e24f3d46cc.tar.gz
frost-bf55dbf9b46cd8826987ee6e556307e24f3d46cc.tar.bz2
frost-bf55dbf9b46cd8826987ee6e556307e24f3d46cc.zip
Merge pull request #1770 from AllanWang/hilt
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.kt8
1 files changed, 6 insertions, 2 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 43b7071e..e687dd2d 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt
@@ -32,6 +32,7 @@ import com.afollestad.materialdialogs.callbacks.onDismiss
import com.afollestad.materialdialogs.input.input
import com.pitchedapps.frost.R
import com.pitchedapps.frost.contracts.ActivityContract
+import com.pitchedapps.frost.injectors.ThemeProvider
import com.pitchedapps.frost.utils.L
import com.pitchedapps.frost.utils.frostSnackbar
import com.pitchedapps.frost.views.FrostWebView
@@ -46,7 +47,10 @@ import kotlinx.coroutines.channels.SendChannel
/**
* The default chrome client
*/
-class FrostChromeClient(web: FrostWebView) : WebChromeClient() {
+class FrostChromeClient(
+ web: FrostWebView,
+ private val themeProvider: ThemeProvider
+) : WebChromeClient() {
private val refresh: SendChannel<Boolean> = web.parent.refreshChannel
private val progress: SendChannel<Int> = web.parent.progressChannel
@@ -80,7 +84,7 @@ class FrostChromeClient(web: FrostWebView) : WebChromeClient() {
fileChooserParams: FileChooserParams
): Boolean {
activity?.openFileChooser(filePathCallback, fileChooserParams)
- ?: webView.frostSnackbar(R.string.file_chooser_not_found)
+ ?: webView.frostSnackbar(R.string.file_chooser_not_found, themeProvider)
return activity != null
}