From 8db1930d7623ba071123f5978153679da7161278 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 25 Sep 2021 15:55:07 -0700 Subject: Create hilt web file chooser implementation --- app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/views') 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 @@ -69,6 +70,9 @@ class FrostWebView @JvmOverloads constructor( @Inject lateinit var themeProvider: ThemeProvider + @Inject + lateinit var webFileChooser: WebFileChooser + @Inject lateinit var cookieDao: CookieDao @@ -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 -> -- cgit v1.2.3