Is your feature request related to a problem? Please describe:
As stated in readme, Capacitor v4 supports dark mode on Android - however it doesn't work for WebView versions lower than ~ v100.
At the same time, Capacitor v4 supports Android WebView 60+
Describe the solution you'd like:
- Un-depreacate plugin
- Add Capacitor v4 compatibility (constant has changed in androidx.webkit 1.3)
src/main/java/dev/robingenz/capacitor/androiddarkmodesupport.java
if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK_STRATEGY)) {
- WebSettingsCompat.setForceDarkStrategy(settings, WebSettingsCompat.WEB_THEME_DARKENING_ONLY);
+ WebSettingsCompat.setForceDarkStrategy(settings, WebSettingsCompat.DARK_STRATEGY_WEB_THEME_DARKENING_ONLY);
}
- Add note that plugin is required for older WebView versions
Describe alternatives you've considered:
I've tried @aparajita/capacitor-dark-mode however it's not a straight forward drop-in solution as this plugin is
Additional context:
Some of related issues:
Is your feature request related to a problem? Please describe:
As stated in readme, Capacitor v4 supports dark mode on Android - however it doesn't work for WebView versions lower than ~ v100.
At the same time, Capacitor v4 supports Android WebView 60+
Describe the solution you'd like:
src/main/java/dev/robingenz/capacitor/androiddarkmodesupport.java if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK_STRATEGY)) { - WebSettingsCompat.setForceDarkStrategy(settings, WebSettingsCompat.WEB_THEME_DARKENING_ONLY); + WebSettingsCompat.setForceDarkStrategy(settings, WebSettingsCompat.DARK_STRATEGY_WEB_THEME_DARKENING_ONLY); }Describe alternatives you've considered:
I've tried @aparajita/capacitor-dark-mode however it's not a straight forward drop-in solution as this plugin is
Additional context:
Some of related issues: