Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ public List<NativeModule> createNativeModules(ReactApplicationContext reactConte
return Arrays.<NativeModule>asList(new ASDatePickerViewModule(reactContext), new ASDataPickerViewModule(reactContext));
}

@Override
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
}

@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
Expand Down
32 changes: 24 additions & 8 deletions ios/Pickers/AbstractActionSheetPicker.m
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ - (void)showActionSheetPicker {
[masterView addSubview:self.toolbar];

//ios7 picker draws a darkened alpha-only region on the first and last 8 pixels horizontally, but blurs the rest of its background. To make the whole popup appear to be edge-to-edge, we have to add blurring to the remaining left and right edges.
if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) {
if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1 && !(IS_IPAD)) {
CGRect rect = CGRectMake(0, self.toolbar.frame.origin.y, _borderWidth, masterView.frame.size.height - self.toolbar.frame.origin.y);
UIToolbar *leftEdge = [[UIToolbar alloc] initWithFrame:rect];
rect.origin.x = masterView.frame.size.width - _borderWidth;
Expand Down Expand Up @@ -314,14 +314,18 @@ - (IBAction)actionPickerCancel:(id)sender {
}

- (void)dismissPicker {
bool animated = YES;
if (IS_IPAD) {
animated = NO;
}
#if __IPHONE_4_1 <= __IPHONE_OS_VERSION_MAX_ALLOWED
if (self.actionSheet)
#else
if (self.actionSheet && [self.actionSheet isVisible])
#endif
[_actionSheet dismissWithClickedButtonIndex:0 animated:YES];
[_actionSheet dismissWithClickedButtonIndex:0 animated:animated];
else if (self.popOverController && self.popOverController.popoverVisible)
[_popOverController dismissPopoverAnimated:YES];
[_popOverController dismissPopoverAnimated:animated];
self.actionSheet = nil;
self.popOverController = nil;
self.selfReference = nil;
Expand Down Expand Up @@ -474,8 +478,13 @@ - (UIToolbar *)createPickerToolbarWithTitle:(NSString *)title {

pickerToolbar.barTintColor = self.toolbarBackgroundColor;
pickerToolbar.tintColor = self.toolbarButtonsColor;
pickerToolbar.layer.borderWidth = 1;
pickerToolbar.layer.borderColor = [[UIColor colorWithRed:0.812 green:0.839 blue:0.859 alpha:1] CGColor];
if (IS_IPAD) {
pickerToolbar.layer.borderWidth = 0;
pickerToolbar.layer.borderColor = [[UIColor colorWithWhite:1 alpha:0] CGColor];
} else {
pickerToolbar.layer.borderWidth = 1;
pickerToolbar.layer.borderColor = [[UIColor colorWithRed:0.812 green:0.839 blue:0.859 alpha:1] CGColor];
}

NSMutableArray *barItems = [[NSMutableArray alloc] init];

Expand Down Expand Up @@ -748,8 +757,16 @@ - (void)presentPopover:(UIPopoverController *)popover {
}
else if ((self.containerView)) {
dispatch_async(dispatch_get_main_queue(), ^{
[popover presentPopoverFromRect:_containerView.bounds inView:_containerView
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
if (IS_IPAD) {
CGRect cotainerViewframe = _containerView.bounds;
CGFloat popoverPointX = (cotainerViewframe.size.width) / 2;
CGFloat popoverPointY = (cotainerViewframe.size.height) / 2;
[popover presentPopoverFromRect:CGRectMake(popoverPointX, popoverPointY, 0, 0) inView:_containerView
permittedArrowDirections:0 animated:YES];
} else {
[popover presentPopoverFromRect:_containerView.bounds inView:_containerView
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}

});
return;
Expand Down Expand Up @@ -801,4 +818,3 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
}

@end