Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Un-deprecate plugin and make it Capacitor v4 compatible #10

Open
piotr-cz opened this issue Jan 8, 2023 · 0 comments · May be fixed by #11
Open

feat: Un-deprecate plugin and make it Capacitor v4 compatible #10

piotr-cz opened this issue Jan 8, 2023 · 0 comments · May be fixed by #11

Comments

@piotr-cz
Copy link

piotr-cz commented Jan 8, 2023

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant