Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into feature/model_cleanup
This commit is contained in:
commit
044f607996
@ -128,9 +128,7 @@ import UIKit
|
|||||||
|
|
||||||
self.delegateObject = delegateObject
|
self.delegateObject = delegateObject
|
||||||
isSelected = model.state
|
isSelected = model.state
|
||||||
let radioButtonModel = RadioButtonSelectionHelper.setupForRadioButtonGroup(model,
|
RadioButtonSelectionHelper.setupForRadioButtonGroup(model, self, delegateObject: delegateObject)
|
||||||
formValidator: delegateObject?.formHolderDelegate?.formValidator)
|
|
||||||
FormValidator.setupValidation(molecule: radioButtonModel, delegate: delegateObject?.formHolderDelegate)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func reset() {
|
public override func reset() {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import UIKit
|
|||||||
|
|
||||||
public var fieldKey: String?
|
public var fieldKey: String?
|
||||||
public var groupName: String? = FormValidator.defaultGroupName
|
public var groupName: String? = FormValidator.defaultGroupName
|
||||||
private var selectedRadioButton: RadioButton?
|
var selectedRadioButton: RadioButton?
|
||||||
private var fieldGroupName: String?
|
private var fieldGroupName: String?
|
||||||
public var baseValue: AnyHashable?
|
public var baseValue: AnyHashable?
|
||||||
|
|
||||||
@ -22,16 +22,20 @@ import UIKit
|
|||||||
self.fieldKey = fieldKey
|
self.fieldKey = fieldKey
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func setupForRadioButtonGroup(_ radioButtonModel: RadioButtonModel, formValidator: FormValidator?) -> RadioButtonSelectionHelper {
|
public static func setupForRadioButtonGroup(_ radioButtonModel: RadioButtonModel, _ radioButton: RadioButton, delegateObject: MVMCoreUIDelegateObject?) {
|
||||||
guard let groupName = radioButtonModel.fieldKey,
|
guard let groupName = radioButtonModel.fieldKey,
|
||||||
let formValidator = formValidator else {
|
let formValidator = delegateObject?.formHolderDelegate?.formValidator else {
|
||||||
return RadioButtonSelectionHelper(radioButtonModel.fieldKey)
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let radioButtonSelectionHelper = formValidator.radioButtonsModelByGroup[groupName] ?? RadioButtonSelectionHelper(radioButtonModel.fieldKey)
|
let radioButtonSelectionHelper = formValidator.radioButtonsModelByGroup[groupName] ?? RadioButtonSelectionHelper(radioButtonModel.fieldKey)
|
||||||
radioButtonSelectionHelper.fieldGroupName = radioButtonModel.fieldKey
|
radioButtonSelectionHelper.fieldGroupName = radioButtonModel.fieldKey
|
||||||
formValidator.radioButtonsModelByGroup[groupName] = radioButtonSelectionHelper
|
formValidator.radioButtonsModelByGroup[groupName] = radioButtonSelectionHelper
|
||||||
return radioButtonSelectionHelper
|
|
||||||
|
if radioButtonModel.state {
|
||||||
|
radioButtonSelectionHelper.selectedRadioButton = radioButton
|
||||||
|
}
|
||||||
|
FormValidator.setupValidation(molecule: radioButtonSelectionHelper, delegate: delegateObject?.formHolderDelegate)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func selected(_ radioButton: RadioButton) {
|
public func selected(_ radioButton: RadioButton) {
|
||||||
|
|||||||
@ -260,15 +260,15 @@ static const CGFloat VertialShadowOffset = 6;
|
|||||||
UIBezierPath *shadowPath = [UIBezierPath bezierPath];
|
UIBezierPath *shadowPath = [UIBezierPath bezierPath];
|
||||||
|
|
||||||
//get the variables for frame
|
//get the variables for frame
|
||||||
CGFloat x = 0;
|
CGFloat x = rect.origin.x;
|
||||||
CGFloat y = 0;
|
CGFloat y = rect.origin.y;
|
||||||
CGFloat width = CGRectGetWidth(rect);
|
CGFloat width = CGRectGetWidth(rect);
|
||||||
CGFloat height = CGRectGetHeight(rect);
|
CGFloat height = CGRectGetHeight(rect);
|
||||||
|
|
||||||
[shadowPath moveToPoint:CGPointMake(x + HorizontalShadowInset, y)];
|
[shadowPath moveToPoint:CGPointMake(x + HorizontalShadowInset, y)];
|
||||||
[shadowPath addLineToPoint:CGPointMake(width - HorizontalShadowInset, y)];
|
[shadowPath addLineToPoint:CGPointMake(x + width - HorizontalShadowInset, y)];
|
||||||
[shadowPath addLineToPoint:CGPointMake(width - HorizontalShadowInset, height-VertialShadowOffset/2)];
|
[shadowPath addLineToPoint:CGPointMake(x + width - HorizontalShadowInset, height-VertialShadowOffset/2)];
|
||||||
[shadowPath addQuadCurveToPoint:CGPointMake(x + HorizontalShadowInset, height - VertialShadowOffset/2) controlPoint:CGPointMake(width/2.f, height - VertialShadowOffset * 1.5)];
|
[shadowPath addQuadCurveToPoint:CGPointMake(x + HorizontalShadowInset, height - VertialShadowOffset/2) controlPoint:CGPointMake((x + width)/2.f, height - VertialShadowOffset * 1.5)];
|
||||||
[shadowPath addLineToPoint:CGPointMake(x + HorizontalShadowInset, y)];
|
[shadowPath addLineToPoint:CGPointMake(x + HorizontalShadowInset, y)];
|
||||||
[shadowPath closePath];
|
[shadowPath closePath];
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user