Merge pull request #2648 from dkanada/patch-1

store cache for WidgetWebView between loads
This commit is contained in:
Benoit Marty 2021-08-23 16:16:19 +02:00 committed by GitHub
commit 25cb78ba50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 7 deletions

View File

@ -21,7 +21,6 @@ import android.view.ViewGroup
import android.webkit.CookieManager import android.webkit.CookieManager
import android.webkit.PermissionRequest import android.webkit.PermissionRequest
import android.webkit.WebChromeClient import android.webkit.WebChromeClient
import android.webkit.WebSettings
import android.webkit.WebView import android.webkit.WebView
import im.vector.app.R import im.vector.app.R
import im.vector.app.features.themes.ThemeUtils import im.vector.app.features.themes.ThemeUtils
@ -36,10 +35,6 @@ fun WebView.setupForWidget(webViewEventListener: WebViewEventListener) {
// clear caches // clear caches
clearHistory() clearHistory()
clearFormData() clearFormData()
clearCache(true)
// does not cache the data
settings.cacheMode = WebSettings.LOAD_NO_CACHE
// Enable Javascript // Enable Javascript
settings.javaScriptEnabled = true settings.javaScriptEnabled = true
@ -78,8 +73,6 @@ fun WebView.clearAfterWidget() {
(parent as? ViewGroup)?.removeAllViews() (parent as? ViewGroup)?.removeAllViews()
webChromeClient = null webChromeClient = null
clearHistory() 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. // Loading a blank page is optional, but will ensure that the WebView isn't doing anything when you destroy it.
loadUrl("about:blank") loadUrl("about:blank")
removeAllViews() removeAllViews()