Expose properties as constants and make case consistent with StatusBarIOS

This commit is contained in:
Andrew McCloud 2015-04-30 00:10:21 -07:00
parent 30a47427e1
commit 5b157fb0e8
2 changed files with 30 additions and 12 deletions

View File

@ -24,6 +24,24 @@ var Camera = React.createClass({
validAttributes: ReactIOSViewAttributes.UIView
},
Aspect: {
stretch: NativeModules.CameraManager.Aspect.stretch,
fit: NativeModules.CameraManager.Aspect.fit,
fill: NativeModules.CameraManager.Aspect.fill
},
Camera: {
front: NativeModules.CameraManager.Camera.front,
back: NativeModules.CameraManager.Camera.back
},
Orientation: {
landscapeLeft: NativeModules.CameraManager.Orientation.landscapeLeft,
landscapeRight: NativeModules.CameraManager.Orientation.landscapeRight,
portrait: NativeModules.CameraManager.Orientation.portrait,
portraitUpsideDown: NativeModules.CameraManager.Orientation.portraitUpsideDown
},
getInitialState: function() {
return {
isAuthorized: false,

View File

@ -24,20 +24,20 @@ RCT_EXPORT_VIEW_PROPERTY(orientation, NSInteger);
- (NSDictionary *)constantsToExport
{
return @{
@"aspects": @{
@"Stretch": AVLayerVideoGravityResize,
@"Fit": AVLayerVideoGravityResizeAspect,
@"Fill": AVLayerVideoGravityResizeAspectFill
@"Aspect": @{
@"stretch": AVLayerVideoGravityResize,
@"fit": AVLayerVideoGravityResizeAspect,
@"fill": AVLayerVideoGravityResizeAspectFill
},
@"cameras": @{
@"Front": @(AVCaptureDevicePositionFront),
@"Back": @(AVCaptureDevicePositionBack)
@"Camera": @{
@"front": @(AVCaptureDevicePositionFront),
@"back": @(AVCaptureDevicePositionBack)
},
@"orientations": @{
@"LandscapeLeft": @(AVCaptureVideoOrientationLandscapeLeft),
@"LandscapeRight": @(AVCaptureVideoOrientationLandscapeRight),
@"Portrait": @(AVCaptureVideoOrientationPortrait),
@"PortraitUpsideDown": @(AVCaptureVideoOrientationPortraitUpsideDown)
@"Orientation": @{
@"landscapeLeft": @(AVCaptureVideoOrientationLandscapeLeft),
@"landscapeRight": @(AVCaptureVideoOrientationLandscapeRight),
@"portrait": @(AVCaptureVideoOrientationPortrait),
@"portraitUpsideDown": @(AVCaptureVideoOrientationPortraitUpsideDown)
}
};
}