Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(animation): Sometime animations does not start #302

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class NVActivityIndicatorAnimationBallBeat: NVActivityIndicatorAnimationDelegate
let x = (layer.bounds.size.width - size.width) / 2
let y = (layer.bounds.size.height - circleSize) / 2
let duration: CFTimeInterval = 0.7
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes = [0.35, 0, 0.35]

// Scale animation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class NVActivityIndicatorAnimationBallGridBeat: NVActivityIndicatorAnimationDele
let x = (layer.bounds.size.width - size.width) / 2
let y = (layer.bounds.size.height - size.height) / 2
let durations = [0.96, 0.93, 1.19, 1.13, 1.34, 0.94, 1.2, 0.82, 1.19]
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes = [0.36, 0.4, 0.68, 0.41, 0.71, -0.15, -0.12, 0.01, 0.32]
#if swift(>=4.2)
let timingFunction = CAMediaTimingFunction(name: .default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class NVActivityIndicatorAnimationBallGridPulse: NVActivityIndicatorAnimationDel
let x = (layer.bounds.size.width - size.width) / 2
let y = (layer.bounds.size.height - size.height) / 2
let durations: [CFTimeInterval] = [0.72, 1.02, 1.28, 1.42, 1.45, 1.18, 0.87, 1.45, 1.06]
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes: [CFTimeInterval] = [ -0.06, 0.25, -0.17, 0.48, 0.31, 0.03, 0.46, 0.78, 0.45]
#if swift(>=4.2)
let timingFunction = CAMediaTimingFunction(name: .default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class NVActivityIndicatorAnimationBallPulse: NVActivityIndicatorAnimationDelegat
let x: CGFloat = (layer.bounds.size.width - size.width) / 2
let y: CGFloat = (layer.bounds.size.height - circleSize) / 2
let duration: CFTimeInterval = 0.75
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes: [CFTimeInterval] = [0.12, 0.24, 0.36]
let timingFunction = CAMediaTimingFunction(controlPoints: 0.2, 0.68, 0.18, 1.08)
let animation = CAKeyframeAnimation(keyPath: "transform.scale")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class NVActivityIndicatorAnimationBallPulseSync: NVActivityIndicatorAnimationDel
let y = (layer.bounds.size.height - circleSize) / 2
let deltaY = (size.height / 2 - circleSize / 2) / 2
let duration: CFTimeInterval = 0.6
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes: [CFTimeInterval] = [0.07, 0.14, 0.21]
#if swift(>=4.2)
let timingFunciton = CAMediaTimingFunction(name: .easeInEaseOut)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class NVActivityIndicatorAnimationBallScaleMultiple: NVActivityIndicatorAnimatio

func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) {
let duration: CFTimeInterval = 1
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes = [0, 0.2, 0.4]

// Scale animation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class NVActivityIndicatorAnimationBallScaleRippleMultiple: NVActivityIndicatorAn

func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) {
let duration: CFTimeInterval = 1.25
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes = [0, 0.2, 0.4]
let timingFunction = CAMediaTimingFunction(controlPoints: 0.21, 0.53, 0.56, 0.8)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class NVActivityIndicatorAnimationBallSpinFadeLoader: NVActivityIndicatorAnimati
let x = (layer.bounds.size.width - size.width) / 2
let y = (layer.bounds.size.height - size.height) / 2
let duration: CFTimeInterval = 1
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes: [CFTimeInterval] = [0, 0.12, 0.24, 0.36, 0.48, 0.6, 0.72, 0.84]

// Scale animation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class NVActivityIndicatorAnimationCubeTransition: NVActivityIndicatorAnimationDe
let deltaX = size.width - squareSize
let deltaY = size.height - squareSize
let duration: CFTimeInterval = 1.6
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes: [CFTimeInterval] = [0, -0.8]
#if swift(>=4.2)
let timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class NVActivityIndicatorAnimationLineScale: NVActivityIndicatorAnimationDelegat
let x = (layer.bounds.size.width - size.width) / 2
let y = (layer.bounds.size.height - size.height) / 2
let duration: CFTimeInterval = 1
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes = [0.1, 0.2, 0.3, 0.4, 0.5]
let timingFunction = CAMediaTimingFunction(controlPoints: 0.2, 0.68, 0.18, 1.08)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class NVActivityIndicatorAnimationLineScaleParty: NVActivityIndicatorAnimationDe
let x = (layer.bounds.size.width - size.width) / 2
let y = (layer.bounds.size.height - size.height) / 2
let durations: [CFTimeInterval] = [1.26, 0.43, 1.01, 0.73]
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes: [CFTimeInterval] = [0.77, 0.29, 0.28, 0.74]
#if swift(>=4.2)
let timingFunction = CAMediaTimingFunction(name: .default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class NVActivityIndicatorAnimationLineScalePulseOut: NVActivityIndicatorAnimatio
let x = (layer.bounds.size.width - size.width) / 2
let y = (layer.bounds.size.height - size.height) / 2
let duration: CFTimeInterval = 1
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes = [0.4, 0.2, 0, 0.2, 0.4]
let timingFunction = CAMediaTimingFunction(controlPoints: 0.85, 0.25, 0.37, 0.85)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class NVActivityIndicatorAnimationLineScalePulseOutRapid: NVActivityIndicatorAni
let x = (layer.bounds.size.width - size.width) / 2
let y = (layer.bounds.size.height - size.height) / 2
let duration: CFTimeInterval = 0.9
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes = [0.5, 0.25, 0, 0.25, 0.5]
let timingFunction = CAMediaTimingFunction(controlPoints: 0.11, 0.49, 0.38, 0.78)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class NVActivityIndicatorAnimationLineSpinFadeLoader: NVActivityIndicatorAnimati
let x = (layer.bounds.size.width - size.width) / 2
let y = (layer.bounds.size.height - size.height) / 2
let duration: CFTimeInterval = 1.2
let beginTime = CACurrentMediaTime()
let beginTime = layer.convertTime(CACurrentMediaTime(), from: nil)
let beginTimes: [CFTimeInterval] = [0.12, 0.24, 0.36, 0.48, 0.6, 0.72, 0.84, 0.96]
#if swift(>=4.2)
let timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
Expand Down