changes to align with android
This commit is contained in:
parent
f5bc188f95
commit
9299d7d381
@ -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()
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user