Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into feature/modernize
This commit is contained in:
commit
279dbd9b08
@ -228,7 +228,9 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
|
|||||||
NSDictionary *constraints = [NSLayoutConstraint constraintPinView:checkedSquare heightConstraint:YES heightConstant:size widthConstraint:YES widthConstant:size];
|
NSDictionary *constraints = [NSLayoutConstraint constraintPinView:checkedSquare heightConstraint:YES heightConstant:size widthConstraint:YES widthConstant:size];
|
||||||
self.checkboxWidth = constraints[ConstraintWidth];
|
self.checkboxWidth = constraints[ConstraintWidth];
|
||||||
self.checkboxHeight = constraints[ConstraintHeight];
|
self.checkboxHeight = constraints[ConstraintHeight];
|
||||||
[NSLayoutConstraint constraintPinSubview:checkedSquare pinTop:YES pinBottom:YES pinLeft:YES pinRight:NO];
|
[NSLayoutConstraint constraintPinSubview:checkedSquare pinTop:NO pinBottom:NO pinLeft:YES pinRight:NO];
|
||||||
|
[checkedSquare.topAnchor constraintGreaterThanOrEqualToAnchor:containterView.topAnchor].active = YES;
|
||||||
|
[containterView.bottomAnchor constraintGreaterThanOrEqualToAnchor:checkedSquare.bottomAnchor].active = YES;
|
||||||
|
|
||||||
self.checkboxRightPinConstraint = [checkedSquare.trailingAnchor constraintEqualToAnchor:containterView.trailingAnchor];
|
self.checkboxRightPinConstraint = [checkedSquare.trailingAnchor constraintEqualToAnchor:containterView.trailingAnchor];
|
||||||
|
|
||||||
@ -255,7 +257,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
|
|||||||
Label *descriptionLabel = [Label commonLabelB2:YES];
|
Label *descriptionLabel = [Label commonLabelB2:YES];
|
||||||
[containterView addSubview:descriptionLabel];
|
[containterView addSubview:descriptionLabel];
|
||||||
[NSLayoutConstraint constraintPinSubview:descriptionLabel pinCenterX:NO pinCenterY:YES];
|
[NSLayoutConstraint constraintPinSubview:descriptionLabel pinCenterX:NO pinCenterY:YES];
|
||||||
[NSLayoutConstraint constraintPinSubview:descriptionLabel pinTop:NO pinBottom:NO pinLeft:NO pinRight:YES];
|
[NSLayoutConstraint constraintPinSubview:descriptionLabel pinTop:YES pinBottom:YES pinLeft:NO pinRight:YES];
|
||||||
|
|
||||||
self.descriptionLabelLeadingConstraint = [NSLayoutConstraint constraintWithItem:descriptionLabel attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.checkedSquare attribute:NSLayoutAttributeTrailing multiplier:1 constant:11];
|
self.descriptionLabelLeadingConstraint = [NSLayoutConstraint constraintWithItem:descriptionLabel attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.checkedSquare attribute:NSLayoutAttributeTrailing multiplier:1 constant:11];
|
||||||
self.descriptionLabelLeadingConstraint.active = YES;
|
self.descriptionLabelLeadingConstraint.active = YES;
|
||||||
|
|||||||
@ -71,4 +71,6 @@
|
|||||||
- (BOOL)bottomViewOutsideOfScroll;
|
- (BOOL)bottomViewOutsideOfScroll;
|
||||||
//override for setting attributed headline and message
|
//override for setting attributed headline and message
|
||||||
-(void)setHeadlineAndMessage;
|
-(void)setHeadlineAndMessage;
|
||||||
|
- (nullable UIView *)topAccessoryView;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
@property (strong, nonatomic) UIView *footerViewOutsideOfScroll;
|
@property (strong, nonatomic) UIView *footerViewOutsideOfScroll;
|
||||||
@property (strong, nonatomic) NSLayoutConstraint *bottomViewTopConstraint;
|
@property (strong, nonatomic) NSLayoutConstraint *bottomViewTopConstraint;
|
||||||
@property (strong, nonatomic) UIView *headerAccessoryView;
|
@property (strong, nonatomic) UIView *headerAccessoryView;
|
||||||
|
@property (strong, nonatomic) UIView *topAccessoryView;
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@ -70,6 +71,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (nullable UIView *)topAccessoryView {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)newDataBuildScreen {
|
- (void)newDataBuildScreen {
|
||||||
[super newDataBuildScreen];
|
[super newDataBuildScreen];
|
||||||
@ -254,15 +258,25 @@
|
|||||||
[header addSubview:topView];
|
[header addSubview:topView];
|
||||||
[header addSubview:headerAccessoryView];
|
[header addSubview:headerAccessoryView];
|
||||||
|
|
||||||
|
UIView *topAccessoryView = [self topAccessoryView];
|
||||||
|
self.topAccessoryView = topAccessoryView;
|
||||||
|
if (topAccessoryView) {
|
||||||
|
[header addSubview:topAccessoryView];
|
||||||
|
[NSLayoutConstraint constraintPinSubview:topAccessoryView pinTop:YES pinBottom:NO pinLeft:YES pinRight:YES];
|
||||||
|
[topAccessoryView.bottomAnchor constraintEqualToAnchor:topView.topAnchor constant:0].active = YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL topPin = topAccessoryView ? NO : YES;
|
||||||
// Sets up the constraints
|
// Sets up the constraints
|
||||||
if (headerAccessoryView) {
|
if (headerAccessoryView) {
|
||||||
[NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[topView]-0-[headerAccessoryView]" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(topView,headerAccessoryView)]];
|
[NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[topView]-0-[headerAccessoryView]" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(topView,headerAccessoryView)]];
|
||||||
[NSLayoutConstraint constraintPinSubview:topView pinTop:YES topConstant:0 pinBottom:NO bottomConstant:0 pinLeft:YES leftConstant:0 pinRight:YES rightConstant:0];
|
[NSLayoutConstraint constraintPinSubview:topView pinTop:topPin topConstant:0 pinBottom:NO bottomConstant:0 pinLeft:YES leftConstant:0 pinRight:YES rightConstant:0];
|
||||||
self.topViewBottomConstraint = [[NSLayoutConstraint constraintPinSubview:headerAccessoryView pinTop:NO topConstant:0 pinBottom:YES bottomConstant:[[self spaceAboveBetweenView] floatValue] pinLeft:YES leftConstant:0 pinRight:YES rightConstant:0] objectForKey:ConstraintBot ofType:[NSLayoutConstraint class]];
|
self.topViewBottomConstraint = [[NSLayoutConstraint constraintPinSubview:headerAccessoryView pinTop:NO topConstant:0 pinBottom:YES bottomConstant:[[self spaceAboveBetweenView] floatValue] pinLeft:YES leftConstant:0 pinRight:YES rightConstant:0] objectForKey:ConstraintBot ofType:[NSLayoutConstraint class]];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
self.topViewBottomConstraint = [[NSLayoutConstraint constraintPinSubview:topView pinTop:YES topConstant:0 pinBottom:YES bottomConstant:[[self spaceAboveBetweenView] floatValue] pinLeft:YES leftConstant:0 pinRight:YES rightConstant:0] objectForKey:ConstraintBot ofType:[NSLayoutConstraint class]];
|
self.topViewBottomConstraint = [[NSLayoutConstraint constraintPinSubview:topView pinTop:topPin topConstant:0 pinBottom:YES bottomConstant:[[self spaceAboveBetweenView] floatValue] pinLeft:YES leftConstant:0 pinRight:YES rightConstant:0] objectForKey:ConstraintBot ofType:[NSLayoutConstraint class]];
|
||||||
}
|
}
|
||||||
|
|
||||||
self.headerView = header;
|
self.headerView = header;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,6 +295,7 @@
|
|||||||
self.footerView = footer;
|
self.footerView = footer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)showHeader {
|
- (void)showHeader {
|
||||||
|
|
||||||
if (self.headerView) {
|
if (self.headerView) {
|
||||||
@ -459,6 +474,10 @@
|
|||||||
|
|
||||||
#pragma mark - Animation
|
#pragma mark - Animation
|
||||||
-(void)setupIntroAnimations {
|
-(void)setupIntroAnimations {
|
||||||
|
|
||||||
|
if (self.topAccessoryView.subviews.count) {
|
||||||
|
[self.introAnimationManager addAnimationWithAnimation:[MVMAnimations fadeUpAnimationWithView:self.topAccessoryView]];
|
||||||
|
}
|
||||||
if (self.topView.subviews.count) {
|
if (self.topView.subviews.count) {
|
||||||
[self.introAnimationManager addAnimationWithAnimation:[MVMAnimations fadeUpAnimationWithView:self.topView]];
|
[self.introAnimationManager addAnimationWithAnimation:[MVMAnimations fadeUpAnimationWithView:self.topView]];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,6 +38,8 @@
|
|||||||
|
|
||||||
#pragma mark - Subclass
|
#pragma mark - Subclass
|
||||||
|
|
||||||
|
- (nullable UIView *)topAccessoryView;
|
||||||
|
|
||||||
// Allow you to add any additional ui before buildViewsBetweenLabelsAndButtons gets called. Can use this to set the topBetweenEdgeView or bottomBetweenEdgeView
|
// Allow you to add any additional ui before buildViewsBetweenLabelsAndButtons gets called. Can use this to set the topBetweenEdgeView or bottomBetweenEdgeView
|
||||||
- (void)buildInAdditionalViewsBeforeCenteredContent;
|
- (void)buildInAdditionalViewsBeforeCenteredContent;
|
||||||
// For subclassing. Should return all the views that will be in between labels and buttons. Override standardSpaceAroundUIObject to handle spacing.
|
// For subclassing. Should return all the views that will be in between labels and buttons. Override standardSpaceAroundUIObject to handle spacing.
|
||||||
|
|||||||
@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
@property (nullable, weak, nonatomic) UIView *betweenView;
|
@property (nullable, weak, nonatomic) UIView *betweenView;
|
||||||
|
|
||||||
|
@property (strong, nonatomic) UIView *topAccessoryView;
|
||||||
|
|
||||||
// Adds the button view to the screen. Out of the scroll or in.
|
// Adds the button view to the screen. Out of the scroll or in.
|
||||||
- (void)addViewOutsideOfScrollView:(UIView *)bottomView;
|
- (void)addViewOutsideOfScrollView:(UIView *)bottomView;
|
||||||
- (void)addViewToContentView:(UIView *)bottomView;
|
- (void)addViewToContentView:(UIView *)bottomView;
|
||||||
@ -115,9 +117,19 @@
|
|||||||
}
|
}
|
||||||
[self.contentView addSubview:topView];
|
[self.contentView addSubview:topView];
|
||||||
[NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[topView]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(topView)]];
|
[NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[topView]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(topView)]];
|
||||||
self.topConstraintForTopView = [NSLayoutConstraint constraintWithItem:topView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
|
|
||||||
self.topConstraintForTopView.active = YES;
|
|
||||||
|
|
||||||
|
UIView *topAccessoryView = [self topAccessoryView];
|
||||||
|
self.topAccessoryView = topAccessoryView;
|
||||||
|
if (topAccessoryView) {
|
||||||
|
[self.contentView addSubview:topAccessoryView];
|
||||||
|
[NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[topAccessoryView]-0-|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil views:NSDictionaryOfVariableBindings(topAccessoryView)]];
|
||||||
|
self.topConstraintForTopView = [NSLayoutConstraint constraintWithItem:topAccessoryView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
|
||||||
|
[topAccessoryView.bottomAnchor constraintEqualToAnchor:topView.topAnchor constant:0].active = YES;
|
||||||
|
} else {
|
||||||
|
self.topConstraintForTopView = [NSLayoutConstraint constraintWithItem:topView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
|
||||||
|
}
|
||||||
|
|
||||||
|
self.topConstraintForTopView.active = YES;
|
||||||
// Checks if we are using a different object than the bottom buttons.
|
// Checks if we are using a different object than the bottom buttons.
|
||||||
UIView *bottomView = [self useCustomViewInsteadOfButtons];
|
UIView *bottomView = [self useCustomViewInsteadOfButtons];
|
||||||
self.customBottemView = (bottomView != nil);
|
self.customBottemView = (bottomView != nil);
|
||||||
@ -266,7 +278,10 @@
|
|||||||
if (self.topLabelsView) {
|
if (self.topLabelsView) {
|
||||||
[self.topLabelsView setHeadlineString:[[self mapForTopLabels] stringForKey:KeyTitle] messageString:[[self mapForTopLabels] stringForKey:KeyMessage]];
|
[self.topLabelsView setHeadlineString:[[self mapForTopLabels] stringForKey:KeyTitle] messageString:[[self mapForTopLabels] stringForKey:KeyMessage]];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (nullable UIView *)topAccessoryView {
|
||||||
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateViewConstraints {
|
- (void)updateViewConstraints {
|
||||||
@ -409,6 +424,11 @@
|
|||||||
|
|
||||||
#pragma mark - Animations
|
#pragma mark - Animations
|
||||||
-(void)setupIntroAnimations {
|
-(void)setupIntroAnimations {
|
||||||
|
|
||||||
|
if (self.topAccessoryView.subviews.count) {
|
||||||
|
[self.introAnimationManager addAnimationWithAnimation:[MVMAnimations fadeUpAnimationWithView:self.topAccessoryView]];
|
||||||
|
}
|
||||||
|
|
||||||
if (self.topView.subviews) {
|
if (self.topView.subviews) {
|
||||||
[self.introAnimationManager addAnimationWithAnimation:[MVMAnimations fadeUpAnimationWithView:self.topView]];
|
[self.introAnimationManager addAnimationWithAnimation:[MVMAnimations fadeUpAnimationWithView:self.topView]];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user