Commit ba3c8c9d authored by Steven杜宇's avatar Steven杜宇

// 更换GIF播放第三方库

parent f471abf5
......@@ -81,10 +81,10 @@ target 'galaxy' do
pod 'BMPlayer', '1.3.0'
#高斯模糊
pod 'VisualEffectView', '4.1.5'
#GIF图播放
pod 'FLAnimatedImage', '1.0.17'
#动画框架
pod 'lottie-ios', '4.4.0'
#GIF图播放
pod 'YYImage', '1.0.4'
end
......
......@@ -8,7 +8,7 @@
import UIKit
import AttributedString
import FLAnimatedImage
import YYImage
class YHSubmitAllInfoSuccessAlertView: UIView {
......@@ -42,33 +42,17 @@ class YHSubmitAllInfoSuccessAlertView: UIView {
return imagV
}()
lazy var headImgV: FLAnimatedImageView = {
let imgV = FLAnimatedImageView()
let url = Bundle.main.url(forResource: "submit_head_animation", withExtension: "gif")!
if let animatedImage = try? FLAnimatedImage(animatedGIFData: Data(contentsOf: url)) {
imgV.animatedImage = animatedImage
} else {
print("Error loading GIF")
}
lazy var headImgV: YYAnimatedImageView = {
let img = YYImage(named:"submit_head_animation.gif")
let imgV = YYAnimatedImageView(image: img)
return imgV
}()
lazy var scrollImage:FLAnimatedImage? = {
let url = Bundle.main.url(forResource: "submit_page_scroll", withExtension: "gif")!
if let animatedImage = try? FLAnimatedImage(animatedGIFData: Data(contentsOf: url)) {
return animatedImage
}
return nil
}()
lazy var scrollBgImgV: FLAnimatedImageView = {
let imgV = FLAnimatedImageView()
if let animatedImage = self.scrollImage {
// 先获取封面
imgV.image = animatedImage.posterImage
} else {
print("Error loading GIF")
}
lazy var scrollBgImgV:YYAnimatedImageView = {
let img = YYImage(named:"submit_page_scroll.gif")
let imgV = YYAnimatedImageView(image: img)
imgV.autoPlayAnimatedImage = false
imgV.currentAnimatedImageIndex = 0
return imgV
}()
......@@ -163,8 +147,8 @@ class YHSubmitAllInfoSuccessAlertView: UIView {
make.bottom.right.equalToSuperview()
}
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 2) {
self.scrollBgImgV.animatedImage = self.scrollImage
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 1) {
self.scrollBgImgV.startAnimating()
}
}
......
......@@ -8,7 +8,7 @@
import UIKit
import ESPullToRefresh
import FLAnimatedImage
import YYImage
public extension ES where Base: UIScrollView {
......@@ -49,15 +49,9 @@ class YHRefreshHeaderAnimator: UIView , ESRefreshProtocol, ESRefreshAnimatorProt
return imageView
}()
fileprivate let animaitonImgView: FLAnimatedImageView = {
let imgV = FLAnimatedImageView()
imgV.isHidden = true
let url = Bundle.main.url(forResource: "galaxy_refresher", withExtension: "gif")!
if let animatedImage = try? FLAnimatedImage(animatedGIFData: Data(contentsOf: url)) {
imgV.animatedImage = animatedImage
} else {
print("Error loading GIF")
}
fileprivate let animaitonImgView: YYAnimatedImageView = {
let img = YYImage(named:"galaxy_refresher.gif")
let imgV = YYAnimatedImageView(image: img)
return imgV
}()
......
......@@ -15,8 +15,6 @@
#import "JPUSHService.h"
// iOS10注册APNs所需头文件
#ifdef NSFoundationVersionNumber_iOS_9_x_Max
// GIF播放
#import "FLAnimatedImage.h"
#import <UserNotifications/UserNotifications.h>
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment