Merge branch 'develop' into feature/customeragreement_support

This commit is contained in:
Kevin G Christiano 2019-08-08 16:21:33 -04:00
commit 55f4fec029
14 changed files with 132 additions and 74 deletions

View File

@ -18,7 +18,6 @@
01DF55E021F8FAA800CC099B /* MFTextFieldListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */; };
01DF567021FA5AB300CC099B /* TextFieldListFormViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01DF566F21FA5AB300CC099B /* TextFieldListFormViewController.swift */; };
01E569D3223FFFA500327251 /* ThreeLayerViewController.swift in Headers */ = {isa = PBXBuildFile; fileRef = D2A5146A2214905000345BFB /* ThreeLayerViewController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
18423C7E22E07B260069C7B7 /* MultiLabelListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18423C7D22E07B260069C7B7 /* MultiLabelListItem.swift */; };
B8200E152280C4CF007245F4 /* ProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8200E142280C4CF007245F4 /* ProgressBar.swift */; };
B8200E192281DC1A007245F4 /* ProgressBarWithLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8200E182281DC1A007245F4 /* ProgressBarWithLabel.swift */; };
D206997721FB8A0B00CAE0DE /* MVMCoreUINavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationController.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -168,6 +167,7 @@
D2A638FD22CA98280052ED1F /* HeadlineBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A638FC22CA98280052ED1F /* HeadlineBody.swift */; };
D2A6390122CBB1820052ED1F /* Carousel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A6390022CBB1820052ED1F /* Carousel.swift */; };
D2A6390522CBCE160052ED1F /* MoleculeCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */; };
D2B1E3E522F37D6A0065F95C /* ImageHeadlineBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B1E3E422F37D6A0065F95C /* ImageHeadlineBody.swift */; };
D2C5001821F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h in Headers */ = {isa = PBXBuildFile; fileRef = D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
D2C5001921F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m in Sources */ = {isa = PBXBuildFile; fileRef = D2C5001721F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m */; };
D2D6CD4022E78C1A00D701B8 /* Scroller.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */; };
@ -195,7 +195,6 @@
01CA51B4229716F60071A6EE /* Switch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Switch.swift; sourceTree = "<group>"; };
01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MFTextFieldListView.swift; sourceTree = "<group>"; };
01DF566F21FA5AB300CC099B /* TextFieldListFormViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldListFormViewController.swift; sourceTree = "<group>"; };
18423C7D22E07B260069C7B7 /* MultiLabelListItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultiLabelListItem.swift; sourceTree = "<group>"; };
B8200E142280C4CF007245F4 /* ProgressBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressBar.swift; sourceTree = "<group>"; };
B8200E182281DC1A007245F4 /* ProgressBarWithLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressBarWithLabel.swift; sourceTree = "<group>"; };
D206997521FB8A0B00CAE0DE /* MVMCoreUINavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUINavigationController.h; sourceTree = "<group>"; };
@ -349,6 +348,7 @@
D2A638FC22CA98280052ED1F /* HeadlineBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadlineBody.swift; sourceTree = "<group>"; };
D2A6390022CBB1820052ED1F /* Carousel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Carousel.swift; sourceTree = "<group>"; };
D2A6390422CBCE160052ED1F /* MoleculeCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeCollectionViewCell.swift; sourceTree = "<group>"; };
D2B1E3E422F37D6A0065F95C /* ImageHeadlineBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageHeadlineBody.swift; sourceTree = "<group>"; };
D2C5001621F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MVMCoreUIViewControllerMappingObject.h; sourceTree = "<group>"; };
D2C5001721F8ECDD001DA659 /* MVMCoreUIViewControllerMappingObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MVMCoreUIViewControllerMappingObject.m; sourceTree = "<group>"; };
D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Scroller.swift; sourceTree = "<group>"; };
@ -476,7 +476,6 @@
D29DF10E21E67A77003B2FB9 /* Molecules */ = {
isa = PBXGroup;
children = (
18423C7D22E07B260069C7B7 /* MultiLabelListItem.swift */,
01DF55DF21F8FAA800CC099B /* MFTextFieldListView.swift */,
D29770C721F7C4AE00B2F0D0 /* TopLabelsView.h */,
D29770C621F7C4AE00B2F0D0 /* TopLabelsView.m */,
@ -499,6 +498,7 @@
D260D7B022D65BDD007E7233 /* MVMCoreUIPageControl.m */,
D260D7B522D68509007E7233 /* MVMCoreUIPagingProtocol.h */,
D2D6CD3F22E78C1A00D701B8 /* Scroller.swift */,
D2B1E3E422F37D6A0065F95C /* ImageHeadlineBody.swift */,
);
path = Molecules;
sourceTree = "<group>";
@ -927,7 +927,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
18423C7E22E07B260069C7B7 /* MultiLabelListItem.swift in Sources */,
D29DF32121ED0CBA003B2FB9 /* LabelView.m in Sources */,
DBC4391822442197001AB423 /* CaretView.swift in Sources */,
D29770F221F7C6D600B2F0D0 /* TopLabelsAndBottomButtonsTableViewController.m in Sources */,
@ -999,6 +998,7 @@
D29770C821F7C4AE00B2F0D0 /* TopLabelsView.m in Sources */,
D2E1FADF2268B8E700AEFD8C /* ThreeLayerTableViewController.swift in Sources */,
D20A9A5E2243D3E300ADE781 /* TwoButtonView.swift in Sources */,
D2B1E3E522F37D6A0065F95C /* ImageHeadlineBody.swift in Sources */,
D29DF2AA21E7B2F9003B2FB9 /* MVMCoreUIConstants.m in Sources */,
D2A5146122121FBF00345BFB /* MoleculeStackTemplate.swift in Sources */,
D29DF11821E6805F003B2FB9 /* NSLayoutConstraint+MFConvenience.m in Sources */,

View File

@ -215,6 +215,7 @@ import UIKit
// MARK: - MVMCoreUIMoleculeViewProtocol functions
open override func setAsMolecule() {
addSizeConstraintsForAspectRatio = true
pinEdges(.all)
}
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {

View File

@ -30,7 +30,6 @@ typedef void (^PerformActionForRadioButton)(void);
@property (nullable, copy, nonatomic) PerformActionForRadioButton performActionForCheck;
typedef void (^CircleSelectedClosure)(_Nonnull id sender);
@property (nonatomic, strong, nullable) UIColor* fillColor;
@property (nonatomic, strong, nullable) UIColor* borderColor;
@property (nonatomic) CGFloat circleBorderWidth;
@ -38,11 +37,16 @@ typedef void (^CircleSelectedClosure)(_Nonnull id sender);
@property (nonatomic, copy, nullable) CircleSelectedClosure handleSelectionBlock;
@property (nonatomic) CGFloat circleDiameter;
@property (nonatomic, nullable, strong, readonly) CAShapeLayer * myCircle;
@property (nullable, weak, nonatomic) UIView *outerCircleView;
@property (nullable, weak, nonatomic) UIView *innerCircleView;
@property (nonatomic, strong, nullable) NSLayoutConstraint *heightConstraint;
@property (nonatomic, strong, nullable) NSLayoutConstraint *widthConstraint;
@property (nonatomic) BOOL respondsToTapGesture;
@property (nonatomic, getter = isSelected) BOOL selected;
@property (strong, nonatomic) NSLayoutConstraint *innerHeightConstarint;
@property (strong, nonatomic) NSLayoutConstraint *innerWidthConstarint;
@property (strong, nonatomic) NSLayoutConstraint *outerHeightConstarint;
@property (strong, nonatomic) NSLayoutConstraint *outerWidthConstarint;
// Set line width manually
- (void)setCheckMarkLineWidth:(CGFloat)lineWidth;

View File

@ -12,11 +12,6 @@
static CGFloat const DefaultOuterCircleSize = 31;
static CGFloat const DefaultInnerCircleSize = 19;
@interface MFRadioButton ()
@property (nullable, weak, nonatomic) UIView *outerCircleView;
@property (nullable, weak, nonatomic) UIView *innerCircleView;
@end
@implementation MFRadioButton
@ -64,9 +59,11 @@ static CGFloat const DefaultInnerCircleSize = 19;
[outerCircleView.leftAnchor constraintEqualToAnchor:self.leftAnchor].active = YES;
[outerCircleView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor].active = YES;
[outerCircleView.rightAnchor constraintEqualToAnchor:self.rightAnchor].active = YES;
[outerCircleView.widthAnchor constraintEqualToConstant:DefaultOuterCircleSize].active = YES;
[outerCircleView.heightAnchor constraintEqualToConstant:DefaultOuterCircleSize].active = YES;
self.outerHeightConstarint = [outerCircleView.widthAnchor constraintEqualToConstant:DefaultOuterCircleSize];
self.outerHeightConstarint.active = YES;
self.outerWidthConstarint = [outerCircleView.heightAnchor constraintEqualToConstant:DefaultOuterCircleSize];
self.outerWidthConstarint.active = YES;
UIView *innerCircleView = [[UIView alloc] init];
[outerCircleView addSubview:innerCircleView];
@ -76,8 +73,11 @@ static CGFloat const DefaultInnerCircleSize = 19;
[innerCircleView.centerXAnchor constraintEqualToAnchor:outerCircleView.centerXAnchor].active = YES;
[innerCircleView.centerYAnchor constraintEqualToAnchor:outerCircleView.centerYAnchor].active = YES;
[innerCircleView.widthAnchor constraintEqualToConstant:DefaultInnerCircleSize].active = YES;
[innerCircleView.heightAnchor constraintEqualToConstant:DefaultInnerCircleSize].active = YES;
self.innerHeightConstarint = [innerCircleView.heightAnchor constraintEqualToConstant:DefaultInnerCircleSize];
self.innerHeightConstarint.active = YES;
self.innerWidthConstarint = [innerCircleView.widthAnchor constraintEqualToConstant:DefaultInnerCircleSize];
self.innerWidthConstarint.active = YES;
outerCircleView.userInteractionEnabled = NO;
innerCircleView.userInteractionEnabled = NO;

View File

@ -46,6 +46,10 @@
#pragma mark - MVMCoreUIMoleculeViewProtocol
- (void)setAsMolecule {
self.translatesAutoresizingMaskIntoConstraints = NO;
}
- (void)reset {
self.backgroundColor = [UIColor clearColor];
}

View File

@ -114,6 +114,11 @@
} else {
self.hidden = YES;
}
NSString *colorString = [json string:KeyBackgroundColor];
if (colorString) {
self.backgroundColor = [UIColor mfGetColorForHex:colorString];
}
}
#pragma mark - helper

View File

@ -347,9 +347,6 @@
}
}
- (void)setAsMolecule {
}
- (void)setWithJSON:(NSDictionary *)json delegateObject:(MVMCoreUIDelegateObject *)delegateObject additionalData:(NSDictionary *)additionalData {
[super setWithJSON:json delegateObject:delegateObject additionalData:additionalData];

View File

@ -255,6 +255,10 @@ extension Carousel: UICollectionViewDelegateFlowLayout {
let itemWidth = collectionView.bounds.width * itemWidthPercent
return CGSize(width: itemWidth, height: collectionView.bounds.height)
}
public func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
(cell as? MoleculeCollectionViewCell)?.setPeaking(false, animated: false)
}
}
extension Carousel: UICollectionViewDataSource {

View File

@ -11,6 +11,7 @@ import UIKit
open class HeadlineBody: ViewConstrainingView {
let headlineLabel = Label.commonLabelH2(true)
let messageLabel = Label.commonLabelB2(true)
var spaceBetweenLabelsConstant = PaddingTwo
var spaceBetweenLabels: NSLayoutConstraint?
var leftConstraintTitle: NSLayoutConstraint?
var rightConstraintTitle: NSLayoutConstraint?
@ -44,7 +45,7 @@ open class HeadlineBody: ViewConstrainingView {
topPin = headlineLabel.topAnchor.constraint(equalTo: topAnchor, constant: 0)
topPin?.isActive = true
spaceBetweenLabels = messageLabel.topAnchor.constraint(equalTo: headlineLabel.bottomAnchor, constant: PaddingTwo)
spaceBetweenLabels = messageLabel.topAnchor.constraint(equalTo: headlineLabel.bottomAnchor, constant: spaceBetweenLabelsConstant)
spaceBetweenLabels?.isActive = true
leftConstraintTitle = headlineLabel.leftAnchor.constraint(equalTo: leftAnchor)
@ -66,7 +67,7 @@ open class HeadlineBody: ViewConstrainingView {
// MARK: - Constraining
public func setSpacing() {
if headlineLabel.hasText && messageLabel.hasText {
spaceBetweenLabels?.constant = PaddingTwo
spaceBetweenLabels?.constant = spaceBetweenLabelsConstant
} else {
spaceBetweenLabels?.constant = 0
}
@ -96,6 +97,7 @@ open class HeadlineBody: ViewConstrainingView {
super.reset()
headlineLabel.styleH2(true)
messageLabel.styleB2(true)
spaceBetweenLabelsConstant = PaddingTwo
}
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {

View File

@ -0,0 +1,85 @@
//
// ImageHeadlineBody.swift
// MVMCoreUI
//
// Created by Scott Pfeil on 8/1/19.
// Copyright © 2019 Verizon Wireless. All rights reserved.
//
import UIKit
@objcMembers open class ImageHeadlineBody: ViewConstrainingView {
let headlineBody = HeadlineBody(frame: .zero)
let imageView = MFLoadImageView()
var constraintBetweenImageLabelsConstant: CGFloat = 16
var constraintBetweenImageLabels: NSLayoutConstraint?
// MARK: - MFViewProtocol
open override func setupView() {
guard subviews.count == 0 else {
return
}
MVMCoreUIUtility.setMarginsFor(self, leading: 0, top: 0, trailing: 0, bottom: 0)
headlineBody.headlineLabel.styleB1(true)
headlineBody.spaceBetweenLabelsConstant = 0
addSubview(headlineBody)
addSubview(imageView)
NSLayoutConstraint.pinViewTop(toSuperview: headlineBody, useMargins: true, constant: 0).isActive = true
NSLayoutConstraint.pinViewRight(toSuperview: headlineBody, useMargins: true, constant: 0).isActive = true
layoutMarginsGuide.bottomAnchor.constraint(greaterThanOrEqualTo: headlineBody.bottomAnchor).isActive = true
var constraint = NSLayoutConstraint.pinViewBottom(toSuperview: headlineBody, useMargins: true, constant: 0)
constraint.priority = .defaultLow
constraint.isActive = true
imageView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
NSLayoutConstraint.pinViewLeft(toSuperview: imageView, useMargins: true, constant: 0).isActive = true
imageView.topAnchor.constraint(greaterThanOrEqualTo: layoutMarginsGuide.topAnchor).isActive = true
layoutMarginsGuide.bottomAnchor.constraint(greaterThanOrEqualTo: imageView.bottomAnchor).isActive = true
constraint = NSLayoutConstraint.pinViewBottom(toSuperview: imageView, useMargins: true, constant: 0)
constraint.priority = UILayoutPriority(rawValue: 200)
constraint.isActive = true
constraint = NSLayoutConstraint.pinViewTop(toSuperview: imageView, useMargins: true, constant: 0)
constraint.priority = UILayoutPriority(rawValue: 200)
constraint.isActive = true
constraintBetweenImageLabels = headlineBody.leadingAnchor.constraint(equalTo: imageView.trailingAnchor, constant: constraintBetweenImageLabelsConstant)
constraintBetweenImageLabels?.isActive = true
}
open override func updateView(_ size: CGFloat) {
super.updateView(size)
headlineBody.updateView(size)
imageView.updateView(size)
}
// MARK: - MVMCoreUIMoleculeViewProtocol
open override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) {
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
headlineBody.setWithJSON(json?.optionalDictionaryForKey("headlineBody"), delegateObject: delegateObject, additionalData: additionalData)
let imageJSON = json?.optionalDictionaryForKey("image")
imageView.setWithJSON(imageJSON, delegateObject: delegateObject, additionalData: additionalData)
constraintBetweenImageLabels?.constant = imageJSON != nil ? constraintBetweenImageLabelsConstant : 0
}
open override func setAsMolecule() {
super.setAsMolecule()
headlineBody.setAsMolecule()
imageView.setAsMolecule()
}
open override func reset() {
super.reset()
headlineBody.reset()
headlineBody.headlineLabel.styleB1(true)
headlineBody.spaceBetweenLabelsConstant = 0
imageView.reset()
}
public override static func estimatedHeight(forRow json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
return 95
}
}

View File

@ -297,7 +297,9 @@ static CGFloat const IndicatorRectangleHeight = 4;
if (selectedIndex != NSNotFound) {
self.currentPage = selectedIndex;
[self sendActionsForControlEvents:UIControlEventValueChanged];
self.pagingTouchBlock(self);
if (self.pagingTouchBlock) {
self.pagingTouchBlock(self);
}
}
}
}
@ -351,7 +353,9 @@ static CGFloat const IndicatorRectangleHeight = 4;
if ((index < self.numberOfPages && index >= 0) || self.alwaysSendingControlEvent) {
[self setCurrentPage:index animated:NO];
[self sendActionsForControlEvents:UIControlEventValueChanged];
self.pagingTouchBlock(self);
if (self.pagingTouchBlock) {
self.pagingTouchBlock(self);
}
}
}

View File

@ -98,7 +98,7 @@ import UIKit
}
// Add the caret if there is an action and it's not declared hidden.
if let _ = json?.optionalDictionaryForKey("actionMap"), json!.boolForKey("hideArrow") {
if let _ = json?.optionalDictionaryForKey("actionMap"), !json!.boolForKey("hideArrow") {
addCaretViewAccessory()
} else {
accessoryView = nil

View File

@ -1,48 +0,0 @@
//
// multiLabelListItem.swift
// MVMCoreUI
//
// Created by Kanamarlapudi, Vasavi on 15/7/19.
// Copyright © 2019 Verizon Wireless. All rights reserved.
//
import UIKit
@objcMembers public class MultiLabelListItem: ViewConstrainingView {
var moleculestackview = MoleculeStackView(frame: .zero)
open override func needsToBeConstrained() -> Bool {
return true
}
open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
let moleculestackjson = json?.optionalDictionaryForKey("moleculeStack")
moleculestackview.setWithJSON(moleculestackjson, delegateObject: delegateObject, additionalData: additionalData)
moleculestackview.useStackSpacingBeforeFirstItem = true
}
override open func setupView() {
super.setupView()
addSubview(moleculestackview)
moleculestackview.leftAnchor.constraint(equalTo: self.leftAnchor).isActive = true
moleculestackview.topAnchor.constraint(equalTo: self.topAnchor).isActive = true
let topleftwidthconstraint = NSLayoutConstraint(item: moleculestackview, attribute: .width, relatedBy: .equal, toItem: self, attribute: .width, multiplier: 0.5, constant: 0.0)
topleftwidthconstraint.priority = UILayoutPriority(100)
topleftwidthconstraint.isActive = true
moleculestackview.setContentHuggingPriority(UILayoutPriority(911), for: .horizontal)
moleculestackview.setContentHuggingPriority(UILayoutPriority(911), for: .vertical)
var bottomconstraint = bottomAnchor.constraint(equalTo: moleculestackview.bottomAnchor, constant: PaddingTwo)
bottomconstraint.priority = UILayoutPriority(249)
bottomconstraint.isActive = true
bottomAnchor.constraint(greaterThanOrEqualTo: moleculestackview.bottomAnchor, constant: PaddingTwo).isActive = true
bottomconstraint = bottomAnchor.constraint(equalTo: moleculestackview.bottomAnchor, constant: PaddingTwo)
bottomconstraint.priority = UILayoutPriority(249)
bottomconstraint.isActive = true
bottomAnchor.constraint(greaterThanOrEqualTo: moleculestackview.bottomAnchor, constant: PaddingTwo).isActive = true
}
}

View File

@ -49,12 +49,12 @@
@"image": MFLoadImageView.class,
@"leftRightLabelView": LeftRightLabelView.class,
@"moduleMolecule": ModuleMolecule.class,
@"multiLabelListItem": MultiLabelListItem.class,
@"headlineBody": HeadlineBody.class,
@"carousel": Carousel.class,
@"carouselItem": MoleculeCollectionViewCell.class,
@"barsPager": MVMCoreUIPageControl.class,
@"scroller": Scroller.class
@"scroller": Scroller.class,
@"imageHeadlineBody": ImageHeadlineBody.class
} mutableCopy];
});
return mapping;