{"id":13777373,"url":"https://github.com/rupliva/react-native-dimmer","last_synced_at":"2025-05-11T11:33:25.541Z","repository":{"id":57150801,"uuid":"49347758","full_name":"rupliva/react-native-dimmer","owner":"rupliva","description":"React Native Module","archived":true,"fork":false,"pushed_at":"2021-09-07T11:27:12.000Z","size":10,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-13T19:29:30.898Z","etag":null,"topics":["android","ios","react-native"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"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/rupliva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-10T00:47:30.000Z","updated_at":"2023-12-26T17:26:10.000Z","dependencies_parsed_at":"2022-08-31T23:50:49.320Z","dependency_job_id":null,"html_url":"https://github.com/rupliva/react-native-dimmer","commit_stats":null,"previous_names":["yadi-social/react-native-dimmer"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupliva%2Freact-native-dimmer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupliva%2Freact-native-dimmer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupliva%2Freact-native-dimmer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupliva%2Freact-native-dimmer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rupliva","download_url":"https://codeload.github.com/rupliva/react-native-dimmer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224708951,"owners_count":17356521,"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","ios","react-native"],"created_at":"2024-08-03T18:00:42.326Z","updated_at":"2024-11-17T13:30:40.354Z","avatar_url":"https://github.com/rupliva.png","language":"Java","readme":"# react-native-dimmer\n\nA plugin that allows you to enable (eventually lock the device)\nand disable the screen dim in your React Native app.\nWorks in both iOS and Android.\n\n# ⚠️ Unmaintained ⚠️ \n\n[![github home](https://img.shields.io/badge/YADI%20Social-react--native--dimmer-green.svg?style=flat-square)](https://github.com/yadi-social/react-native-dimmer)\n[![github issues](https://img.shields.io/github/issues/yadi-social/react-native-dimmer.svg?style=flat-square)](https://github.com/yadi-social/react-native-dimmer/issues)\n[![npm version](https://img.shields.io/npm/v/react-native-dimmer.svg?style=flat-square)][npm-package]\n[![npm downloads](https://img.shields.io/npm/dm/react-native-dimmer.svg?style=flat-square)][npm-package]\n[![npm license](https://img.shields.io/npm/l/react-native-dimmer.svg?style=flat-square)][npm-package]\n\n-   [Installation](#installation)\n-   [Usage](#usage)\n-   [License](#license)\n\n---\n\n## Installation\n\n`$ npm install react-native-dimmer --save`\n\n### iOS\n\nIn the XCode's \"Project navigator\", right click on your project's\n\"Libraries\" folder ➜ `Add Files to \u003c...\u003e`.\nGo to `node_modules` ➜ `react-native-dimmer` ➜ select the contents\nof `ios` folder. Make sure `RNDimmer.m` is listed under \"Compile Sources\"\nin your project's \"Build Phases\" tab.\n\n### Android\n\nAdd `react-native-dimmer` to your `./android/settings.gradle` file as follows:\n\n```text\ninclude ':react-native-dimmer'\nproject(':react-native-dimmer').projectDir = new File(settingsDir, '../node_modules/react-native-dimmer/android')\n```\n\nInclude it as dependency in `./android/app/build.gradle` file:\n\n```text\ndependencies {\n    ...\n    compile project(':react-native-dimmer')\n}\n```\n\nFinally, you need to add the package within the `ReactInstanceManager` of your\nMainActivity (`./android/app/src/main/java/your/bundle/MainActivity.java`):\n\n```java\nimport social.yadi.rndimmer.ReactNativeDimmerPackage;  // \u003c---- import this one\n...\n@Override\nprotected List\u003cReactPackage\u003e getPackages() {\n    return Arrays.\u003cReactPackage\u003easList(\n        new MainReactPackage(),\n        new ReactNativeDimmerPackage(this)  // \u003c---- add this line\n    );\n}\n```\n\nAfter that, you will need to recompile\nyour project with `react-native run-android`.\n\n## Usage\n\n```js\nimport React, { Component } from 'react-native';\nimport RNDimmer from 'react-native-dimmer';\n...\nclass Application extends Component {\n    ...\n    componentWillMount() {\n        // Enable dimmer\n        this.applyDimmer();\n    }\n    componentWillUnmount() {\n        // Disable dimmer\n        this.applyDimmer( false );\n    }\n    async applyDimmer( disabled = true ) {\n        try {\n            await RNDimmer.set( disabled );\n            console.log( disabled ? 'Enabled' : 'Disabled' );\n        } catch ( e ) {\n            console.error( e );\n        }\n    }\n    ...\n}\n```\n\n## License\n\n[The MIT License](../master/LICENSE)\n\n[npm-package]: https://www.npmjs.com/package/react-native-dimmer\n","funding_links":[],"categories":["\u003ca name=\"OS-\u0026-System-\u0026-File-Manager:-Native-Modules\"\u003eOS, System \u0026 File Manager: Native Modules\u003c/a\u003e"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupliva%2Freact-native-dimmer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frupliva%2Freact-native-dimmer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupliva%2Freact-native-dimmer/lists"}