Algorithmic darkening requires WebView 102.*

This commit is contained in:
M66B
2022-06-15 18:10:01 +02:00
parent 251695fb5d
commit eb5f72e466
7 changed files with 34 additions and 30 deletions

View File

@@ -79,11 +79,11 @@ public class FragmentDialogOpenFull extends FragmentDialogBase {
settings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
if (WebViewEx.isFeatureSupported(WebViewFeature.SAFE_BROWSING_ENABLE))
if (WebViewEx.isFeatureSupported(context, WebViewFeature.SAFE_BROWSING_ENABLE))
WebSettingsCompat.setSafeBrowsingEnabled(settings, safe_browsing);
boolean dark = (Helper.isDarkTheme(context) && !force_light);
boolean canDarken = WebViewEx.isFeatureSupported(WebViewFeature.ALGORITHMIC_DARKENING);
boolean canDarken = WebViewEx.isFeatureSupported(context, WebViewFeature.ALGORITHMIC_DARKENING);
if (canDarken)
WebSettingsCompat.setAlgorithmicDarkeningAllowed(settings, dark);