// // TopLabelsAndBottomButtonsViewController.m // myverizon // // Created by Scott Pfeil on 1/26/16. // Copyright © 2016 Verizon Wireless. All rights reserved. // #import "TopLabelsAndBottomButtonsViewController.h" #import #import #import #import #import #import #import #import #import #import #import #import #import @import MVMAnimationFramework; @interface TopLabelsAndBottomButtonsViewController () @end @implementation TopLabelsAndBottomButtonsViewController - (void)initialLoad { [super initialLoad]; self.rebuildUIOnSizeChange = YES; } - (void)updateViews { if ([self screenSizeChanged] && self.rebuildUIOnSizeChange) { // If the screen size changed.... just rebuild everything.... this will cover all sizes and help for ipad slide over. [self newDataBuildScreen]; } [super updateViews]; } - (UIEdgeInsets)spaceAroundUIObject:(nullable id)object { return [super spaceAroundUIObject:object size:[MVMCoreUIUtility getWidth]]; } - (UIEdgeInsets)spaceAroundUIObject:(id)object size:(CGFloat)size { return [self spaceAroundUIObject:object]; } - (UIEdgeInsets)paddingForTopLabels { return UIEdgeInsetsMake(PaddingFive, [MFStyler defaultHorizontalPaddingForApplicationWidth], PaddingDefaultVerticalSpacing, [MFStyler defaultHorizontalPaddingForApplicationWidth]); } - (UIEdgeInsets)paddingForBottomButtons { // Smaller space for smaller devices. Also, top is 0 by default when in scroll. CGFloat verticalSpacing = [[MFSizeObject sizeObjectWithStandardSize:PaddingDefaultVerticalSpacing smalliPhoneSize:PaddingDefault] getValueBasedOnScreenSize]; return UIEdgeInsetsMake(([self bottomViewOutsideOfScroll] ? verticalSpacing : 0), PaddingDefaultHorizontalSpacing, verticalSpacing, PaddingDefaultHorizontalSpacing); } - (void)updateTopLabelsPadding:(CGFloat)size { if (self.topLabelsView) { UIEdgeInsets paddingForTopLabels = [self paddingForTopLabels]; self.topLabelsView.topLabelConstraint.constant = paddingForTopLabels.top; self.topLabelsView.bottomLabelConstraint.constant = paddingForTopLabels.bottom; [self.topLabelsView setLeftConstant:paddingForTopLabels.left]; [self.topLabelsView setRightConstant:paddingForTopLabels.right]; } } - (void)updateBottomButtonsPadding:(CGFloat)size { if (!self.customBottomView) { PrimaryButtonView *buttonView = (PrimaryButtonView *)self.bottomView; if (self.secondaryButton || self.primaryButton) { UIEdgeInsets paddingForBottomButtons = [self paddingForBottomButtons]; buttonView.leftPin.constant = paddingForBottomButtons.left; buttonView.rightPin.constant = paddingForBottomButtons.right; buttonView.topPin.constant = paddingForBottomButtons.top; buttonView.bottomPin.constant = paddingForBottomButtons.bottom; } else { buttonView.topPin.constant = 0; buttonView.bottomPin.constant = 0; buttonView.leftPin.constant = 0; buttonView.rightPin.constant = 0; } } } @end