# cordova-plugin-android-theme-detection

> Cordova plugin for detect theme on Android

Latest version **2.0.2** (published 2019-11-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-android-theme-detection
pnpm add cordova-plugin-android-theme-detection
yarn add cordova-plugin-android-theme-detection
bun add cordova-plugin-android-theme-detection
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2019-11-08 |
| First published | 2019-11-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Valerii Psol |
| Maintainers | arel0ve |
| Keywords | ecosystem:cordova, cordova-android, theme-detection, android-theme, android-mode |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-android-theme-detection
- Repository: https://github.com/arel0ve/cordova-plugin-android-theme-detection
- Homepage: https://github.com/arel0ve/cordova-plugin-android-theme-detection#readme
- Issues: https://github.com/arel0ve/cordova-plugin-android-theme-detection/issues
- npm.io page: https://npm.io/package/cordova-plugin-android-theme-detection

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2019-11-08
- 2.0.1 — 2019-11-08
- 2.0.0 — 2019-11-08
- 1.0.5 — 2019-11-01
- 1.0.4 — 2019-11-01
- 1.0.3 — 2019-11-01
- 1.0.2 — 2019-11-01
- 1.0.1 — 2019-11-01
- 1.0.0 — 2019-11-01

## README

# Cordova plugin for theme detection

ATTENTION:
FIRST RELEASE VERSION IS 2.0.2, DON'T USE LOWER VERSIONS

## Description

Cordova plugin for detect dark mode on Android.

For using dark mode you should have at least Android 9 (Pie).

## Installation

Add the plugin with the following command:

`cordova plugin add cordova-plugin-android-theme-detection`

## Usage

```js
cordova.plugins.ThemeDetection.isDarkMode
  (res) => {
    console.log(res);
  },
  (error) => {
    console.log(error);
  }
);
```

### Methods

#### isDarkMode

`cordova.plugins.ThemeDetection.isDarkMode()`

Checks if the dark mode is enabled on device and returns an object with a boolean value and a message.

### Responses

**ThemeDetectionResponse**:

```js
ThemeDetectionResponse {
    value: boolean;
    message: string;
}
```

**ThemeDetectionResponse Examples**:

```js
ThemeDetectionResponse {
    value: true;
    message: 'Dark mode';
}
```

```js
ThemeDetectionResponse {
    value: false;
    message: 'Light mode';
}
```

```js
ThemeDetectionResponse {
    value: false;
    message: 'Theme detection is not available. You need at least SDK = 28, but you have installed SDK = <YOUR_SYSTEM_SDK>';
}
```

## Changelog

- 2.0.2: First release.
- 2.0.1: First trying release.
- 2.0.0: Re-created plugin with plugman.
- 1.0.5: Fixed @Override.
- 1.0.4: Fixed class name.
- 1.0.3: Fixed class name.
- 1.0.2: Fixed Android Min SDK.
- 1.0.1: Add to github.
- 1.0.0: Initial version.

---
_Source: https://npm.io/package/cordova-plugin-android-theme-detection · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
