Move QR code scanning to a separate view.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 5264602106
commit 051b005582

@ -2535,7 +2535,7 @@ typedef enum : NSUInteger {
- (void)createScrollDownButton - (void)createScrollDownButton
{ {
const CGFloat kScrollDownButtonSize = round(ScaleFromIPhone5To7Plus(35.f, 40.f)); const CGFloat kScrollDownButtonSize = ScaleFromIPhone5To7Plus(35.f, 40.f);
UIButton *scrollDownButton = [UIButton buttonWithType:UIButtonTypeCustom]; UIButton *scrollDownButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.scrollDownButton = scrollDownButton; self.scrollDownButton = scrollDownButton;
scrollDownButton.backgroundColor = [UIColor colorWithWhite:0.95f alpha:1.f]; scrollDownButton.backgroundColor = [UIColor colorWithWhite:0.95f alpha:1.f];

@ -79,15 +79,16 @@ NS_ASSUME_NONNULL_BEGIN
UILabel *cameraInstructionLabel = [UILabel new]; UILabel *cameraInstructionLabel = [UILabel new];
cameraInstructionLabel.text cameraInstructionLabel.text
= NSLocalizedString(@"SCAN_CODE_INSTRUCTIONS", @"label presented once scanning (camera) view is visible."); = NSLocalizedString(@"SCAN_CODE_INSTRUCTIONS", @"label presented once scanning (camera) view is visible.");
cameraInstructionLabel.font = [UIFont ows_regularFontWithSize:14.f]; cameraInstructionLabel.font = [UIFont ows_regularFontWithSize:ScaleFromIPhone5To7Plus(14.f, 18.f)];
cameraInstructionLabel.textColor = [UIColor whiteColor]; cameraInstructionLabel.textColor = [UIColor whiteColor];
cameraInstructionLabel.textAlignment = NSTextAlignmentCenter; cameraInstructionLabel.textAlignment = NSTextAlignmentCenter;
cameraInstructionLabel.numberOfLines = 0; cameraInstructionLabel.numberOfLines = 0;
cameraInstructionLabel.lineBreakMode = NSLineBreakByWordWrapping; cameraInstructionLabel.lineBreakMode = NSLineBreakByWordWrapping;
[footer addSubview:cameraInstructionLabel]; [footer addSubview:cameraInstructionLabel];
[cameraInstructionLabel autoPinWidthToSuperviewWithMargin:16.f]; [cameraInstructionLabel autoPinWidthToSuperviewWithMargin:ScaleFromIPhone5To7Plus(16.f, 30.f)];
[cameraInstructionLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:10.f]; CGFloat instructionsVMargin = ScaleFromIPhone5To7Plus(10.f, 20.f);
[cameraInstructionLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:10.f]; [cameraInstructionLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:instructionsVMargin];
[cameraInstructionLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:instructionsVMargin];
} }
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated

@ -57,8 +57,8 @@
[maskingView setConfigureShapeLayerBlock:^(CAShapeLayer *layer, CGRect bounds) { [maskingView setConfigureShapeLayerBlock:^(CAShapeLayer *layer, CGRect bounds) {
// Add a circular mask // Add a circular mask
UIBezierPath *path = [UIBezierPath bezierPathWithRect:bounds]; UIBezierPath *path = [UIBezierPath bezierPathWithRect:bounds];
CGFloat verticalMargin = 8.0; CGFloat margin = ScaleFromIPhone5To7Plus(8.f, 16.f);
CGFloat radius = MIN(bounds.size.width, bounds.size.height) * 0.5f - verticalMargin; CGFloat radius = MIN(bounds.size.width, bounds.size.height) * 0.5f - margin;
// Center the circle's bounding rectangle // Center the circle's bounding rectangle
CGRect circleRect = CGRectMake( CGRect circleRect = CGRectMake(

Loading…
Cancel
Save