mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-03-29 08:39:00 +08:00
Address comments and cleanup
This commit is contained in:
@@ -1,23 +1,15 @@
|
||||
//
|
||||
// ASImageNode+AnimatedImage.h
|
||||
// Pods
|
||||
// AsyncDisplayKit
|
||||
//
|
||||
// Created by Garrett Moon on 3/22/16.
|
||||
//
|
||||
// Copyright © 2016 Facebook. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ASImageNode.h"
|
||||
|
||||
#import "ASImageProtocols.h"
|
||||
|
||||
@interface ASImageNode ()
|
||||
|
||||
@property (atomic, assign) BOOL animatedImagePaused;
|
||||
|
||||
@end
|
||||
|
||||
@interface ASImageNode (AnimatedImage)
|
||||
|
||||
@property (nullable, atomic, strong) id <ASAnimatedImageProtocol> animatedImage;
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//
|
||||
// ASImageNode+AnimatedImage.m
|
||||
// Pods
|
||||
// AsyncDisplayKit
|
||||
//
|
||||
// Created by Garrett Moon on 3/22/16.
|
||||
//
|
||||
// Copyright © 2016 Facebook. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ASImageNode+AnimatedImage.h"
|
||||
@@ -15,6 +15,7 @@
|
||||
#import "ASEqualityHelpers.h"
|
||||
#import "ASDisplayNode+FrameworkPrivate.h"
|
||||
#import "ASImageNode+AnimatedImagePrivate.h"
|
||||
#import "ASInternalHelpers.h"
|
||||
|
||||
@interface ASWeakProxy : NSObject
|
||||
|
||||
@@ -53,6 +54,25 @@
|
||||
return _animatedImage;
|
||||
}
|
||||
|
||||
- (void)setAnimatedImagePaused:(BOOL)animatedImagePaused
|
||||
{
|
||||
ASDN::MutexLocker l(_animatedImagePausedLock);
|
||||
_animatedImagePaused = animatedImagePaused;
|
||||
ASPerformBlockOnMainThread(^{
|
||||
if (animatedImagePaused) {
|
||||
[self stopAnimating];
|
||||
} else {
|
||||
[self startAnimating];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (BOOL)animatedImagePaused
|
||||
{
|
||||
ASDN::MutexLocker l(_animatedImagePausedLock);
|
||||
return _animatedImagePaused;
|
||||
}
|
||||
|
||||
- (void)coverImageCompleted:(UIImage *)coverImage
|
||||
{
|
||||
BOOL setCoverImage = YES;
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
//
|
||||
// ASImageNode+AnimatedImagePrivate.h
|
||||
// Pods
|
||||
// AsyncDisplayKit
|
||||
//
|
||||
// Created by Garrett Moon on 3/30/16.
|
||||
//
|
||||
// Copyright © 2016 Facebook. All rights reserved.
|
||||
//
|
||||
|
||||
@interface ASImageNode ()
|
||||
{
|
||||
ASDN::RecursiveMutex _animatedImageLock;
|
||||
ASDN::RecursiveMutex _animatedImagePausedLock;
|
||||
ASDN::Mutex _displayLinkLock;
|
||||
id <ASAnimatedImageProtocol> _animatedImage;
|
||||
BOOL _animatedImagePaused;
|
||||
CADisplayLink *_displayLink;
|
||||
|
||||
//accessed on main thread only
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//
|
||||
// ASImageContainerProtocolCategories.h
|
||||
// Pods
|
||||
// AsyncDisplayKit
|
||||
//
|
||||
// Created by Garrett Moon on 3/18/16.
|
||||
//
|
||||
// Copyright © 2016 Facebook. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//
|
||||
// ASImageContainerProtocolCategories.m
|
||||
// Pods
|
||||
// AsyncDisplayKit
|
||||
//
|
||||
// Created by Garrett Moon on 3/18/16.
|
||||
//
|
||||
// Copyright © 2016 Facebook. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ASImageContainerProtocolCategories.h"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//
|
||||
// ASPINRemoteImageDownloader.h
|
||||
// Pods
|
||||
// AsyncDisplayKit
|
||||
//
|
||||
// Created by Garrett Moon on 2/5/16.
|
||||
//
|
||||
// Copyright © 2016 Facebook. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//
|
||||
// ASPINRemoteImageDownloader.m
|
||||
// Pods
|
||||
// AsyncDisplayKit
|
||||
//
|
||||
// Created by Garrett Moon on 2/5/16.
|
||||
//
|
||||
// Copyright © 2016 Facebook. All rights reserved.
|
||||
//
|
||||
|
||||
#ifdef PIN_REMOTE_IMAGE
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
ASNetworkImageNode *imageNode = [[ASNetworkImageNode alloc] init];
|
||||
imageNode.URL = [NSURL URLWithString:@"https://s-media-cache-ak0.pinimg.com/originals/07/44/38/074438e7c75034df2dcf37ba1057803e.gif"];
|
||||
// imageNode.URL = [NSURL fileURLWithPath:@"/Users/garrett/Downloads/new-transparent-gif-221.gif"];
|
||||
imageNode.frame = self.view.bounds;
|
||||
imageNode.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
||||
imageNode.contentMode = UIViewContentModeScaleAspectFit;
|
||||
|
||||
Reference in New Issue
Block a user