Move QR code scanning to a separate view.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-06-09 07:48:12 -04:00
parent 5264602106
commit 051b005582
3 changed files with 8 additions and 7 deletions

View file

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

View file

@ -79,15 +79,16 @@ NS_ASSUME_NONNULL_BEGIN
UILabel *cameraInstructionLabel = [UILabel new];
cameraInstructionLabel.text
= 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.textAlignment = NSTextAlignmentCenter;
cameraInstructionLabel.numberOfLines = 0;
cameraInstructionLabel.lineBreakMode = NSLineBreakByWordWrapping;
[footer addSubview:cameraInstructionLabel];
[cameraInstructionLabel autoPinWidthToSuperviewWithMargin:16.f];
[cameraInstructionLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:10.f];
[cameraInstructionLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:10.f];
[cameraInstructionLabel autoPinWidthToSuperviewWithMargin:ScaleFromIPhone5To7Plus(16.f, 30.f)];
CGFloat instructionsVMargin = ScaleFromIPhone5To7Plus(10.f, 20.f);
[cameraInstructionLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:instructionsVMargin];
[cameraInstructionLabel autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:instructionsVMargin];
}
- (void)viewWillAppear:(BOOL)animated

View file

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