{"id":15328935,"url":"https://github.com/timbru31/cordova-plugin-android-dark-mode-support","last_synced_at":"2025-04-15T02:53:27.868Z","repository":{"id":37861679,"uuid":"331662656","full_name":"timbru31/cordova-plugin-android-dark-mode-support","owner":"timbru31","description":"🌚/🌞 Apache Cordova plugin to enable proper dark mode support for Android WebView's","archived":false,"fork":false,"pushed_at":"2025-04-15T01:48:23.000Z","size":206,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T02:39:02.480Z","etag":null,"topics":["android","capacitor","capacitor-plugin","cordova","cordova-android","cordova-android-plugin","cordova-plugin","dark-mode","ionic","ionic-plugin","kotlin","phonegap","phonegap-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cordova-plugin-android-dark-mode-support","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timbru31.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["timbru31"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://paypal.me/timbru/"}},"created_at":"2021-01-21T15:03:09.000Z","updated_at":"2025-04-15T01:48:21.000Z","dependencies_parsed_at":"2023-09-25T10:23:23.969Z","dependency_job_id":"a44703c6-8704-4b5b-a784-5a2409e3ffcd","html_url":"https://github.com/timbru31/cordova-plugin-android-dark-mode-support","commit_stats":{"total_commits":62,"total_committers":5,"mean_commits":12.4,"dds":"0.20967741935483875","last_synced_commit":"4f8fef29c3b6d19f395f56c2bf219686efab9012"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbru31%2Fcordova-plugin-android-dark-mode-support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbru31%2Fcordova-plugin-android-dark-mode-support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbru31%2Fcordova-plugin-android-dark-mode-support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbru31%2Fcordova-plugin-android-dark-mode-support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timbru31","download_url":"https://codeload.github.com/timbru31/cordova-plugin-android-dark-mode-support/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248996953,"owners_count":21195785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","capacitor","capacitor-plugin","cordova","cordova-android","cordova-android-plugin","cordova-plugin","dark-mode","ionic","ionic-plugin","kotlin","phonegap","phonegap-plugin"],"created_at":"2024-10-01T09:45:42.819Z","updated_at":"2025-04-15T02:53:27.843Z","avatar_url":"https://github.com/timbru31.png","language":"Kotlin","funding_links":["https://github.com/sponsors/timbru31","https://paypal.me/timbru/"],"categories":[],"sub_categories":[],"readme":"# cordova-plugin-android-dark-mode-support\n\n[![Linting](https://github.com/timbru31/cordova-plugin-android-dark-mode-support/workflows/Linting/badge.svg)](https://github.com/timbru31/cordova-plugin-android-dark-mode-support/actions?query=workflow%3ALinting)\n[![npm audit](https://github.com/timbru31/cordova-plugin-android-dark-mode-support/workflows/Security/badge.svg)](https://github.com/timbru31/cordova-plugin-android-dark-mode-support/actions?query=workflow%3ASecurity)\n\n[![Known Vulnerabilities](https://snyk.io/test/github/timbru31/cordova-plugin-android-dark-mode-support/badge.svg)](https://snyk.io/test/github/timbru31/cordova-plugin-android-dark-mode-support)\n\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](https://commitizen.github.io/cz-cli/)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![npm](https://img.shields.io/npm/v/cordova-plugin-android-dark-mode-support.svg)](https://www.npmjs.com/package/cordova-plugin-android-dark-mode-support)\n\n#### Apache Cordova plugin to enable proper dark mode support for Android WebView's\n\n### Context/Background\n\nWhile Android supports a dark mode since API level 29 (Android 10), Android WebView's need explicit support for this.\nThis plugin changes the used Cordova WebView, no matter if the default from cordova-android or a custom one such as the cordova-plugin-ionic-webview to enable or disable the dark mode. This results in a correct usage of the `(prefers-color-scheme: dark)` media query.\n\nAdditionally, when the native configuration changes, it is re-evaluated whether the dark mode is currently active.\n\nUnder the hood, the `Configuration.UI_MODE_NIGHT_YES`, `WebSettingsCompat.setForceDark` and `WebSettingsCompat.setForceDarkStrategy` are used. You can read more here: https://developer.android.com/guide/webapps/dark-theme\n\n#### Attention for SDK \u003e= 33 / Android 13\n\nIn Android 13 (SDK 33) you do not this plugin anymore as the behavior was changed [again](https://developer.android.com/about/versions/13/behavior-changes-13). All you need to do is tweak the used theme by setting:\n```xml\n\u003cpreference name=\"AndroidPostSplashScreenTheme\" value=\"@style/Theme.AppCompat.DayNight.NoActionBar\" /\u003e\n```\n\n### Supported platforms\n\n-   **Android**\n\n#### Prerequisites/Warnings\n\nKotlin support is required. Due to the AndroidX support libraries used, only **cordova-android \u003e= 11.0.0** is supported.  \nYou need to enable Kotlin `config.xml` by setting `GradlePluginKotlinEnabled` to `true`.\n\n### Installation\n\n#### from npm (recommended)\n\n`$ cordova plugin add cordova-plugin-android-dark-mode-support`\n\n#### from git (unstable)\n\n`$ cordova plugin add https://github.com/timbru31/cordova-plugin-android-dark-mode-support.git`\n\n### Usage\n\nJust install the plugin. Initially it will check the dark mode settings of the device and update once a new configuration is received.  \nFor a instance a timed/schedule theme change can issue a new configuration.\n\n---\n\nBuilt by (c) Tim Brust and contributors. Released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimbru31%2Fcordova-plugin-android-dark-mode-support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimbru31%2Fcordova-plugin-android-dark-mode-support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimbru31%2Fcordova-plugin-android-dark-mode-support/lists"}