{"id":4161,"url":"https://github.com/kwaak/react-native-android-blurryoverlay","last_synced_at":"2025-08-04T00:32:26.726Z","repository":{"id":57335204,"uuid":"46949591","full_name":"kwaak/react-native-android-blurryoverlay","owner":"kwaak","description":"A react native android package to show a blurry overlay.","archived":false,"fork":false,"pushed_at":"2016-01-24T14:43:15.000Z","size":2093,"stargazers_count":75,"open_issues_count":3,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-17T07:22:14.158Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/kwaak.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":"2015-11-26T22:40:47.000Z","updated_at":"2023-03-09T02:15:52.000Z","dependencies_parsed_at":"2022-08-24T21:40:55.885Z","dependency_job_id":null,"html_url":"https://github.com/kwaak/react-native-android-blurryoverlay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwaak%2Freact-native-android-blurryoverlay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwaak%2Freact-native-android-blurryoverlay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwaak%2Freact-native-android-blurryoverlay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwaak%2Freact-native-android-blurryoverlay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kwaak","download_url":"https://codeload.github.com/kwaak/react-native-android-blurryoverlay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228576898,"owners_count":17939645,"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":[],"created_at":"2024-01-05T20:17:02.969Z","updated_at":"2024-12-07T07:31:29.412Z","avatar_url":"https://github.com/kwaak.png","language":"Java","funding_links":[],"categories":["Components","Others"],"sub_categories":["UI"],"readme":"# Blurry overlay for react-native android\n\n[![npm](https://img.shields.io/npm/v/react-native-android-blurryoverlay.svg)](https://www.npmjs.com/package/react-native-android-blurryoverlay)\n\n# This is very experimental\n\nA react native android module to add a blurry overlay.\n\n![Example](Example/Example.gif?raw=true \"Example\")\n\n## Setup\n\n* install module\n\n```bash\n npm i --save react-native-android-blurryoverlay\n```\n\n* `android/settings.gradle`\n\n```gradle\n...\ninclude ':react-native-android-blurryoverlay'\nproject(':react-native-android-blurryoverlay').projectDir = new File(settingsDir, '../node_modules/react-native-android-blurryoverlay')\n```\n\n* `android/app/build.gradle`\n\n```gradle\n...\nandroid {\n    ...\n    defaultConfig {\n        ...        \n        renderscriptTargetApi 23\n        renderscriptSupportModeEnabled true\n    }    \n    ...\n}\n...\ndependencies {\n    ...\n    compile project(':react-native-android-blurryoverlay')\n}\n```\n\n* register module (in MainActivity.java)\n\n```java\nimport com.kwaak.react.BlurryOverlayPackage;  // \u003c--- import\n\npublic class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {\n\n  ......\n  private static Activity mActivity = null;\n\n  @Override\n  protected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    mReactRootView = new ReactRootView(this);\n\n    mActivity = this;\n    mReactInstanceManager = ReactInstanceManager.builder()\n      .setApplication(getApplication())\n      .setBundleAssetName(\"index.android.bundle\")\n      .setJSMainModuleName(\"index.android\")\n      .addPackage(new MainReactPackage())\n      .addPackage(new BlurryOverlayPackage(this))      // \u003c------- add package, the 'this' is super important\n      .setUseDeveloperSupport(BuildConfig.DEBUG)\n      .setInitialLifecycleState(LifecycleState.RESUMED)\n      .build();\n\n    mReactRootView.startReactApplication(mReactInstanceManager, \"ExampleRN\", null);\n\n    setContentView(mReactRootView);\n  }\n\n  ......\n\n}\n```\n\n## Usage\n\nThe Android root view will be 'screenshotted' and rendered blurry in the \u003cBlurryOverlay\u003e view.\n\n```js\n/**\n * Sample React Native App\n * https://github.com/facebook/react-native\n */\n'use strict';\nimport React, {\n  AppRegistry,\n  Component,\n  StyleSheet,\n  Text,\n  View,\n  Image\n} from 'react-native';\n\nvar BlurryOverlay = require('react-native-android-blurryoverlay');\n\nclass BlurryTest extends Component {\n  constructor() {\n    super();\n    this.state = {\n      renderBlurry: false\n    }\n  }\n  componentDidMount() {\n    setTimeout(() =\u003e {\n      this.setState({ renderBlurry: true })\n    });\n  }\n  render() {\n    var overlay = (this.state.renderBlurry) ? \u003cBlurryOverlay \n    radius={7} sampling={6} color=\"#00FFFF00\"\n    style={[{ \n      position: \"absolute\", \n      left: 0, \n      top: 0, \n      bottom: 0, \n      right: 0 \n    }]}  /\u003e : \u003cView /\u003e;\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cImage\n          source={require('./bg.jpg')}\n        /\u003e\n        \u003cText style={styles.welcome}\u003e\n          Welcome to React Native!\n        \u003c/Text\u003e\n        \u003cText style={styles.instructions}\u003e\n          To get started, edit index.android.js\n        \u003c/Text\u003e\n        \u003cText style={styles.instructions}\u003e\n          Shake or press menu button for dev menu\n        \u003c/Text\u003e\n        {overlay}\n      \u003c/View\u003e\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n  },\n  welcome: {\n    fontSize: 20,\n    textAlign: 'center',\n    margin: 10,\n  },\n  instructions: {\n    textAlign: 'center',\n    color: '#333333',\n    marginBottom: 5,\n  },\n});\n\nAppRegistry.registerComponent('BlurryTest', () =\u003e BlurryTest);\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwaak%2Freact-native-android-blurryoverlay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwaak%2Freact-native-android-blurryoverlay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwaak%2Freact-native-android-blurryoverlay/lists"}