https://github.com/mcnaveen/android-webview-darkmode-with-javascript
This POC is implemented to explain how dark mode js can be used inside Android Webview Component
https://github.com/mcnaveen/android-webview-darkmode-with-javascript
android androidwebview dark-theme darkmode java webview-app webviewdemo
Last synced: 10 months ago
JSON representation
This POC is implemented to explain how dark mode js can be used inside Android Webview Component
- Host: GitHub
- URL: https://github.com/mcnaveen/android-webview-darkmode-with-javascript
- Owner: mcnaveen
- Created: 2021-03-10T19:36:25.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-11T13:19:28.000Z (almost 5 years ago)
- Last Synced: 2025-03-27T08:22:11.419Z (11 months ago)
- Topics: android, androidwebview, dark-theme, darkmode, java, webview-app, webviewdemo
- Language: Java
- Homepage:
- Size: 2.15 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
## 🌓 Dark Mode Switch inside Android Webview

This POC is implemented to explain how dark mode js can be used inside Android Webview Component [using DOMStorage API](https://github.com/mcnaveen/Android-Webview-Darkmode-with-JavaScript/blob/71b8714c31039dc2e02ba443bcfd996a4b6b1f0e/app/src/main/java/github/mcnaveen/webviewDarkMode/MainActivity.java#L34)
## 🦄 Resources Used
- Android Webview
- [Coliff's Dark Mode Switch JS](https://github.com/coliff/dark-mode-switch)
- [Demo Page of Coliff's Dark Mode Switch](https://coliff.github.io/dark-mode-switch/)
## 🏃 Test yourself
- [Download the APK from the Releases Tab](https://github.com/mcnaveen/Android-Webview-Darkmode-with-JavaScript/releases/)
### ⚠️ Warning
This App uses the Deprecated API `webSetting.setDomStorageEnabled(true);`. But this is the only possible working solution. Even though it's deprecated it can be safely used.
## License
- MIT