mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-18 03:20:09 +00:00
change rootDic to rootDirectory;
change animationWithFile to animationWithFilePath
This commit is contained in:
parent
2c06373b1f
commit
71326e9589
@ -319,12 +319,12 @@
|
||||
- (void)_setImageForAsset {
|
||||
if (_layerModel.imageAsset.imageName) {
|
||||
UIImage *image;
|
||||
if (_layerModel.imageAsset.rootDir.length > 0) {
|
||||
NSString *rootDic = _layerModel.imageAsset.rootDir;
|
||||
if (_layerModel.imageAsset.rootDirectory.length > 0) {
|
||||
NSString *rootDirectory = _layerModel.imageAsset.rootDirectory;
|
||||
if (_layerModel.imageAsset.imageDirectory.length > 0) {
|
||||
rootDic = [rootDic stringByAppendingPathComponent:_layerModel.imageAsset.imageDirectory];
|
||||
rootDirectory = [rootDirectory stringByAppendingPathComponent:_layerModel.imageAsset.imageDirectory];
|
||||
}
|
||||
NSString *imagePath = [rootDic stringByAppendingPathComponent:_layerModel.imageAsset.imageName];
|
||||
NSString *imagePath = [rootDirectory stringByAppendingPathComponent:_layerModel.imageAsset.imageName];
|
||||
image = [UIImage imageWithContentsOfFile:imagePath];
|
||||
}else{
|
||||
NSArray *components = [_layerModel.imageAsset.imageName componentsSeparatedByString:@"."];
|
||||
|
@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@property (nonatomic, readonly, nullable) LOTLayerGroup *layerGroup;
|
||||
|
||||
@property (nonatomic, readwrite) NSString *rootDir;
|
||||
@property (nonatomic, readwrite) NSString *rootDirectory;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@ -12,7 +12,7 @@
|
||||
@class LOTAsset;
|
||||
@class LOTLayerGroup;
|
||||
@interface LOTAssetGroup : NSObject
|
||||
@property (nonatomic, readwrite) NSString * _Nullable rootDir;
|
||||
@property (nonatomic, readwrite) NSString * _Nullable rootDirectory;
|
||||
|
||||
- (instancetype _Nonnull)initWithJSON:(NSArray * _Nonnull)jsonArray;
|
||||
|
||||
|
@ -58,10 +58,10 @@
|
||||
- (LOTAsset *)assetModelForID:(NSString *)assetID {
|
||||
return _assetMap[assetID];
|
||||
}
|
||||
- (void)setRootDir:(NSString *)rootDir{
|
||||
_rootDir = rootDir;
|
||||
- (void)setRootDirectory:(NSString *)rootDirectory{
|
||||
_rootDirectory = rootDirectory;
|
||||
[_assetMap enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, LOTAsset * _Nonnull obj, BOOL * _Nonnull stop) {
|
||||
obj.rootDir = rootDir;
|
||||
obj.rootDirectory = rootDirectory;
|
||||
}];
|
||||
}
|
||||
@end
|
||||
|
@ -24,6 +24,6 @@
|
||||
@property (nonatomic, readonly) NSTimeInterval timeDuration;
|
||||
@property (nonatomic, readonly) LOTLayerGroup *layerGroup;
|
||||
@property (nonatomic, readonly) LOTAssetGroup *assetGroup;
|
||||
@property (nonatomic, readwrite) NSString *rootDir;
|
||||
@property (nonatomic, readwrite) NSString *rootDirectory;
|
||||
|
||||
@end
|
||||
|
@ -55,8 +55,8 @@
|
||||
[_assetGroup finalizeInitialization];
|
||||
|
||||
}
|
||||
- (void)setRootDir:(NSString *)rootDir{
|
||||
_rootDir = rootDir;
|
||||
self.assetGroup.rootDir = rootDir;
|
||||
- (void)setRootDirectory:(NSString *)rootDirectory{
|
||||
_rootDirectory = rootDirectory;
|
||||
self.assetGroup.rootDirectory = rootDirectory;
|
||||
}
|
||||
@end
|
||||
|
@ -215,7 +215,7 @@
|
||||
return [[LOTAnimationView alloc] initWithModel:laScene];
|
||||
}
|
||||
|
||||
+ (instancetype)animationWithFile:(NSString *)filePath{
|
||||
+ (instancetype)animationWithFilePath:(NSString *)filePath{
|
||||
NSString *animationName = filePath;
|
||||
|
||||
LOTComposition *comp = [[LOTAnimationCache sharedCache] animationForKey:animationName];
|
||||
@ -229,7 +229,7 @@
|
||||
options:0 error:&error] : nil;
|
||||
if (JSONObject && !error) {
|
||||
LOTComposition *laScene = [[LOTComposition alloc] initWithJSON:JSONObject];
|
||||
laScene.rootDir = [filePath stringByDeletingLastPathComponent];
|
||||
laScene.rootDirectory = [filePath stringByDeletingLastPathComponent];
|
||||
[[LOTAnimationCache sharedCache] addAnimation:laScene forKey:animationName];
|
||||
return [[LOTAnimationView alloc] initWithModel:laScene];
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ typedef void (^LOTAnimationCompletionBlock)(BOOL animationFinished);
|
||||
|
||||
- (instancetype)initWithContentsOfURL:(NSURL *)url;
|
||||
|
||||
+ (instancetype)animationWithFile:(NSString *)filePath NS_SWIFT_NAME(init(file:));
|
||||
+ (instancetype)animationWithFilePath:(NSString *)filePath NS_SWIFT_NAME(init(filePath:));
|
||||
|
||||
@property (nonatomic, readonly) BOOL isAnimationPlaying;
|
||||
@property (nonatomic, assign) BOOL loopAnimation;
|
||||
|
Loading…
x
Reference in New Issue
Block a user