Skip to content

Commit

Permalink
Merge branch 'master' into 0.58-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
grabbou committed Nov 22, 2018
2 parents a525941 + 8f283b9 commit 696bd89
Show file tree
Hide file tree
Showing 135 changed files with 2,517 additions and 1,209 deletions.
2 changes: 1 addition & 1 deletion .flowconfig
Expand Up @@ -101,4 +101,4 @@ untyped-import
untyped-type-import

[version]
^0.85.0
^0.86.0
2 changes: 1 addition & 1 deletion .flowconfig.android
Expand Up @@ -101,4 +101,4 @@ untyped-import
untyped-type-import

[version]
^0.85.0
^0.86.0
3 changes: 0 additions & 3 deletions Libraries/Animated/src/nodes/AnimatedInterpolation.js
Expand Up @@ -349,9 +349,6 @@ class AnimatedInterpolation extends AnimatedWithChildren {
__transformDataType(range: Array<any>) {
// Change the string array type to number array
// So we can reuse the same logic in iOS and Android platform
/* $FlowFixMe(>=0.70.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.70 was deployed. To see the error delete this
* comment and run Flow. */
return range.map(function(value) {
if (typeof value !== 'string') {
return value;
Expand Down
42 changes: 41 additions & 1 deletion Libraries/CameraRoll/RCTImagePickerManager.m
Expand Up @@ -16,6 +16,16 @@
#import <React/RCTRootView.h>
#import <React/RCTUtils.h>

@interface RCTImagePickerController : UIImagePickerController

@property (nonatomic, assign) BOOL unmirrorFrontFacingCamera;

@end

@implementation RCTImagePickerController

@end

@interface RCTImagePickerManager () <UIImagePickerControllerDelegate, UINavigationControllerDelegate>

@end
Expand All @@ -31,6 +41,22 @@ @implementation RCTImagePickerManager

@synthesize bridge = _bridge;

- (id)init
{
if (self = [super init]) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(cameraChanged:)
name:@"AVCaptureDeviceDidStartRunningNotification"
object:nil];
}
return self;
}

- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"AVCaptureDeviceDidStartRunningNotification" object:nil];
}

- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
Expand All @@ -56,9 +82,10 @@ - (dispatch_queue_t)methodQueue
return;
}

UIImagePickerController *imagePicker = [UIImagePickerController new];
RCTImagePickerController *imagePicker = [RCTImagePickerController new];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.unmirrorFrontFacingCamera = [RCTConvert BOOL:config[@"unmirrorFrontFacingCamera"]];

if ([RCTConvert BOOL:config[@"videoMode"]]) {
imagePicker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
Expand Down Expand Up @@ -175,4 +202,17 @@ - (void)_dismissPicker:(UIImagePickerController *)picker args:(NSArray *)args
}
}

- (void)cameraChanged:(NSNotification *)notification
{
for (UIImagePickerController *picker in _pickers) {
if ([picker isKindOfClass:[RCTImagePickerController class]]
&& ((RCTImagePickerController *)picker).unmirrorFrontFacingCamera
&& picker.cameraDevice == UIImagePickerControllerCameraDeviceFront) {
picker.cameraViewTransform = CGAffineTransformScale(CGAffineTransformIdentity, -1, 1);
} else {
picker.cameraViewTransform = CGAffineTransformIdentity;
}
}
}

@end
25 changes: 20 additions & 5 deletions Libraries/Components/AppleTV/TVViewPropTypes.js
Expand Up @@ -14,27 +14,42 @@ export type TVParallaxPropertiesType = $ReadOnly<{|
/**
* If true, parallax effects are enabled. Defaults to true.
*/
enabled: boolean,
enabled?: boolean,

/**
* Defaults to 2.0.
*/
shiftDistanceX: number,
shiftDistanceX?: number,

/**
* Defaults to 2.0.
*/
shiftDistanceY: number,
shiftDistanceY?: number,

/**
* Defaults to 0.05.
*/
tiltAngle: number,
tiltAngle?: number,

/**
* Defaults to 1.0
*/
magnification: number,
magnification?: number,

/**
* Defaults to 1.0
*/
pressMagnification?: number,

/**
* Defaults to 0.3
*/
pressDuration?: number,

/**
* Defaults to 0.3
*/
pressDelay?: number,
|}>;

/**
Expand Down

0 comments on commit 696bd89

Please sign in to comment.