changes to align with android

This commit is contained in:
Kevin G Christiano 2020-04-16 13:09:27 -04:00
parent f5bc188f95
commit 9299d7d381
2 changed files with 14 additions and 14 deletions

View File

@ -52,7 +52,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
updateUI(previousIndex: previousIndex, updateUI(previousIndex: previousIndex,
newIndex: newIndex, newIndex: newIndex,
totalCount: numberOfPages, totalCount: numberOfPages,
isAnimated: carouselIndicatorModel?.isAnimated ?? true) isAnimated: carouselIndicatorModel?.animated ?? true)
performAction() performAction()
} }
} }
@ -72,7 +72,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
updateUI(previousIndex: previousIndex, updateUI(previousIndex: previousIndex,
newIndex: currentIndex, newIndex: currentIndex,
totalCount: newTotal, totalCount: newTotal,
isAnimated: carouselIndicatorModel?.isAnimated ?? true) isAnimated: carouselIndicatorModel?.animated ?? true)
} }
} }
@ -196,7 +196,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
indicatorColor = model.indicatorColor.uiColor indicatorColor = model.indicatorColor.uiColor
disabledIndicatorColor = model.disabledIndicatorColor.uiColor disabledIndicatorColor = model.disabledIndicatorColor.uiColor
currentIndex = model.currentIndex currentIndex = model.currentIndex
isEnabled = model.isEnabled isEnabled = model.enabled
if let accessibleValue = MVMCoreUIUtility.hardcodedString(withKey: model.accessibilityHasSlidesInsteadOfPage ? "MVMCoreUIPageControlslides_currentpage_index" : "MVMCoreUIPageControl_currentpage_index") { if let accessibleValue = MVMCoreUIUtility.hardcodedString(withKey: model.accessibilityHasSlidesInsteadOfPage ? "MVMCoreUIPageControlslides_currentpage_index" : "MVMCoreUIPageControl_currentpage_index") {
accessibilityValue = String(format: accessibleValue, currentIndex + 1, numberOfPages) accessibilityValue = String(format: accessibleValue, currentIndex + 1, numberOfPages)
@ -220,7 +220,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
func accessibilityAdjust(toPage index: Int) { func accessibilityAdjust(toPage index: Int) {
if (index < numberOfPages && index >= 0) || carouselIndicatorModel?.alwaysSendAction ?? false { if (index < numberOfPages && index >= 0) || carouselIndicatorModel?.alwaysSendAction ?? false {
carouselIndicatorModel?.isAnimated = false carouselIndicatorModel?.animated = false
previousIndex = currentIndex previousIndex = currentIndex
currentIndex = index currentIndex = index
performAction() performAction()

View File

@ -24,11 +24,11 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro
/// Sets the current Index to focus on. /// Sets the current Index to focus on.
public var currentIndex: Int = 0 public var currentIndex: Int = 0
public var isAnimated: Bool = true public var animated: Bool = true
public var hidesForSinglePage: Bool = false 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 /// 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 accessibilityHasSlidesInsteadOfPage: Bool = false
public var isEnabled: Bool = true public var enabled: Bool = true
public var disabledIndicatorColor: Color = Color(uiColor: .mvmCoolGray3) public var disabledIndicatorColor: Color = Color(uiColor: .mvmCoolGray3)
public var indicatorColor: Color = Color(uiColor: .mvmBlack) public var indicatorColor: Color = Color(uiColor: .mvmBlack)
public var position: Float? public var position: Float?
@ -46,10 +46,10 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro
case currentIndex case currentIndex
case numberOfPages case numberOfPages
case alwaysSendAction case alwaysSendAction
case isAnimated case animated
case hidesForSinglePage case hidesForSinglePage
case accessibilityHasSlidesInsteadOfPage case accessibilityHasSlidesInsteadOfPage
case isEnabled case enabled
case disabledIndicatorColor case disabledIndicatorColor
case indicatorColor case indicatorColor
case position case position
@ -76,8 +76,8 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro
self.position = position self.position = position
} }
if let isAnimated = try typeContainer.decodeIfPresent(Bool.self, forKey: .isAnimated) { if let animated = try typeContainer.decodeIfPresent(Bool.self, forKey: .animated) {
self.isAnimated = isAnimated self.animated = animated
} }
if let hidesForSinglePage = try typeContainer.decodeIfPresent(Bool.self, forKey: .hidesForSinglePage) { if let hidesForSinglePage = try typeContainer.decodeIfPresent(Bool.self, forKey: .hidesForSinglePage) {
@ -88,8 +88,8 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro
self.accessibilityHasSlidesInsteadOfPage = accessibilityHasSlidesInsteadOfPage self.accessibilityHasSlidesInsteadOfPage = accessibilityHasSlidesInsteadOfPage
} }
if let isEnabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .isEnabled) { if let enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) {
self.isEnabled = isEnabled self.enabled = enabled
} }
if let disabledIndicatorColor = try typeContainer.decodeIfPresent(Color.self, forKey: .disabledIndicatorColor) { 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(numberOfPages, forKey: .numberOfPages)
try container.encode(currentIndex, forKey: .currentIndex) try container.encode(currentIndex, forKey: .currentIndex)
try container.encode(alwaysSendAction, forKey: .alwaysSendAction) 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(hidesForSinglePage, forKey: .hidesForSinglePage)
try container.encode(accessibilityHasSlidesInsteadOfPage, forKey: .accessibilityHasSlidesInsteadOfPage) 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(disabledIndicatorColor, forKey: .disabledIndicatorColor)
try container.encode(indicatorColor, forKey: .indicatorColor) try container.encode(indicatorColor, forKey: .indicatorColor)
try container.encodeIfPresent(position, forKey: .position) try container.encodeIfPresent(position, forKey: .position)