Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Jimenez committed Jul 26, 2023
1 parent a3331ea commit ce3204b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
12 changes: 8 additions & 4 deletions Example/Example/AnimationListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import SwiftUI

struct AnimationListView: View {

let directory: String
// MARK: Internal

private var isTopLevel: Bool {
directory == "Samples"
}
let directory: String

var body: some View {
List {
Expand Down Expand Up @@ -54,6 +52,12 @@ struct AnimationListView: View {
.navigationTitle(directory)
}

// MARK: Private

private var isTopLevel: Bool {
directory == "Samples"
}

}

extension AnimationListView {
Expand Down
2 changes: 1 addition & 1 deletion Example/Example/AnimationPreviewView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct AnimationPreviewView: View {
.looping()
.currentProgress(animationPlaying ? nil : sliderValue)
.getRealtimeAnimationProgress(animationPlaying ? $sliderValue : nil)

Spacer()

#if !os(tvOS)
Expand Down
4 changes: 2 additions & 2 deletions Example/Example/RemoteAnimationDemoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import SwiftUI

struct RemoteAnimationsDemoView: View {

let wrapInNavStack: Bool

struct Item: Hashable {
let name: String
let url: URL
}

let wrapInNavStack: Bool

var body: some View {
if wrapInNavStack {
NavigationStack {
Expand Down
9 changes: 6 additions & 3 deletions Sources/Private/Model/DotLottie/DotLottieImageProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ class DotLottieImageProvider: AnimationImageProvider {

}

// MARK: Hashable

extension DotLottieImageProvider: Hashable {
static func ==(_ lhs: DotLottieImageProvider, _ rhs: DotLottieImageProvider) -> Bool {
lhs.filepath == rhs.filepath
}

func hash(into hasher: inout Hasher) {
hasher.combine(filepath)
}

static func ==(_ lhs: DotLottieImageProvider, _ rhs: DotLottieImageProvider) -> Bool {
lhs.filepath == rhs.filepath
}
}
22 changes: 11 additions & 11 deletions Sources/Public/Animation/LottieAnimationLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,17 @@ public class LottieAnimationLayer: CALayer {
addNewAnimationForContext(newContext)
}

func loadAnimation(_ animationSource: LottieAnimationSource?) {
switch animationSource {
case .lottieAnimation(let animation):
self.animation = animation
case .dotLottieFile(let dotLottieFile):
loadAnimation(from: dotLottieFile)
case nil:
animation = nil
}
}

// MARK: Fileprivate

fileprivate var _activeAnimationName: String = LottieAnimationLayer.animationName
Expand Down Expand Up @@ -1258,17 +1269,6 @@ public class LottieAnimationLayer: CALayer {
updateRasterizationState()
}

func loadAnimation(_ animationSource: LottieAnimationSource?) {
switch animationSource {
case .lottieAnimation(let animation):
self.animation = animation
case .dotLottieFile(let dotLottieFile):
loadAnimation(from: dotLottieFile)
case nil:
animation = nil
}
}

// MARK: Private

static private let animationName = "Lottie"
Expand Down

0 comments on commit ce3204b

Please sign in to comment.