Skip to content

Commit

Permalink
Merge pull request #2648 from dkanada/patch-1
Browse files Browse the repository at this point in the history
store cache for WidgetWebView between loads
  • Loading branch information
bmarty authored Aug 23, 2021
2 parents 9fa862e + 1071797 commit 25cb78b
Showing 1 changed file with 0 additions and 7 deletions.
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

0 comments on commit 25cb78b

Please sign in to comment.