react-native-camera-metrics

1.0.6 • Public • Published

react-native-camera-metrics

Getting started

$ npm install react-native-camera-metrics --save

Mostly automatic installation

$ react-native link react-native-camera-metrics

Manual installation

Android

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

Available Constants

FOCAL_LENGTH
SENSOR_HEIGHT
SENSOR_WIDTH
DISPLAY_METRICS_Density
DISPLAY_METRICS_DensityDPI
DISPLAY_METRICS_HeightPixels
DISPLAY_METRICS_WidthPixels
DISPLAY_METRICS_ScaledDensity
DISPLAY_METRICS_Xdpi
DISPLAY_METRICS_Ydpi

Usage

import RNCameraMetrics from 'react-native-camera-metrics';

// TODO: What to do with the module?
<Text>
  ....
  {RNCameraMetrics.FOCAL_LENGTH}
  {RNCameraMetrics.DISPLAY_METRICS_Density}
  .....
<Text>

Package Sidebar

Install

npm i react-native-camera-metrics

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

36 kB

Total Files

21

Last publish

Collaborators

  • ankushyadav07