From 3fc41843494f5cd01bf65f0d8d0010e64998236c Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Mon, 17 Feb 2020 15:31:10 -0500 Subject: [PATCH] general working order --- .../CarouselIndicator/CarouselIndicator.swift | 4 +++ .../IndicatorViews/BarsIndicatorView.swift | 23 ++++--------- .../IndicatorViews/NumericIndicatorView.swift | 34 ++++--------------- MVMCoreUI/Organisms/Carousel.swift | 2 +- 4 files changed, 19 insertions(+), 44 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/CarouselIndicator/CarouselIndicator.swift b/MVMCoreUI/Atoms/Views/CarouselIndicator/CarouselIndicator.swift index 73e513e3..a5e00d84 100644 --- a/MVMCoreUI/Atoms/Views/CarouselIndicator/CarouselIndicator.swift +++ b/MVMCoreUI/Atoms/Views/CarouselIndicator/CarouselIndicator.swift @@ -235,6 +235,10 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol { let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(swipeLeft)) let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(swipeRight)) + addGestureRecognizer(tap) + addGestureRecognizer(leftSwipe) + addGestureRecognizer(rightSwipe) + uiGestures.insert(tap) uiGestures.insert(leftSwipe) uiGestures.insert(rightSwipe) diff --git a/MVMCoreUI/Atoms/Views/CarouselIndicator/IndicatorViews/BarsIndicatorView.swift b/MVMCoreUI/Atoms/Views/CarouselIndicator/IndicatorViews/BarsIndicatorView.swift index 9f2cb365..cd34003a 100644 --- a/MVMCoreUI/Atoms/Views/CarouselIndicator/IndicatorViews/BarsIndicatorView.swift +++ b/MVMCoreUI/Atoms/Views/CarouselIndicator/IndicatorViews/BarsIndicatorView.swift @@ -17,6 +17,7 @@ open class BarsIndicatorView: View, IndicatorViewProtocol { let stackView: StackView = { let stackView = StackView() stackView.axis = .horizontal + stackView.alignment = .bottom stackView.distribution = .equalSpacing stackView.spacing = 6 stackView.heightAnchor.constraint(lessThanOrEqualToConstant: BarsIndicatorView.indicatorBarHeight.selected).isActive = true @@ -37,22 +38,10 @@ open class BarsIndicatorView: View, IndicatorViewProtocol { return superview as? CarouselIndicator } - public var enabledColor: UIColor { - return parentCarouselIndicator?.indicatorTintColor ?? .mvmBlack - } - - public var currentIndexColor: UIColor { - return parentCarouselIndicator?.currentIndicatorColor ?? .mvmBlack - } - - public var disabledColor: UIColor { - return parentCarouselIndicator?.disabledIndicatorColor ?? .mvmCoolGray3 - } - open var isEnabled: Bool = true { didSet { barReferences.forEach { view, heightConstraint in - view.backgroundColor = isEnabled ? enabledColor : disabledColor + view.backgroundColor = isEnabled ? parentCarouselIndicator?.indicatorTintColor ?? .mvmBlack : parentCarouselIndicator?.disabledIndicatorColor ?? .mvmCoolGray3 } } } @@ -79,6 +68,8 @@ open class BarsIndicatorView: View, IndicatorViewProtocol { addSubview(stackView) isUserInteractionEnabled = false + heightAnchor.constraint(equalToConstant: 4).isActive = true + stackView.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true stackView.leadingAnchor.constraint(greaterThanOrEqualTo: leadingAnchor).isActive = true trailingAnchor.constraint(greaterThanOrEqualTo: stackView.trailingAnchor).isActive = true @@ -99,7 +90,7 @@ open class BarsIndicatorView: View, IndicatorViewProtocol { for i in 0..