Skip to content

Commit

Permalink
StaticEnabled property is added
Browse files Browse the repository at this point in the history
  • Loading branch information
Murat Güney authored and Murat Güney committed Feb 26, 2022
1 parent 8fbaba3 commit 40e1392
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ios/Plugin/CapacitorLottieSplashScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extension AnimationEventListener {

private var animationView: AnimationView?
private var isAppLoaded = false
private var isAnimationEnded = false
private var isAnimationEnded = !CapacitorLottieSplashScreenPlugin.isEnabledStatic

public typealias AnimationEventListenerCallback = (AnimationEventListener) -> Void

Expand Down
11 changes: 7 additions & 4 deletions ios/Plugin/CapacitorLottieSplashScreenPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Capacitor

@objc(CapacitorLottieSplashScreenPlugin)
public class CapacitorLottieSplashScreenPlugin: CAPPlugin {
public static var isEnabledStatic = true
private let implementation = CapacitorLottieSplashScreen()


Expand All @@ -14,11 +15,13 @@ public class CapacitorLottieSplashScreenPlugin: CAPPlugin {
}

override public func load() {
let isEnabled = getConfigValue("Enabled") as? Bool ?? true
if(isEnabled) {
implementation.loadLottie(view: self.bridge?.viewController?.view, path: self.getConfigValue("LottieAnimationLocation") as? String)
if(CapacitorLottieSplashScreenPlugin.isEnabledStatic){
let isEnabled = getConfigValue("Enabled") as? Bool ?? true
if(isEnabled) {
implementation.loadLottie(view: self.bridge?.viewController?.view, path: self.getConfigValue("LottieAnimationLocation") as? String)
}
implementation.onAnimationEvent = onAnimationEvent
}
implementation.onAnimationEvent = onAnimationEvent
}

public func onAnimationEvent(event: AnimationEventListener) {
Expand Down

0 comments on commit 40e1392

Please sign in to comment.