Update the behavior for SDAnimatedImageView for animated image
This should still be compatible for custom image class like YYPlugin
This commit is contained in:
parent
7bf6a59524
commit
2c9deffdf2
|
@ -129,12 +129,12 @@
|
||||||
|
|
||||||
// We need call super method to keep function. This will impliedly call `setNeedsDisplay`. But we have no way to avoid this when using animated image. So we call `setNeedsDisplay` again at the end.
|
// We need call super method to keep function. This will impliedly call `setNeedsDisplay`. But we have no way to avoid this when using animated image. So we call `setNeedsDisplay` again at the end.
|
||||||
super.image = image;
|
super.image = image;
|
||||||
if ([image.class conformsToProtocol:@protocol(SDAnimatedImage)]) {
|
if ([image.class conformsToProtocol:@protocol(SDAnimatedImage)] && [(id<SDAnimatedImage>)image animatedImageFrameCount] > 1) {
|
||||||
if (!self.player) {
|
if (!self.player) {
|
||||||
id<SDAnimatedImageProvider> provider;
|
id<SDAnimatedImageProvider> provider;
|
||||||
// Check progressive loading
|
// Check progressive loading
|
||||||
if (self.isProgressive) {
|
if (self.isProgressive) {
|
||||||
provider = [self progressiveAnimatedCoderForImage:image];
|
provider = [(id<SDAnimatedImage>)image animatedCoder];
|
||||||
} else {
|
} else {
|
||||||
provider = (id<SDAnimatedImage>)image;
|
provider = (id<SDAnimatedImage>)image;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue