1.0.5 • Published 3 years ago

react-native-image-blur-applaunch v1.0.5

Weekly downloads
-
License
AppLaunch Pvt Ltd
Repository
-
Last release
3 years ago

react-native-image-blur

Getting started

$ npm install react-native-image-blur-applaunch --save

Mostly automatic installation

$ react-native-image-blur-applaunch

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-image-blur-applaunch and add RNImageBlur.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNImageBlur.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.applaunch.reactnative.RNImageBlurPackage; to the imports at the top of the file
  • Add new RNImageBlurPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-image-blur-applaunch'
    project(':react-native-image-blur-applaunch').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-image-blur-applaunch/android')
  2. Insert the following lines inside t he dependencies block in android/app/build.gradle:

       implementation project(':react-native-image-blur-applaunch')
    	```
  3. Add ImageBlurScreenActivity into your AndroidManifest.xml

      <activity android:name="com.applaunch.reactnative.ImageBlurScreenActivity"
      android:theme="@style/Base.Theme.AppCompat"/> <!

Usage

// Create js file and paste this code

import React from 'react'
import PropTypes from 'prop-types'
import { requireNativeComponent } from 'react-native'

class ImageBlurComponent extends React.Component {
  render() {
    return <RNImageBlur {...this.props} />
  }
}

ImageBlurComponent.propTypes = {
  url: PropTypes.string.isRequired
}

ImageBlurComponent.defaultProps = {
  resizeMode: 'contain',
}

var RNImageBlur = requireNativeComponent('RNImageBlur', ImageBlurComponent)

export default ImageBlurComponent

// After creating this file just import it and use it.

import ImageBlurComponent from '../../../NativeModules/ImageBlurComponent'

<ImageBlurComponent url ={'Image Uri'} />