Various improvements

This commit is contained in:
Ilya Laktyushin
2022-06-11 15:55:01 +04:00
parent eaf6a69cfb
commit 0788e34625
4 changed files with 121 additions and 96 deletions

View File

@@ -808,6 +808,10 @@ public final class SolidRoundedButtonView: UIView {
fatalError("init(coder:) has not been implemented")
}
deinit {
self.animationTimer?.invalidate()
}
private func setupGloss() {
if self.gloss {
if self.shimmerView == nil {
@@ -1002,7 +1006,7 @@ public final class SolidRoundedButtonView: UIView {
compositingFilter = nil
}
let globalTimeOffset = self.icon == nil
let globalTimeOffset = self.icon == nil && self.animation == nil
shimmerView.update(backgroundColor: .clear, foregroundColor: color.withAlphaComponent(alpha), gradientSize: 70.0, globalTimeOffset: globalTimeOffset, duration: 3.0, horizontal: true)
borderShimmerView.update(backgroundColor: .clear, foregroundColor: color.withAlphaComponent(borderAlpha), gradientSize: 70.0, globalTimeOffset: globalTimeOffset, duration: 3.0, horizontal: true)