forceDarkStrategy property
- @Deprecated('Use algorithmicDarkeningAllowed instead')
getter/setter pair
Use algorithmicDarkeningAllowed instead.
Set how WebView content should be darkened. The default value is ForceDarkStrategy.PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING.
Deprecated - The "force dark" model previously implemented by WebView was complex and didn't
interoperate well with current Web standards for prefers-color-scheme and color-scheme.
In apps with targetSdkVersion ≥ android.os.Build.VERSION_CODES.TIRAMISU this API is a no-op and
WebView will always use the dark style defined by web content authors if the app's theme is dark.
To customize the behavior, refer to algorithmicDarkeningAllowed.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebSettingsCompat.setForceDarkStrategy):
- it will take effect only if WebViewFeature.isFeatureSupported returns
truefor WebViewFeature.FORCE_DARK_STRATEGY.
- it will take effect only if WebViewFeature.isFeatureSupported returns
Implementation
@Deprecated('Use algorithmicDarkeningAllowed instead')
ForceDarkStrategy? forceDarkStrategy;