mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Profile preview
This commit is contained in:
@@ -9,6 +9,7 @@ import ComponentFlow
|
||||
public final class SliderComponent: Component {
|
||||
public let valueCount: Int
|
||||
public let value: Int
|
||||
public let markPositions: Bool
|
||||
public let trackBackgroundColor: UIColor
|
||||
public let trackForegroundColor: UIColor
|
||||
public let valueUpdated: (Int) -> Void
|
||||
@@ -17,6 +18,7 @@ public final class SliderComponent: Component {
|
||||
public init(
|
||||
valueCount: Int,
|
||||
value: Int,
|
||||
markPositions: Bool,
|
||||
trackBackgroundColor: UIColor,
|
||||
trackForegroundColor: UIColor,
|
||||
valueUpdated: @escaping (Int) -> Void,
|
||||
@@ -24,6 +26,7 @@ public final class SliderComponent: Component {
|
||||
) {
|
||||
self.valueCount = valueCount
|
||||
self.value = value
|
||||
self.markPositions = markPositions
|
||||
self.trackBackgroundColor = trackBackgroundColor
|
||||
self.trackForegroundColor = trackForegroundColor
|
||||
self.valueUpdated = valueUpdated
|
||||
@@ -37,6 +40,9 @@ public final class SliderComponent: Component {
|
||||
if lhs.value != rhs.value {
|
||||
return false
|
||||
}
|
||||
if lhs.markPositions != rhs.markPositions {
|
||||
return false
|
||||
}
|
||||
if lhs.trackBackgroundColor != rhs.trackBackgroundColor {
|
||||
return false
|
||||
}
|
||||
@@ -97,6 +103,7 @@ public final class SliderComponent: Component {
|
||||
sliderView.maximumValue = CGFloat(component.valueCount - 1)
|
||||
sliderView.positionsCount = component.valueCount
|
||||
sliderView.useLinesForPositions = true
|
||||
sliderView.markPositions = component.markPositions
|
||||
|
||||
sliderView.backgroundColor = nil
|
||||
sliderView.isOpaque = false
|
||||
|
||||
Reference in New Issue
Block a user