LaunchLoading: Fix animation theming and repeat count.

This commit is contained in:
SBiOSoftWhare
2020-07-10 22:27:22 +02:00
parent 2cba693e20
commit b45dfb0104
2 changed files with 21 additions and 15 deletions
@@ -20,25 +20,37 @@ import Reusable
@objcMembers
final class LaunchLoadingView: UIView, NibLoadable, Themable {
// MARK: - Constants
private enum LaunchAnimation {
static let duration: TimeInterval = 3.0
static let repeatCount = Float.greatestFiniteMagnitude
}
// MARK: - Properties
@IBOutlet private weak var animationView: ElementView!
@IBOutlet private weak var activityIndicatorView: UIActivityIndicatorView!
private var animationTimeline: Timeline_1!
// MARK: - Setup
static func instantiate() -> LaunchLoadingView {
let view = LaunchLoadingView.loadFromNib()
let timeline = Timeline_1(view: view.animationView, duration: 3)
timeline.play()
return view
}
override func awakeFromNib() {
super.awakeFromNib()
let animationTimeline = Timeline_1(view: self.animationView, duration: LaunchAnimation.duration, repeatCount: LaunchAnimation.repeatCount)
animationTimeline.play()
self.animationTimeline = animationTimeline
}
// MARK: - Public
func update(theme: Theme) {
//self.backgroundColor = theme.backgroundColor
//self.logoImageView.tintColor = theme.tintColor
//self.activityIndicatorView.color = theme.tabBarUnselectedItemTintColor
self.backgroundColor = theme.backgroundColor
self.animationView.backgroundColor = theme.backgroundColor
}
}