diff options
author | Allan Wang <me@allanwang.ca> | 2021-09-25 15:55:07 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-09-25 15:55:07 -0700 |
commit | 8db1930d7623ba071123f5978153679da7161278 (patch) | |
tree | 5ce5894c321fae7f0a2f5a9ab65c3dca031db724 /app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt | |
parent | 1ac15f84b05e83d3c3482cf1498c74123852d658 (diff) | |
download | frost-8db1930d7623ba071123f5978153679da7161278.tar.gz frost-8db1930d7623ba071123f5978153679da7161278.tar.bz2 frost-8db1930d7623ba071123f5978153679da7161278.zip |
Create hilt web file chooser implementation
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt index ec012ed5..695e1226 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt @@ -29,6 +29,7 @@ import ca.allanwang.kau.utils.launchMain import com.pitchedapps.frost.contracts.FrostContentContainer import com.pitchedapps.frost.contracts.FrostContentCore import com.pitchedapps.frost.contracts.FrostContentParent +import com.pitchedapps.frost.contracts.WebFileChooser import com.pitchedapps.frost.db.CookieDao import com.pitchedapps.frost.db.currentCookie import com.pitchedapps.frost.facebook.FB_HOME_URL @@ -70,6 +71,9 @@ class FrostWebView @JvmOverloads constructor( lateinit var themeProvider: ThemeProvider @Inject + lateinit var webFileChooser: WebFileChooser + + @Inject lateinit var cookieDao: CookieDao override fun reload(animate: Boolean) { @@ -98,7 +102,7 @@ class FrostWebView @JvmOverloads constructor( // attempt to get custom client; otherwise fallback to original frostWebClient = (container as? WebFragment)?.client(this) ?: FrostWebViewClient(this) webViewClient = frostWebClient - webChromeClient = FrostChromeClient(this, themeProvider) + webChromeClient = FrostChromeClient(this, themeProvider, webFileChooser) addJavascriptInterface(FrostJSI(this), "Frost") setBackgroundColor(Color.TRANSPARENT) setDownloadListener { url, userAgent, contentDisposition, mimetype, contentLength -> |