Refactor disable_animation setting

Pass it down from the top instead of using a function which goes around
our settings store
This commit is contained in:
William Casarin
2023-04-22 12:08:24 -07:00
parent 084c86eb0e
commit 357e8adf86
21 changed files with 74 additions and 44 deletions

View File

@@ -10,7 +10,7 @@ import Kingfisher
extension KFOptionSetter {
func imageContext(_ imageContext: ImageContext) -> Self {
func imageContext(_ imageContext: ImageContext, disable_animation: Bool) -> Self {
options.callbackQueue = .dispatch(.global(qos: .background))
options.processingQueue = .dispatch(.global(qos: .background))
options.downloader = CustomImageDownloader.shared
@@ -26,7 +26,7 @@ extension KFOptionSetter {
options.backgroundDecode = true
options.cacheOriginalImage = true
options.scaleFactor = UIScreen.main.scale
options.onlyLoadFirstFrame = should_disable_image_animation()
options.onlyLoadFirstFrame = disable_animation
return self
}