From 9299d7d381895141d1712e8da4f2634974fc35eb Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 16 Apr 2020 13:09:27 -0400 Subject: [PATCH] changes to align with android --- .../CarouselIndicator/CarouselIndicator.swift | 8 ++++---- .../CarouselIndicatorModel.swift | 20 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift index a2a31bd6..589bf794 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift @@ -52,7 +52,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol { updateUI(previousIndex: previousIndex, newIndex: newIndex, totalCount: numberOfPages, - isAnimated: carouselIndicatorModel?.isAnimated ?? true) + isAnimated: carouselIndicatorModel?.animated ?? true) performAction() } } @@ -72,7 +72,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol { updateUI(previousIndex: previousIndex, newIndex: currentIndex, totalCount: newTotal, - isAnimated: carouselIndicatorModel?.isAnimated ?? true) + isAnimated: carouselIndicatorModel?.animated ?? true) } } @@ -196,7 +196,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol { indicatorColor = model.indicatorColor.uiColor disabledIndicatorColor = model.disabledIndicatorColor.uiColor currentIndex = model.currentIndex - isEnabled = model.isEnabled + isEnabled = model.enabled if let accessibleValue = MVMCoreUIUtility.hardcodedString(withKey: model.accessibilityHasSlidesInsteadOfPage ? "MVMCoreUIPageControlslides_currentpage_index" : "MVMCoreUIPageControl_currentpage_index") { accessibilityValue = String(format: accessibleValue, currentIndex + 1, numberOfPages) @@ -220,7 +220,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol { func accessibilityAdjust(toPage index: Int) { if (index < numberOfPages && index >= 0) || carouselIndicatorModel?.alwaysSendAction ?? false { - carouselIndicatorModel?.isAnimated = false + carouselIndicatorModel?.animated = false previousIndex = currentIndex currentIndex = index performAction() diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift index e2683f70..a0ac2273 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift @@ -24,11 +24,11 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro /// Sets the current Index to focus on. public var currentIndex: Int = 0 - public var isAnimated: Bool = true + public var animated: Bool = true public var hidesForSinglePage: Bool = false /// Set true to make the accessibility value as "Slide #currentPage of #totalPage", otherwise will be "Page #currentPage of #totalPage", default is false public var accessibilityHasSlidesInsteadOfPage: Bool = false - public var isEnabled: Bool = true + public var enabled: Bool = true public var disabledIndicatorColor: Color = Color(uiColor: .mvmCoolGray3) public var indicatorColor: Color = Color(uiColor: .mvmBlack) public var position: Float? @@ -46,10 +46,10 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro case currentIndex case numberOfPages case alwaysSendAction - case isAnimated + case animated case hidesForSinglePage case accessibilityHasSlidesInsteadOfPage - case isEnabled + case enabled case disabledIndicatorColor case indicatorColor case position @@ -76,8 +76,8 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro self.position = position } - if let isAnimated = try typeContainer.decodeIfPresent(Bool.self, forKey: .isAnimated) { - self.isAnimated = isAnimated + if let animated = try typeContainer.decodeIfPresent(Bool.self, forKey: .animated) { + self.animated = animated } if let hidesForSinglePage = try typeContainer.decodeIfPresent(Bool.self, forKey: .hidesForSinglePage) { @@ -88,8 +88,8 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro self.accessibilityHasSlidesInsteadOfPage = accessibilityHasSlidesInsteadOfPage } - if let isEnabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .isEnabled) { - self.isEnabled = isEnabled + if let enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) { + self.enabled = enabled } if let disabledIndicatorColor = try typeContainer.decodeIfPresent(Color.self, forKey: .disabledIndicatorColor) { @@ -108,10 +108,10 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro try container.encode(numberOfPages, forKey: .numberOfPages) try container.encode(currentIndex, forKey: .currentIndex) try container.encode(alwaysSendAction, forKey: .alwaysSendAction) - try container.encode(isAnimated, forKey: .isAnimated) + try container.encode(animated, forKey: .animated) try container.encode(hidesForSinglePage, forKey: .hidesForSinglePage) try container.encode(accessibilityHasSlidesInsteadOfPage, forKey: .accessibilityHasSlidesInsteadOfPage) - try container.encode(isEnabled, forKey: .isEnabled) + try container.encode(enabled, forKey: .enabled) try container.encode(disabledIndicatorColor, forKey: .disabledIndicatorColor) try container.encode(indicatorColor, forKey: .indicatorColor) try container.encodeIfPresent(position, forKey: .position)