more chanes made for design request
This commit is contained in:
parent
f4ee30478a
commit
9079d6dcae
@ -25,11 +25,11 @@ open class CaretLink: Button, MVMCoreUIViewConstrainingProtocol {
|
|||||||
@objc public var rightViewHeight: NSNumber?
|
@objc public var rightViewHeight: NSNumber?
|
||||||
@objc public var rightViewWidth: NSNumber?
|
@objc public var rightViewWidth: NSNumber?
|
||||||
|
|
||||||
@objc public var enabledColor: UIColor = .black {
|
@objc public var enabledColor: UIColor = .mvmBlack {
|
||||||
didSet { changeCaretColor() }
|
didSet { changeCaretColor() }
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc public var disabledColor: UIColor = .mfSilver() {
|
@objc public var disabledColor: UIColor = .mvmCoolGray3 {
|
||||||
didSet { changeCaretColor() }
|
didSet { changeCaretColor() }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ open class CaretLink: Button, MVMCoreUIViewConstrainingProtocol {
|
|||||||
caretView.widthAnchor.constraint(equalToConstant: width).isActive = true
|
caretView.widthAnchor.constraint(equalToConstant: width).isActive = true
|
||||||
caretView.heightAnchor.constraint(equalToConstant: height).isActive = true
|
caretView.heightAnchor.constraint(equalToConstant: height).isActive = true
|
||||||
|
|
||||||
let caretLabelSpacing = NSLayoutConstraint(item: caretView, attribute: .left, relatedBy: .equal, toItem: titleLabel, attribute: .right, multiplier: 1.0, constant: 4)
|
let caretLabelSpacing = NSLayoutConstraint(item: caretView, attribute: .left, relatedBy: .equal, toItem: titleLabel, attribute: .right, multiplier: 1.0, constant: 7)
|
||||||
caretLabelSpacing.isActive = true
|
caretLabelSpacing.isActive = true
|
||||||
caretSpacingConstraint = caretLabelSpacing
|
caretSpacingConstraint = caretLabelSpacing
|
||||||
|
|
||||||
|
|||||||
@ -116,7 +116,7 @@ import UIKit
|
|||||||
for (index, field) in digitBoxes.enumerated() {
|
for (index, field) in digitBoxes.enumerated() {
|
||||||
if index < newValue.count {
|
if index < newValue.count {
|
||||||
let indexChar = newValue.index(newValue.startIndex, offsetBy: index)
|
let indexChar = newValue.index(newValue.startIndex, offsetBy: index)
|
||||||
field.digitField.attributedPlaceholder = NSAttributedString(string: String(newValue[indexChar]), attributes: [NSAttributedString.Key.foregroundColor: UIColor.mfBattleshipGrey()])
|
field.digitField.attributedPlaceholder = NSAttributedString(string: String(newValue[indexChar]), attributes: [NSAttributedString.Key.foregroundColor: UIColor.mvmCoolGray6])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,8 +20,8 @@ import UIKit
|
|||||||
|
|
||||||
public private(set) var titleLabel: Label = {
|
public private(set) var titleLabel: Label = {
|
||||||
let label = Label()
|
let label = Label()
|
||||||
label.font = MFStyler.fontB3()
|
label.font = MFStyler.fontRegularMicro()
|
||||||
label.textColor = .mvmCoolGray6
|
label.textColor = .mvmBlack
|
||||||
label.setContentCompressionResistancePriority(.required, for: .vertical)
|
label.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||||
return label
|
return label
|
||||||
}()
|
}()
|
||||||
@ -31,7 +31,7 @@ import UIKit
|
|||||||
/// Provides contextual information on the TextField.
|
/// Provides contextual information on the TextField.
|
||||||
public private(set) var feedbackLabel: Label = {
|
public private(set) var feedbackLabel: Label = {
|
||||||
let label = Label()
|
let label = Label()
|
||||||
label.font = MFStyler.fontForTextFieldUnderLabel()
|
label.font = MFStyler.fontRegularMicro()
|
||||||
label.textColor = .mvmBlack
|
label.textColor = .mvmBlack
|
||||||
label.setContentCompressionResistancePriority(.required, for: .vertical)
|
label.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||||
return label
|
return label
|
||||||
@ -65,7 +65,8 @@ import UIKit
|
|||||||
public var isEnabled: Bool {
|
public var isEnabled: Bool {
|
||||||
get { return entryFieldContainer.isEnabled }
|
get { return entryFieldContainer.isEnabled }
|
||||||
set (enabled) {
|
set (enabled) {
|
||||||
self.feedbackLabel.textColor = enabled ? .black : .mfSilver()
|
self.titleLabel.textColor = enabled ? .mvmBlack : .mvmCoolGray3
|
||||||
|
self.feedbackLabel.textColor = enabled ? .mvmBlack : .mvmCoolGray3
|
||||||
self.entryFieldContainer.isEnabled = enabled
|
self.entryFieldContainer.isEnabled = enabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -233,15 +234,16 @@ import UIKit
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - MoleculeViewProtocol
|
// MARK: - MoleculeViewProtocol
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
@objc open override func reset() {
|
@objc open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
|
|
||||||
backgroundColor = .clear
|
backgroundColor = .clear
|
||||||
isAccessibilityElement = false
|
isAccessibilityElement = false
|
||||||
titleLabel.font = MFStyler.fontB3()
|
titleLabel.font = MFStyler.fontRegularMicro()
|
||||||
titleLabel.textColor = .mfBattleshipGrey()
|
titleLabel.textColor = .mvmBlack
|
||||||
feedbackLabel.font = MFStyler.fontForTextFieldUnderLabel()
|
feedbackLabel.font = MFStyler.fontRegularMicro()
|
||||||
feedbackLabel.textColor = .black
|
feedbackLabel.textColor = .mvmBlack
|
||||||
entryFieldContainer.reset()
|
entryFieldContainer.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,8 @@ import UIKit
|
|||||||
let textField = TextField()
|
let textField = TextField()
|
||||||
textField.isAccessibilityElement = true
|
textField.isAccessibilityElement = true
|
||||||
textField.setContentCompressionResistancePriority(.required, for: .vertical)
|
textField.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||||
textField.font = MFStyler.fontForTextField()
|
textField.font = MFStyler.fontRegularBodyLarge()
|
||||||
|
textField.textColor = .mvmBlack
|
||||||
textField.smartQuotesType = .no
|
textField.smartQuotesType = .no
|
||||||
textField.smartDashesType = .no
|
textField.smartDashesType = .no
|
||||||
textField.smartInsertDeleteType = .no
|
textField.smartInsertDeleteType = .no
|
||||||
@ -40,7 +41,7 @@ import UIKit
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
/// Set enabled and disabled colors to be utilized when setting this texfield's isEnabled property.
|
/// Set enabled and disabled colors to be utilized when setting this texfield's isEnabled property.
|
||||||
public var textColor: (enabled: UIColor?, disabled: UIColor?) = (.black, .mfSilver())
|
public var textColor: (enabled: UIColor?, disabled: UIColor?) = (.mvmBlack, .mvmCoolGray3)
|
||||||
|
|
||||||
private var observingForChange: Bool = false
|
private var observingForChange: Bool = false
|
||||||
|
|
||||||
@ -78,7 +79,9 @@ import UIKit
|
|||||||
|
|
||||||
if error {
|
if error {
|
||||||
textField.accessibilityValue = String(format: MVMCoreUIUtility.hardcodedString(withKey: "textfield_error_message") ?? "", textField.text ?? "", errorMessage ?? "")
|
textField.accessibilityValue = String(format: MVMCoreUIUtility.hardcodedString(withKey: "textfield_error_message") ?? "", textField.text ?? "", errorMessage ?? "")
|
||||||
|
errorIconWidthContraint?.constant = 20
|
||||||
} else {
|
} else {
|
||||||
|
errorIconWidthContraint?.constant = 0
|
||||||
textField.accessibilityValue = nil
|
textField.accessibilityValue = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,6 +143,7 @@ import UIKit
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public var textFieldTrailingConstraint: NSLayoutConstraint?
|
public var textFieldTrailingConstraint: NSLayoutConstraint?
|
||||||
|
public var errorIconWidthContraint: NSLayoutConstraint?
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
@ -168,7 +172,7 @@ import UIKit
|
|||||||
|
|
||||||
@objc open override func setupFieldContainerContent(_ container: UIView) {
|
@objc open override func setupFieldContainerContent(_ container: UIView) {
|
||||||
|
|
||||||
MFStyler.styleTextField(textField)
|
textField.font = MFStyler.fontRegularBodyLarge()
|
||||||
container.addSubview(textField)
|
container.addSubview(textField)
|
||||||
|
|
||||||
NSLayoutConstraint.activate([
|
NSLayoutConstraint.activate([
|
||||||
@ -193,14 +197,14 @@ import UIKit
|
|||||||
@objc open override func updateView(_ size: CGFloat) {
|
@objc open override func updateView(_ size: CGFloat) {
|
||||||
super.updateView(size)
|
super.updateView(size)
|
||||||
|
|
||||||
MFStyler.styleTextField(textField)
|
textField.font = MFStyler.fontRegularBodyLarge()
|
||||||
layoutIfNeeded()
|
layoutIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func reset() {
|
open override func reset() {
|
||||||
super.reset()
|
super.reset()
|
||||||
|
|
||||||
textField.font = MFStyler.fontForTextField()
|
textField.font = MFStyler.fontRegularBodyLarge()
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc deinit {
|
@objc deinit {
|
||||||
@ -252,6 +256,7 @@ import UIKit
|
|||||||
observingTextFieldDelegate?.isValid?(textfield: self)
|
observingTextFieldDelegate?.isValid?(textfield: self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Executes on UITextField.textDidBeginEditingNotification
|
/// Executes on UITextField.textDidBeginEditingNotification
|
||||||
@objc func startEditing() {
|
@objc func startEditing() {
|
||||||
isSelected = true
|
isSelected = true
|
||||||
@ -270,7 +275,7 @@ import UIKit
|
|||||||
resignFirstResponder()
|
resignFirstResponder()
|
||||||
if isValid {
|
if isValid {
|
||||||
showError = false
|
showError = false
|
||||||
entryFieldContainer.bottomBar?.backgroundColor = UIColor.black.cgColor
|
entryFieldContainer.bottomBar?.backgroundColor = UIColor.mvmBlack.cgColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,6 +283,10 @@ import UIKit
|
|||||||
resignFirstResponder()
|
resignFirstResponder()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// MARK: - MoleculeViewProtocol
|
||||||
|
//--------------------------------------------------
|
||||||
|
|
||||||
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
super.set(with: model, delegateObject, additionalData)
|
super.set(with: model, delegateObject, additionalData)
|
||||||
|
|
||||||
|
|||||||
@ -25,13 +25,13 @@ public typealias ActionBlockConfirmation = () -> (Bool)
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
/// Holds the on and off colors for the container.
|
/// Holds the on and off colors for the container.
|
||||||
public var containerTintColor: (on: UIColor?, off: UIColor?)? = (on: .mvmGreen, off: .black)
|
public var containerTintColor: (on: UIColor?, off: UIColor?)? = (on: .mvmGreen, off: .mvmBlack)
|
||||||
|
|
||||||
/// Holds the on and off colors for the knob.
|
/// Holds the on and off colors for the knob.
|
||||||
public var knobTintColor: (on: UIColor?, off: UIColor?)? = (on: .white, off: .white)
|
public var knobTintColor: (on: UIColor?, off: UIColor?)? = (on: .mvmWhite, off: .mvmWhite)
|
||||||
|
|
||||||
/// Holds the on and off colors for the disabled state..
|
/// Holds the on and off colors for the disabled state..
|
||||||
public var disabledTintColor: (container: UIColor?, knob: UIColor?)? = (container: .mvmCoolGray3, knob: .white)
|
public var disabledTintColor: (container: UIColor?, knob: UIColor?)? = (container: .mvmCoolGray3, knob: .mvmWhite)
|
||||||
|
|
||||||
/// Set this flag to false if you do not want to animate state changes.
|
/// Set this flag to false if you do not want to animate state changes.
|
||||||
public var isAnimated = true
|
public var isAnimated = true
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import UIKit
|
|||||||
/// The bottom border line. Height is dynamic based on scenario.
|
/// The bottom border line. Height is dynamic based on scenario.
|
||||||
public var bottomBar: CAShapeLayer? = {
|
public var bottomBar: CAShapeLayer? = {
|
||||||
let layer = CAShapeLayer()
|
let layer = CAShapeLayer()
|
||||||
layer.backgroundColor = UIColor.black.cgColor
|
layer.backgroundColor = UIColor.mvmBlack.cgColor
|
||||||
layer.drawsAsynchronously = true
|
layer.drawsAsynchronously = true
|
||||||
layer.anchorPoint = CGPoint(x: 0.5, y: 1.0);
|
layer.anchorPoint = CGPoint(x: 0.5, y: 1.0);
|
||||||
return layer
|
return layer
|
||||||
@ -46,7 +46,7 @@ import UIKit
|
|||||||
/// Determines if the top, left, and right borders should be drawn.
|
/// Determines if the top, left, and right borders should be drawn.
|
||||||
private var hideBorders = false
|
private var hideBorders = false
|
||||||
|
|
||||||
public var borderStrokeColor: UIColor = .mfSilver()
|
public var borderStrokeColor: UIColor = .mvmCoolGray3
|
||||||
private var borderPath: UIBezierPath = UIBezierPath()
|
private var borderPath: UIBezierPath = UIBezierPath()
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -210,8 +210,8 @@ import UIKit
|
|||||||
|
|
||||||
isUserInteractionEnabled = true
|
isUserInteractionEnabled = true
|
||||||
hideBorders = false
|
hideBorders = false
|
||||||
borderStrokeColor = .mfSilver()
|
borderStrokeColor = .mvmCoolGray3
|
||||||
bottomBar?.backgroundColor = UIColor.black.cgColor
|
bottomBar?.backgroundColor = UIColor.mvmBlack.cgColor
|
||||||
refreshUI(bottomBarSize: 1)
|
refreshUI(bottomBarSize: 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,8 +219,8 @@ import UIKit
|
|||||||
|
|
||||||
isUserInteractionEnabled = true
|
isUserInteractionEnabled = true
|
||||||
hideBorders = false
|
hideBorders = false
|
||||||
borderStrokeColor = .mfPumpkin()
|
borderStrokeColor = .mvmOrange
|
||||||
bottomBar?.backgroundColor = UIColor.mfPumpkin().cgColor
|
bottomBar?.backgroundColor = UIColor.mvmOrange.cgColor
|
||||||
refreshUI(bottomBarSize: 4)
|
refreshUI(bottomBarSize: 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,8 +228,8 @@ import UIKit
|
|||||||
|
|
||||||
isUserInteractionEnabled = true
|
isUserInteractionEnabled = true
|
||||||
hideBorders = false
|
hideBorders = false
|
||||||
borderStrokeColor = .black
|
borderStrokeColor = .mvmBlack
|
||||||
bottomBar?.backgroundColor = UIColor.mfPumpkin().cgColor
|
bottomBar?.backgroundColor = UIColor.mvmOrange.cgColor
|
||||||
refreshUI(bottomBarSize: 4)
|
refreshUI(bottomBarSize: 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,8 +237,8 @@ import UIKit
|
|||||||
|
|
||||||
isUserInteractionEnabled = true
|
isUserInteractionEnabled = true
|
||||||
hideBorders = false
|
hideBorders = false
|
||||||
borderStrokeColor = .black
|
borderStrokeColor = .mvmBlack
|
||||||
bottomBar?.backgroundColor = UIColor.black.cgColor
|
bottomBar?.backgroundColor = UIColor.mvmBlack.cgColor
|
||||||
refreshUI(bottomBarSize: 1)
|
refreshUI(bottomBarSize: 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,7 +255,7 @@ import UIKit
|
|||||||
|
|
||||||
isUserInteractionEnabled = false
|
isUserInteractionEnabled = false
|
||||||
hideBorders = false
|
hideBorders = false
|
||||||
borderStrokeColor = .mfSilver()
|
borderStrokeColor = .mvmCoolGray3
|
||||||
bottomBar?.backgroundColor = UIColor.mvmCoolGray3.cgColor
|
bottomBar?.backgroundColor = UIColor.mvmCoolGray3.cgColor
|
||||||
refreshUI(bottomBarSize: 1)
|
refreshUI(bottomBarSize: 1)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user