Various Improvements

This commit is contained in:
Ilya Laktyushin
2022-04-23 05:28:29 +04:00
parent e3dc5cbe8a
commit 71bde57b6a
90 changed files with 1757 additions and 297 deletions

View File

@@ -131,6 +131,11 @@ final class RadialDownloadContentNode: RadialStatusContentNode {
rightPath.move(to: CGPoint(x: diameter / 2.0, y: diameter / 2.0 + arrowLength / 2.0 + arrowHeadOffset))
rightPath.addLine(to: CGPoint(x: diameter / 2.0 + arrowHeadSize / 2.0, y: diameter / 2.0 + arrowLength / 2.0 - arrowHeadSize / 2.0 + arrowHeadOffset))
self.rightLine.path = rightPath.cgPath
if self.delayPrepareAnimateIn {
self.delayPrepareAnimateIn = false
self.prepareAnimateIn(from: nil)
}
}
private let duration: Double = 0.2
@@ -181,9 +186,14 @@ final class RadialDownloadContentNode: RadialStatusContentNode {
}
}
private var delayPrepareAnimateIn = false
override func prepareAnimateIn(from: RadialStatusNodeState?) {
let bounds = self.bounds
let diameter = min(bounds.size.width, bounds.size.height)
guard !diameter.isZero else {
self.delayPrepareAnimateIn = true
return
}
let factor = diameter / 50.0
var bodyPath = UIBezierPath()