Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store cache for WidgetWebView between loads #2648

Merged
merged 4 commits into from
Aug 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import android.view.ViewGroup
import android.webkit.CookieManager
import android.webkit.PermissionRequest
import android.webkit.WebChromeClient
import android.webkit.WebSettings
import android.webkit.WebView
import im.vector.app.R
import im.vector.app.features.themes.ThemeUtils
Expand All @@ -36,10 +35,6 @@ fun WebView.setupForWidget(webViewEventListener: WebViewEventListener) {
// clear caches
clearHistory()
clearFormData()
clearCache(true)

// does not cache the data
settings.cacheMode = WebSettings.LOAD_NO_CACHE

// Enable Javascript
settings.javaScriptEnabled = true
Expand Down Expand Up @@ -78,8 +73,6 @@ fun WebView.clearAfterWidget() {
(parent as? ViewGroup)?.removeAllViews()
webChromeClient = null
clearHistory()
// NOTE: clears RAM cache, if you pass true, it will also clear the disk cache.
clearCache(true)
// Loading a blank page is optional, but will ensure that the WebView isn't doing anything when you destroy it.
loadUrl("about:blank")
removeAllViews()
Expand Down