latest
This commit is contained in:
parent
61bc283770
commit
a011eb73a4
@ -98,6 +98,8 @@
|
||||
0A7EF86523D8AFFF00B2AAD1 /* ItemDropdownEntryFieldModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7EF86423D8AFFF00B2AAD1 /* ItemDropdownEntryFieldModel.swift */; };
|
||||
0A7EF86723D8B0AE00B2AAD1 /* DateDropdownEntryFieldModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A7EF86623D8B0AE00B2AAD1 /* DateDropdownEntryFieldModel.swift */; };
|
||||
0AA33B3A2398524F0067DD0F /* Toggle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AA33B392398524F0067DD0F /* Toggle.swift */; };
|
||||
0AAF8E2A240EA57D008DD263 /* BarsCarouselIndicatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AAF8E29240EA57D008DD263 /* BarsCarouselIndicatorModel.swift */; };
|
||||
0AAF8E2C240EA594008DD263 /* NumericCarouselIndicatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AAF8E2B240EA594008DD263 /* NumericCarouselIndicatorModel.swift */; };
|
||||
0ABD136D237CAD1E0081388D /* DateDropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABD136C237CAD1E0081388D /* DateDropdownEntryField.swift */; };
|
||||
0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ABD1370237DB0450081388D /* ItemDropdownEntryField.swift */; };
|
||||
0AE14F64238315D2005417F8 /* TextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AE14F63238315D2005417F8 /* TextField.swift */; };
|
||||
@ -450,6 +452,8 @@
|
||||
0A8321AE2355FE9500CB7F00 /* DigitBox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DigitBox.swift; sourceTree = "<group>"; };
|
||||
0AA33B33239813C50067DD0F /* UIColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extension.swift"; sourceTree = "<group>"; };
|
||||
0AA33B392398524F0067DD0F /* Toggle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toggle.swift; sourceTree = "<group>"; };
|
||||
0AAF8E29240EA57D008DD263 /* BarsCarouselIndicatorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BarsCarouselIndicatorModel.swift; sourceTree = "<group>"; };
|
||||
0AAF8E2B240EA594008DD263 /* NumericCarouselIndicatorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumericCarouselIndicatorModel.swift; sourceTree = "<group>"; };
|
||||
0ABD136C237CAD1E0081388D /* DateDropdownEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateDropdownEntryField.swift; sourceTree = "<group>"; };
|
||||
0ABD1370237DB0450081388D /* ItemDropdownEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemDropdownEntryField.swift; sourceTree = "<group>"; };
|
||||
0AE14F63238315D2005417F8 /* TextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextField.swift; sourceTree = "<group>"; };
|
||||
@ -791,20 +795,14 @@
|
||||
0A14F6B023E8C27A00EDF7F7 /* CarouselIndicator */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0A14F6B723ECA7F900EDF7F7 /* IndicatorViews */,
|
||||
0A14F69223E349EF00EDF7F7 /* CarouselIndicator.swift */,
|
||||
0A14F6A823E8750300EDF7F7 /* CarouselIndicatorModel.swift */,
|
||||
);
|
||||
path = CarouselIndicator;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0A14F6B723ECA7F900EDF7F7 /* IndicatorViews */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0AAF8E29240EA57D008DD263 /* BarsCarouselIndicatorModel.swift */,
|
||||
0A4253AE23F5C2C000554656 /* BarsIndicatorView.swift */,
|
||||
0AAF8E2B240EA594008DD263 /* NumericCarouselIndicatorModel.swift */,
|
||||
0A14F6B323E8C29700EDF7F7 /* NumericIndicatorView.swift */,
|
||||
);
|
||||
path = IndicatorViews;
|
||||
path = CarouselIndicator;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0A5D59C323AD488600EFD9E9 /* Protocols */ = {
|
||||
@ -1096,7 +1094,6 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
525019E3240684E500EED91C /* FourColumn */,
|
||||
52267A0523FFE0A900906CBA /* OneColumn */,
|
||||
D22B38ED23F4E11100490EF6 /* ThreeColumn */,
|
||||
);
|
||||
path = SectionDividers;
|
||||
@ -1810,6 +1807,7 @@
|
||||
0103B84E23D7E33A009C315C /* HeadlineBodyToggleModel.swift in Sources */,
|
||||
D2755D7B23689C7500485468 /* TableViewCell.swift in Sources */,
|
||||
0A21DB85235E06EF00C160A2 /* MFTextField.m in Sources */,
|
||||
0AAF8E2C240EA594008DD263 /* NumericCarouselIndicatorModel.swift in Sources */,
|
||||
014AA72623C501E2006F3E93 /* ContainerModelProtocol.swift in Sources */,
|
||||
AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */,
|
||||
01EB369223609801006832FA /* MoleculeStackModel.swift in Sources */,
|
||||
@ -1995,6 +1993,7 @@
|
||||
C6FA7D5223C77A4A00A3614A /* UnOrderedList.swift in Sources */,
|
||||
01509D8F2327EC6F00EF99AA /* MoleculeTableViewCell.swift in Sources */,
|
||||
0105618D224BBE7700E1557D /* FormValidator.swift in Sources */,
|
||||
0AAF8E2A240EA57D008DD263 /* BarsCarouselIndicatorModel.swift in Sources */,
|
||||
01509D912327ECE600EF99AA /* CornerLabels.swift in Sources */,
|
||||
D22D1F1B220341F60077CEC0 /* MVMCoreUICheckBox.m in Sources */,
|
||||
C695A69823C990C200BFB94E /* DoughnutChartView.swift in Sources */,
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
//
|
||||
// BarsCarouselIndicatorModel.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Kevin Christiano on 3/3/20.
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
/*
|
||||
open class BarsCarouselIndicatorModel: CarouselIndicatorModel {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//--------------------------------------------------
|
||||
|
||||
public class var identifier: String {
|
||||
return "barsCarouselIndicator"
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Keys
|
||||
//--------------------------------------------------
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case moleculeName
|
||||
case backgroundColor
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Codec
|
||||
//--------------------------------------------------
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
@ -9,7 +9,7 @@
|
||||
import UIKit
|
||||
|
||||
|
||||
open class BarsIndicatorView: View, IndicatorViewProtocol {
|
||||
open class BarsIndicatorView: CarouselIndicator {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Stored Properties
|
||||
//--------------------------------------------------
|
||||
@ -37,15 +37,15 @@ open class BarsIndicatorView: View, IndicatorViewProtocol {
|
||||
public var parentCarouselIndicator: CarouselIndicator? {
|
||||
return superview as? CarouselIndicator
|
||||
}
|
||||
|
||||
open var isEnabled: Bool = true {
|
||||
didSet {
|
||||
barReferences.forEach { view, heightConstraint in
|
||||
view.backgroundColor = isEnabled ? parentCarouselIndicator?.indicatorTintColor ?? .mvmBlack : parentCarouselIndicator?.disabledIndicatorColor ?? .mvmCoolGray3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// open override var isEnabled: Bool = true {
|
||||
// didSet {
|
||||
// barReferences.forEach { view, heightConstraint in
|
||||
// view.backgroundColor = isEnabled ? parentCarouselIndicator?.indicatorTintColor ?? .mvmBlack : parentCarouselIndicator?.disabledIndicatorColor ?? .mvmCoolGray3
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
//--------------------------------------------------
|
||||
@ -89,7 +89,7 @@ open class BarsIndicatorView: View, IndicatorViewProtocol {
|
||||
for i in 0..<numberOfPages {
|
||||
let bar = View()
|
||||
bar.widthAnchor.constraint(equalToConstant: BarsIndicatorView.indicatorBarWidth).isActive = true
|
||||
bar.backgroundColor = isEnabled ? parentCarouselIndicator?.indicatorTintColor ?? .mvmBlack : parentCarouselIndicator?.disabledIndicatorColor ?? .mvmCoolGray3
|
||||
// bar.backgroundColor = isEnabled ? parentCarouselIndicator?.indicatorTintColor ?? .mvmBlack : parentCarouselIndicator?.disabledIndicatorColor ?? .mvmCoolGray3
|
||||
let barHeight = i == currentIndex ? BarsIndicatorView.indicatorBarHeight.selected : BarsIndicatorView.indicatorBarHeight.unselected
|
||||
let heightConstraint = bar.heightAnchor.constraint(equalToConstant: barHeight)
|
||||
heightConstraint.isActive = true
|
||||
@ -9,11 +9,11 @@
|
||||
import Foundation
|
||||
|
||||
/// Set protocols for all indicator faces of the Carousel Indicator.
|
||||
public protocol IndicatorViewProtocol {
|
||||
func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool)
|
||||
func reset()
|
||||
var isEnabled: Bool { get set }
|
||||
}
|
||||
//public protocol IndicatorViewProtocol {
|
||||
// func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool)
|
||||
// func reset()
|
||||
// var isEnabled: Bool { get set }
|
||||
//}
|
||||
|
||||
|
||||
open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
@ -21,7 +21,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
// MARK: - Outlets
|
||||
//--------------------------------------------------
|
||||
|
||||
public typealias IndicatorView = UIView & IndicatorViewProtocol
|
||||
// public typealias IndicatorView = UIView & IndicatorViewProtocol
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Constraints
|
||||
@ -35,21 +35,21 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
//--------------------------------------------------
|
||||
|
||||
/// The types of indicators that can appear.
|
||||
public enum IndicatorType: String {
|
||||
case bars
|
||||
case numeric
|
||||
case hybrid // bar & numeric
|
||||
}
|
||||
// public enum IndicatorType: String {
|
||||
// case bars
|
||||
// case numeric
|
||||
// case hybrid // bar & numeric
|
||||
// }
|
||||
|
||||
/// Determines interactivity and appearance of the indicator.
|
||||
public var indicatorType: IndicatorType = .hybrid {
|
||||
didSet { assignIndicatorView() }
|
||||
}
|
||||
// public var indicatorType: IndicatorType = .hybrid {
|
||||
// didSet { assignIndicatorView() }
|
||||
// }
|
||||
|
||||
public var uiGestures: Set<UIGestureRecognizer> = []
|
||||
|
||||
/// The currently active indicator view.
|
||||
public var currentIndicator: IndicatorView?
|
||||
// public var currentIndicator: IndicatorView?
|
||||
|
||||
/// Convenience to access the model.
|
||||
public var carouselIndicatorModel: CarouselIndicatorModel? {
|
||||
@ -57,25 +57,25 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
}
|
||||
|
||||
/// The view control relative to the state of the indicator type.
|
||||
private(set) var indicatorView: IndicatorView? {
|
||||
willSet { indicatorView?.removeFromSuperview() }
|
||||
didSet {
|
||||
indicatorView?.removeFromSuperview()
|
||||
|
||||
guard let indicatorView = indicatorView else { return }
|
||||
addSubview(indicatorView)
|
||||
|
||||
topConstraint = indicatorView.topAnchor.constraint(equalTo: topAnchor, constant: PaddingTwo)
|
||||
topConstraint?.isActive = true
|
||||
|
||||
bottomConstraint = bottomAnchor.constraint(equalTo: indicatorView.bottomAnchor, constant: PaddingTwo)
|
||||
bottomConstraint?.isActive = true
|
||||
|
||||
indicatorView.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
||||
trailingAnchor.constraint(equalTo: indicatorView.trailingAnchor).isActive = true
|
||||
updateUI()
|
||||
}
|
||||
}
|
||||
// private(set) var indicatorView: IndicatorView? {
|
||||
// willSet { indicatorView?.removeFromSuperview() }
|
||||
// didSet {
|
||||
// indicatorView?.removeFromSuperview()
|
||||
//
|
||||
// guard let indicatorView = indicatorView else { return }
|
||||
// addSubview(indicatorView)
|
||||
//
|
||||
// topConstraint = indicatorView.topAnchor.constraint(equalTo: topAnchor, constant: PaddingTwo)
|
||||
// topConstraint?.isActive = true
|
||||
//
|
||||
// bottomConstraint = bottomAnchor.constraint(equalTo: indicatorView.bottomAnchor, constant: PaddingTwo)
|
||||
// bottomConstraint?.isActive = true
|
||||
//
|
||||
// indicatorView.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
||||
// trailingAnchor.constraint(equalTo: indicatorView.trailingAnchor).isActive = true
|
||||
// updateUI()
|
||||
// }
|
||||
// }
|
||||
|
||||
/// Set this closure to perform an action when a different indicator was selected.
|
||||
/// Passes through oldInde and newIndex, respectively.
|
||||
@ -84,7 +84,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
public override var isEnabled: Bool {
|
||||
didSet {
|
||||
isUserInteractionEnabled = isEnabled
|
||||
indicatorView?.isEnabled = isEnabled
|
||||
// indicatorView?.isEnabled = isEnabled
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,9 +118,9 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
|
||||
isHidden = carouselIndicatorModel?.hidesForSinglePage ?? false && newTotal <= 1
|
||||
|
||||
if isBarIndicator() {
|
||||
(indicatorView as? BarsIndicatorView)?.generateBars()
|
||||
}
|
||||
// if isBarIndicator() {
|
||||
// (indicatorView as? BarsIndicatorView)?.generateBars()
|
||||
// }
|
||||
|
||||
updateUI()
|
||||
}
|
||||
@ -135,11 +135,11 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
set (newColor) {
|
||||
carouselIndicatorModel?.indicatorColor = Color(uiColor: newColor)
|
||||
|
||||
if isBarIndicator(), let barIndicator = indicatorView as? BarsIndicatorView {
|
||||
for (i, barTuple) in barIndicator.barReferences.enumerated() where i != currentIndex {
|
||||
barTuple.view.backgroundColor = newColor
|
||||
}
|
||||
}
|
||||
// if isBarIndicator(), let barIndicator = indicatorView as? BarsIndicatorView {
|
||||
// for (i, barTuple) in barIndicator.barReferences.enumerated() where i != currentIndex {
|
||||
// barTuple.view.backgroundColor = newColor
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,11 +152,11 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
_currentIndicatorColor = newColor
|
||||
carouselIndicatorModel?.currentIndicatorColor = Color(uiColor: newColor)
|
||||
|
||||
if isBarIndicator() {
|
||||
if let barIndicator = indicatorView as? BarsIndicatorView, !barIndicator.barReferences.isEmpty {
|
||||
barIndicator.barReferences[currentIndex].view.backgroundColor = newColor
|
||||
}
|
||||
}
|
||||
// if isBarIndicator() {
|
||||
// if let barIndicator = indicatorView as? BarsIndicatorView, !barIndicator.barReferences.isEmpty {
|
||||
// barIndicator.barReferences[currentIndex].view.backgroundColor = newColor
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -172,10 +172,10 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
self.init(frame: .zero)
|
||||
}
|
||||
|
||||
public init(indicatorType: IndicatorType) {
|
||||
self.indicatorType = indicatorType
|
||||
super.init(frame: .zero)
|
||||
}
|
||||
// public init(indicatorType: IndicatorType) {
|
||||
// self.indicatorType = indicatorType
|
||||
// super.init(frame: .zero)
|
||||
// }
|
||||
|
||||
required public init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
@ -195,7 +195,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
open override func setupView() {
|
||||
super.setupView()
|
||||
|
||||
assignIndicatorView()
|
||||
// assignIndicatorView()
|
||||
setupGestures()
|
||||
}
|
||||
|
||||
@ -245,17 +245,17 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
let touchPoint = tapGesture?.location(in: self)
|
||||
let touchPoint_X = touchPoint?.x ?? 0.0
|
||||
|
||||
if isBarIndicator(), let bars = (indicatorView as? BarsIndicatorView)?.barReferences {
|
||||
currentIndex = bars.firstIndex { $0.0.frame.maxX >= touchPoint_X && $0.0.frame.minX <= touchPoint_X } ?? 0
|
||||
|
||||
} else {
|
||||
// Determine which half of the view was touched.
|
||||
if touchPoint_X > bounds.width / 2 {
|
||||
incrementCurrentIndex()
|
||||
} else {
|
||||
decrementCurrentIndex()
|
||||
}
|
||||
}
|
||||
// if isBarIndicator(), let bars = (indicatorView as? BarsIndicatorView)?.barReferences {
|
||||
// currentIndex = bars.firstIndex { $0.0.frame.maxX >= touchPoint_X && $0.0.frame.minX <= touchPoint_X } ?? 0
|
||||
//
|
||||
// } else {
|
||||
// // Determine which half of the view was touched.
|
||||
// if touchPoint_X > bounds.width / 2 {
|
||||
// incrementCurrentIndex()
|
||||
// } else {
|
||||
// decrementCurrentIndex()
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -264,10 +264,10 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
|
||||
public func updateUI() {
|
||||
|
||||
indicatorView?.updateUI(previousIndex: previousIndex,
|
||||
newIndex: currentIndex,
|
||||
totalCount: numberOfPages,
|
||||
isAnimated: carouselIndicatorModel?.isAnimated ?? true)
|
||||
// indicatorView?.updateUI(previousIndex: previousIndex,
|
||||
// newIndex: currentIndex,
|
||||
// totalCount: numberOfPages,
|
||||
// isAnimated: carouselIndicatorModel?.isAnimated ?? true)
|
||||
}
|
||||
|
||||
public func performAction() {
|
||||
@ -277,25 +277,25 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
}
|
||||
|
||||
/// Sets the indicatorView based on the current indicatorType.
|
||||
func assignIndicatorView() {
|
||||
|
||||
switch indicatorType {
|
||||
case .bars:
|
||||
indicatorView = BarsIndicatorView()
|
||||
|
||||
case .numeric:
|
||||
indicatorView = NumericIndicatorView()
|
||||
|
||||
case .hybrid:
|
||||
|
||||
indicatorView = numberOfPages >= carouselIndicatorModel?.hybridThreshold ?? 0 ? NumericIndicatorView() : BarsIndicatorView()
|
||||
}
|
||||
}
|
||||
// func assignIndicatorView() {
|
||||
//
|
||||
// switch indicatorType {
|
||||
// case .bars:
|
||||
// indicatorView = BarsIndicatorView()
|
||||
//
|
||||
// case .numeric:
|
||||
// indicatorView = NumericIndicatorView()
|
||||
//
|
||||
// case .hybrid:
|
||||
//
|
||||
// indicatorView = numberOfPages >= carouselIndicatorModel?.hybridThreshold ?? 0 ? NumericIndicatorView() : BarsIndicatorView()
|
||||
// }
|
||||
// }
|
||||
|
||||
/// Convenience to determine if current view is displaying bars.
|
||||
func isBarIndicator() -> Bool {
|
||||
return indicatorType == .bars || indicatorType == .hybrid && numberOfPages <= carouselIndicatorModel?.hybridThreshold ?? 5
|
||||
}
|
||||
// func isBarIndicator() -> Bool {
|
||||
// return indicatorType == .bars || indicatorType == .hybrid && numberOfPages <= carouselIndicatorModel?.hybridThreshold ?? 5
|
||||
// }
|
||||
|
||||
public func scrollViewDidScroll(_ collectionView: UICollectionView) { }
|
||||
|
||||
@ -309,7 +309,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
|
||||
super.set(with: model, delegateObject, additionalData)
|
||||
|
||||
indicatorType = IndicatorType(rawValue: model.type) ?? .hybrid
|
||||
// indicatorType = IndicatorType(rawValue: model.type) ?? .hybrid
|
||||
currentIndicatorColor = model.currentIndicatorColor.uiColor
|
||||
indicatorTintColor = model.indicatorColor.uiColor
|
||||
isEnabled = model.isEnabled
|
||||
|
||||
@ -14,8 +14,8 @@ public class CarouselIndicatorModel: CarouselPagingModelProtocol {
|
||||
// MARK: - Properties
|
||||
//--------------------------------------------------
|
||||
|
||||
public static var identifier: String {
|
||||
return "carouselIndicator"
|
||||
public class var identifier: String {
|
||||
return ""
|
||||
}
|
||||
|
||||
public var backgroundColor: Color?
|
||||
@ -23,7 +23,7 @@ public class CarouselIndicatorModel: CarouselPagingModelProtocol {
|
||||
public var type: String = "hybrid"
|
||||
|
||||
/// The maxmum count of pages before the indicatorView forces a Numeric Indicator in place of Bar.
|
||||
public var hybridThreshold: Int = 5
|
||||
// public var hybridThreshold: Int = 5
|
||||
public var numberOfPages: Int = 0
|
||||
public var isAnimated: Bool = true
|
||||
public var hidesForSinglePage: Bool = false
|
||||
@ -46,7 +46,7 @@ public class CarouselIndicatorModel: CarouselPagingModelProtocol {
|
||||
case moleculeName
|
||||
case backgroundColor
|
||||
case type
|
||||
case hybridThreshold
|
||||
// case hybridThreshold
|
||||
case numberOfPages
|
||||
case alwaysSendAction
|
||||
case isAnimated
|
||||
@ -72,9 +72,9 @@ public class CarouselIndicatorModel: CarouselPagingModelProtocol {
|
||||
self.type = type
|
||||
}
|
||||
|
||||
if let hybridThreshold = try typeContainer.decodeIfPresent(Int.self, forKey: .hybridThreshold) {
|
||||
self.hybridThreshold = hybridThreshold
|
||||
}
|
||||
// if let hybridThreshold = try typeContainer.decodeIfPresent(Int.self, forKey: .hybridThreshold) {
|
||||
// self.hybridThreshold = hybridThreshold
|
||||
// }
|
||||
|
||||
if let numberOfPages = try typeContainer.decodeIfPresent(Int.self, forKey: .numberOfPages) {
|
||||
self.numberOfPages = numberOfPages
|
||||
@ -122,7 +122,7 @@ public class CarouselIndicatorModel: CarouselPagingModelProtocol {
|
||||
try container.encode(moleculeName, forKey: .moleculeName)
|
||||
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
|
||||
try container.encodeIfPresent(type, forKey: .type)
|
||||
try container.encodeIfPresent(hybridThreshold, forKey: .hybridThreshold)
|
||||
// try container.encodeIfPresent(hybridThreshold, forKey: .hybridThreshold)
|
||||
try container.encodeIfPresent(numberOfPages, forKey: .numberOfPages)
|
||||
try container.encodeIfPresent(alwaysSendAction, forKey: .alwaysSendAction)
|
||||
try container.encodeIfPresent(isAnimated, forKey: .isAnimated)
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
//
|
||||
// NumericCarouselIndicatorModel.swift
|
||||
// MVMCoreUI
|
||||
//
|
||||
// Created by Kevin Christiano on 3/3/20.
|
||||
// Copyright © 2020 Verizon Wireless. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
/*
|
||||
class NumericCarouselIndicatorModel: CarouselIndicatorModel {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//--------------------------------------------------
|
||||
|
||||
public class var identifier: String {
|
||||
return "numericCarouselIndicator"
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Keys
|
||||
//--------------------------------------------------
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Codec
|
||||
//--------------------------------------------------
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||
|
||||
}
|
||||
|
||||
public override func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
@ -9,7 +9,7 @@
|
||||
import UIKit
|
||||
|
||||
|
||||
open class NumericIndicatorView: View, IndicatorViewProtocol {
|
||||
open class NumericIndicatorView: CarouselIndicator {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Outlets
|
||||
//--------------------------------------------------
|
||||
@ -42,15 +42,15 @@ open class NumericIndicatorView: View, IndicatorViewProtocol {
|
||||
return superview as? CarouselIndicator
|
||||
}
|
||||
|
||||
open var isEnabled: Bool = true {
|
||||
didSet {
|
||||
let enabledColor = parentCarouselIndicator?.indicatorTintColor ?? .mvmBlack
|
||||
let disabledColor = parentCarouselIndicator?.disabledIndicatorColor ?? .mvmCoolGray3
|
||||
pageCount.textColor = isEnabled ? enabledColor : disabledColor
|
||||
leftArrow.tintColor = isEnabled ? enabledColor : disabledColor
|
||||
rightArrow.tintColor = isEnabled ? enabledColor : disabledColor
|
||||
}
|
||||
}
|
||||
// open var isEnabled: Bool = true {
|
||||
// didSet {
|
||||
// let enabledColor = parentCarouselIndicator?.indicatorTintColor ?? .mvmBlack
|
||||
// let disabledColor = parentCarouselIndicator?.disabledIndicatorColor ?? .mvmCoolGray3
|
||||
// pageCount.textColor = isEnabled ? enabledColor : disabledColor
|
||||
// leftArrow.tintColor = isEnabled ? enabledColor : disabledColor
|
||||
// rightArrow.tintColor = isEnabled ? enabledColor : disabledColor
|
||||
// }
|
||||
// }
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
Loading…
Reference in New Issue
Block a user