diff --git a/Podfile b/Podfile index 66cf3a2..3cb9a7a 100644 --- a/Podfile +++ b/Podfile @@ -6,23 +6,3 @@ target 'SVGAPlayer' do pod 'Protobuf', '~> 3.4' end - -target 'SVGAPlayer React' do - - pod 'SSZipArchive', '~> 2.1.4' - pod 'React', :podspec => 'https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec', :subspecs => [ - 'Core', - 'ART', - 'RCTActionSheet', - 'RCTGeolocation', - 'RCTImage', - 'RCTNetwork', - 'RCTSettings', - 'RCTText', - 'RCTVibration', - 'RCTWebSocket', - 'RCTLinkingIOS', - ] - pod 'Yoga' - -end diff --git a/Podfile.lock b/Podfile.lock index 643babd..be536f1 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,67 +1,20 @@ PODS: - Protobuf (3.6.1) - - React/ART (0.45.1): - - React/Core - - React/Core (0.45.1): - - React/cxxreact - - Yoga - - React/cxxreact (0.45.1): - - React/jschelpers - - React/jschelpers (0.45.1) - - React/RCTActionSheet (0.45.1): - - React/Core - - React/RCTGeolocation (0.45.1): - - React/Core - - React/RCTImage (0.45.1): - - React/Core - - React/RCTNetwork - - React/RCTLinkingIOS (0.45.1): - - React/Core - - React/RCTNetwork (0.45.1): - - React/Core - - React/RCTSettings (0.45.1): - - React/Core - - React/RCTText (0.45.1): - - React/Core - - React/RCTVibration (0.45.1): - - React/Core - - React/RCTWebSocket (0.45.1): - - React/Core - SSZipArchive (2.1.4) - - Yoga (1.9.0) DEPENDENCIES: - Protobuf (~> 3.4) - - React/ART (from `https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec`) - - React/Core (from `https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec`) - - React/RCTActionSheet (from `https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec`) - - React/RCTGeolocation (from `https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec`) - - React/RCTImage (from `https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec`) - - React/RCTLinkingIOS (from `https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec`) - - React/RCTNetwork (from `https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec`) - - React/RCTSettings (from `https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec`) - - React/RCTText (from `https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec`) - - React/RCTVibration (from `https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec`) - - React/RCTWebSocket (from `https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec`) - SSZipArchive (~> 2.1.4) - - Yoga SPEC REPOS: https://github.com/CocoaPods/Specs.git: - Protobuf - SSZipArchive - - Yoga - -EXTERNAL SOURCES: - React: - :podspec: https://raw.githubusercontent.com/yyued/react-native-runtime-ios/0.45.1/React.podspec SPEC CHECKSUMS: Protobuf: 1eb9700044745f00181c136ef21b8ff3ad5a0fd5 - React: 505e0132cd9aaba1a56e47ef509220dd794ec9be SSZipArchive: 41455d4b8d2b6ab93990820b50dc697c2554a322 - Yoga: aaae8abea68951f60bee05f6277d3eed90bb91bb -PODFILE CHECKSUM: 7f6714245d47e69d2933463289e4c4d6de65b831 +PODFILE CHECKSUM: 15ec3c806396baa34a298b2254638f0a6691580c -COCOAPODS: 1.10.1 +COCOAPODS: 1.9.1 diff --git a/React/SVGAPlayerManager.h b/React/SVGAPlayerManager.h deleted file mode 100644 index 1b12aa5..0000000 --- a/React/SVGAPlayerManager.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// SVGAPlayerManager.h -// SVGAPlayer -// -// Created by 崔明辉 on 2017/6/15. -// Copyright © 2017年 UED Center. All rights reserved. -// - -#import -#import - -@interface SVGAPlayerManager : RCTViewManager - -@end diff --git a/React/SVGAPlayerManager.m b/React/SVGAPlayerManager.m deleted file mode 100644 index a2b6fa3..0000000 --- a/React/SVGAPlayerManager.m +++ /dev/null @@ -1,182 +0,0 @@ -// -// SVGAPlayerManager.m -// SVGAPlayer -// -// Created by 崔明辉 on 2017/6/15. -// Copyright © 2017年 UED Center. All rights reserved. -// - -#import "SVGAPlayerManager.h" -#import "SVGAPlayer.h" -#import "SVGAParser.h" -#import - -@interface SVGAPlayer (React) - -@property(nonatomic, copy) NSString *source; -@property(nonatomic, copy) NSString *currentState; -@property(nonatomic, assign) NSInteger toFrame; -@property(nonatomic, assign) NSInteger toPercentage; -@property(nonatomic, copy) RCTBubblingEventBlock onFinished; -@property(nonatomic, copy) RCTBubblingEventBlock onFrame; -@property(nonatomic, copy) RCTBubblingEventBlock onPercentage; - -@end - -@implementation SVGAPlayer (React) - -static int kReactSourceIdentifier; -static int kReactCurrentStateIdentifier; -static int kReactOnFinishedIdentifier; -static int kReactOnFrameIdentifier; -static int kReactOnPercentageIdentifier; - -- (void)loadWithSource:(NSString *)source { - SVGAParser *parser = [[SVGAParser alloc] init]; - if ([source hasPrefix:@"http"] || [source hasPrefix:@"https"]) { - [parser parseWithURL:[NSURL URLWithString:source] - completionBlock:^(SVGAVideoEntity *_Nullable videoItem) { - [[NSOperationQueue mainQueue] addOperationWithBlock:^{ - [self setVideoItem:videoItem]; - [self startAnimation]; - }]; - } - failureBlock:nil]; - } else { - NSString *localPath = [[NSBundle mainBundle] pathForResource:source ofType:@"svga"]; - if (localPath != nil) { - [parser parseWithData:[NSData dataWithContentsOfFile:localPath] - cacheKey:source - completionBlock:^(SVGAVideoEntity *_Nonnull videoItem) { - [[NSOperationQueue mainQueue] addOperationWithBlock:^{ - [self setVideoItem:videoItem]; - [self startAnimation]; - }]; - } - failureBlock:nil]; - } - } -} - -- (void)setSource:(NSString *)source { - if ([source isKindOfClass:[NSString class]] && ([self source] == nil || ![source isEqualToString:[self source]])) { - objc_setAssociatedObject(self, &kReactSourceIdentifier, source, OBJC_ASSOCIATION_COPY_NONATOMIC); - [self loadWithSource:source]; - } -} - -- (NSString *)source { - return objc_getAssociatedObject(self, &kReactSourceIdentifier); -} - -- (void)setCurrentState:(NSString *)currentState { - if ([currentState isKindOfClass:[NSString class]] && - ([self currentState] == nil || ![currentState isEqualToString:[self currentState]])) { - objc_setAssociatedObject(self, &kReactCurrentStateIdentifier, currentState, OBJC_ASSOCIATION_COPY_NONATOMIC); - if ([currentState isEqualToString:@"start"]) { - [self startAnimation]; - } else if ([currentState isEqualToString:@"pause"]) { - [self pauseAnimation]; - } else if ([currentState isEqualToString:@"stop"]) { - [self stopAnimation]; - } else if ([currentState isEqualToString:@"clear"]) { - [self stopAnimation]; - [self clear]; - } - } -} - -- (NSString *)currentState { - return objc_getAssociatedObject(self, &kReactCurrentStateIdentifier); -} - -- (void)setOnFinished:(RCTBubblingEventBlock)onFinished { - objc_setAssociatedObject(self, &kReactOnFinishedIdentifier, onFinished, OBJC_ASSOCIATION_COPY_NONATOMIC); -} - -- (RCTBubblingEventBlock)onFinished { - return objc_getAssociatedObject(self, &kReactOnFinishedIdentifier); -} - -- (void)setOnFrame:(RCTBubblingEventBlock)onFrame { - objc_setAssociatedObject(self, &kReactOnFrameIdentifier, onFrame, OBJC_ASSOCIATION_COPY_NONATOMIC); -} - -- (RCTBubblingEventBlock)onFrame { - return objc_getAssociatedObject(self, &kReactOnFrameIdentifier); -} - -- (void)setOnPercentage:(RCTBubblingEventBlock)onPercentage { - objc_setAssociatedObject(self, &kReactOnPercentageIdentifier, onPercentage, OBJC_ASSOCIATION_COPY_NONATOMIC); -} - -- (RCTBubblingEventBlock)onPercentage { - return objc_getAssociatedObject(self, &kReactOnPercentageIdentifier); -} - -- (void)setToFrame:(NSInteger)toFrame { - if (toFrame < 0) { - return; - } - [self stepToFrame:toFrame andPlay:[self.currentState isEqualToString:@"play"]]; -} - -- (NSInteger)toFrame { - return 0; -} - -- (void)setToPercentage:(NSInteger)toPercentage { - if (toPercentage < 0) { - return; - } - [self stepToPercentage:toPercentage andPlay:[self.currentState isEqualToString:@"play"]]; -} - -- (NSInteger)toPercentage { - return 0.0; -} - -- (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player { - if (self.onFinished) { - self.onFinished(@{}); - } -} - -- (void)svgaPlayerDidAnimatedToFrame:(NSInteger)frame { - if (self.onFrame) { - self.onFrame(@{ @"value" : @(frame) }); - } -} - -- (void)svgaPlayerDidAnimatedToPercentage:(CGFloat)percentage { - if (self.onPercentage) { - self.onPercentage(@{ @"value" : @(percentage) }); - } -} - -@end - -@interface SVGAPlayerManager () - -@end - -@implementation SVGAPlayerManager - -RCT_EXPORT_MODULE() -RCT_EXPORT_VIEW_PROPERTY(loops, NSInteger) -RCT_EXPORT_VIEW_PROPERTY(clearsAfterStop, BOOL) -RCT_EXPORT_VIEW_PROPERTY(source, NSString) -RCT_EXPORT_VIEW_PROPERTY(currentState, NSString) -RCT_EXPORT_VIEW_PROPERTY(toFrame, NSInteger) -RCT_EXPORT_VIEW_PROPERTY(toPercentage, NSInteger) -RCT_EXPORT_VIEW_PROPERTY(onFinished, RCTBubblingEventBlock) -RCT_EXPORT_VIEW_PROPERTY(onFrame, RCTBubblingEventBlock) -RCT_EXPORT_VIEW_PROPERTY(onPercentage, RCTBubblingEventBlock) - -- (UIView *)view { - SVGAPlayer *aPlayer = [[SVGAPlayer alloc] init]; - aPlayer.delegate = aPlayer; - return aPlayer; -} - -@end diff --git a/SVGAPlayer-React.podspec b/SVGAPlayer-React.podspec deleted file mode 100644 index 8daa70e..0000000 --- a/SVGAPlayer-React.podspec +++ /dev/null @@ -1,31 +0,0 @@ - -Pod::Spec.new do |s| - s.name = "SVGAPlayer" - s.version = "2.3.5" - s.summary = "SVGAPlayer 是一个高性能的动画播放器" - s.description = <<-DESC - SVGA 是一个私有的动画格式,由 YY UED 主导开发。 - SVGA 由 SVG 演进而成,与 SVG 不兼容。 - SVGA 可以在 iOS / Android / Web(PC/移动端) 实现高性能的动画播放。 - DESC - s.homepage = "http://code.yy.com/ued/SVGAPlayer" - s.license = "Private" - s.author = { "PonyCui" => "cuiminghui1@yy.com" } - s.platform = :ios, "7.0" - s.source = { :git => "https://github.com/yyued/SVGAPlayer-iOS.git", :tag => s.version } - s.subspec 'Core' do |ss| - ss.source_files = "Source/*.{h,m}", "React/*.{h,m}" - ss.requires_arc = true - ss.dependency 'SSZipArchive', '>= 1.8.1' - ss.library = "z" - ss.dependency 'SVGAPlayer/ProtoFiles' - end - s.subspec 'ProtoFiles' do |ss| - ss.source_files = "Source/pbobjc/*.{h,m}" - ss.requires_arc = false - ss.dependency 'Protobuf', '~> 3.4' - ss.pod_target_xcconfig = { - 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1', - } - end -end diff --git a/SVGAPlayer.podspec b/SVGAPlayer.podspec index d44fb8b..3753c36 100644 --- a/SVGAPlayer.podspec +++ b/SVGAPlayer.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "SVGAPlayer" - s.version = "2.5.6" + s.version = "2.5.7" s.summary = "SVGAPlayer 是一个高性能的动画播放器" s.description = <<-DESC SVGA 是一种全新的动画格式,由 YY UED 团队主导开发; diff --git a/SVGAPlayer.xcodeproj/project.pbxproj b/SVGAPlayer.xcodeproj/project.pbxproj index 6c3d1ea..4f39f57 100644 --- a/SVGAPlayer.xcodeproj/project.pbxproj +++ b/SVGAPlayer.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 4B62B1C5E6CE2BE2D914927B /* libPods-SVGAPlayer React.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92332F7A897BF4379D765B05 /* libPods-SVGAPlayer React.a */; }; 63712E6521787950001AE014 /* heartbeat.svga in Resources */ = {isa = PBXBuildFile; fileRef = 63712E6421787950001AE014 /* heartbeat.svga */; }; 63712E6821787A45001AE014 /* SVGAAudioEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 63712E6721787A45001AE014 /* SVGAAudioEntity.m */; }; 63E817012178809D001D2D62 /* SVGAAudioLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E817002178809D001D2D62 /* SVGAAudioLayer.m */; }; @@ -34,24 +33,6 @@ 90A676FD1D13A82A008A69F3 /* SVGAParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A676FC1D13A82A008A69F3 /* SVGAParser.m */; }; 90A677031D13AE19008A69F3 /* SVGAVideoEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A677021D13AE19008A69F3 /* SVGAVideoEntity.m */; }; 90A677061D13BF77008A69F3 /* SVGAPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A677051D13BF77008A69F3 /* SVGAPlayer.m */; }; - 90CB64CC1EF290F400DAA382 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A676E71D13A6DF008A69F3 /* ViewController.m */; }; - 90CB64CD1EF290F400DAA382 /* SVGAExporter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9052FC621E6EB8D4007BC925 /* SVGAExporter.m */; }; - 90CB64CE1EF290F400DAA382 /* SVGAVideoEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A677021D13AE19008A69F3 /* SVGAVideoEntity.m */; }; - 90CB64CF1EF290F400DAA382 /* SVGAVideoSpriteFrameEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A364D91E5AED04009347F1 /* SVGAVideoSpriteFrameEntity.m */; }; - 90CB64D01EF290F400DAA382 /* SVGABitmapLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A364D01E5AEC11009347F1 /* SVGABitmapLayer.m */; }; - 90CB64D11EF290F400DAA382 /* SVGABezierPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 904D41F71D223DD20085A21A /* SVGABezierPath.m */; }; - 90CB64D21EF290F400DAA382 /* SVGAVideoSpriteEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A364D61E5AECBD009347F1 /* SVGAVideoSpriteEntity.m */; }; - 90CB64D31EF290F400DAA382 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A676E41D13A6DF008A69F3 /* AppDelegate.m */; }; - 90CB64D41EF290F400DAA382 /* SVGAContentLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A364DC1E5D33F8009347F1 /* SVGAContentLayer.m */; }; - 90CB64D51EF290F400DAA382 /* SVGA.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A676F91D13A81F008A69F3 /* SVGA.m */; }; - 90CB64D61EF290F400DAA382 /* SVGAPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A677051D13BF77008A69F3 /* SVGAPlayer.m */; }; - 90CB64D71EF290F400DAA382 /* SVGAVectorLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A364D31E5AEC1C009347F1 /* SVGAVectorLayer.m */; }; - 90CB64D81EF290F400DAA382 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A676E11D13A6DF008A69F3 /* main.m */; }; - 90CB64D91EF290F400DAA382 /* SVGAParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A676FC1D13A82A008A69F3 /* SVGAParser.m */; }; - 90CB64DD1EF290F400DAA382 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 90A676EE1D13A6DF008A69F3 /* LaunchScreen.storyboard */; }; - 90CB64DE1EF290F400DAA382 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 90A676EC1D13A6DF008A69F3 /* Assets.xcassets */; }; - 90CB64DF1EF290F400DAA382 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 90A676E91D13A6DF008A69F3 /* Main.storyboard */; }; - 90CB64F71EF2925000DAA382 /* SVGAPlayerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 90CB64F61EF2925000DAA382 /* SVGAPlayerManager.m */; }; 90CB64F91EF297E800DAA382 /* SVGAPlayer React-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 90CB64F81EF297E800DAA382 /* SVGAPlayer React-Info.plist */; }; 90D7CA161F7FA07A006E74F0 /* Svga.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = 90D7CA141F7FA079006E74F0 /* Svga.pbobjc.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 90D7CA1B1F7FB114006E74F0 /* rose_2.0.0.svga in Resources */ = {isa = PBXBuildFile; fileRef = 90D7CA191F7FB114006E74F0 /* rose_2.0.0.svga */; }; @@ -63,7 +44,6 @@ /* Begin PBXFileReference section */ 1DDA5FF396660C7C932DF9B8 /* libPods-SVGAPlayer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SVGAPlayer.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 2EF4851C027B3C0E45E3C5C0 /* Pods-SVGAPlayer React.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SVGAPlayer React.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SVGAPlayer React/Pods-SVGAPlayer React.debug.xcconfig"; sourceTree = ""; }; 63712E6421787950001AE014 /* heartbeat.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = heartbeat.svga; sourceTree = ""; }; 63712E6621787A45001AE014 /* SVGAAudioEntity.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAAudioEntity.h; sourceTree = ""; }; 63712E6721787A45001AE014 /* SVGAAudioEntity.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SVGAAudioEntity.m; sourceTree = ""; }; @@ -107,9 +87,6 @@ 90A677021D13AE19008A69F3 /* SVGAVideoEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVGAVideoEntity.m; sourceTree = ""; }; 90A677041D13BF77008A69F3 /* SVGAPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAPlayer.h; sourceTree = ""; }; 90A677051D13BF77008A69F3 /* SVGAPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVGAPlayer.m; sourceTree = ""; }; - 90CB64E51EF290F400DAA382 /* SVGAPlayer React.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SVGAPlayer React.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 90CB64F51EF2925000DAA382 /* SVGAPlayerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAPlayerManager.h; sourceTree = ""; }; - 90CB64F61EF2925000DAA382 /* SVGAPlayerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVGAPlayerManager.m; sourceTree = ""; }; 90CB64F81EF297E800DAA382 /* SVGAPlayer React-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SVGAPlayer React-Info.plist"; sourceTree = ""; }; 90D7CA141F7FA079006E74F0 /* Svga.pbobjc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Svga.pbobjc.m; sourceTree = ""; }; 90D7CA151F7FA079006E74F0 /* Svga.pbobjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Svga.pbobjc.h; sourceTree = ""; }; @@ -118,10 +95,8 @@ 90D7CA1D1F7FB34E006E74F0 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 90DB59B31F96026E00894727 /* SVGAImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAImageView.h; sourceTree = ""; }; 90DB59B41F96026E00894727 /* SVGAImageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SVGAImageView.m; sourceTree = ""; }; - 92332F7A897BF4379D765B05 /* libPods-SVGAPlayer React.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SVGAPlayer React.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E02B8713B25C0283C736EE03 /* Pods-SVGAPlayer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SVGAPlayer.release.xcconfig"; path = "Pods/Target Support Files/Pods-SVGAPlayer/Pods-SVGAPlayer.release.xcconfig"; sourceTree = ""; }; E83A58D8247E0E6A00D9F404 /* audio_biling.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = audio_biling.svga; sourceTree = ""; }; - FF89C40C3E9839DA5DE71191 /* Pods-SVGAPlayer React.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SVGAPlayer React.release.xcconfig"; path = "Pods/Target Support Files/Pods-SVGAPlayer React/Pods-SVGAPlayer React.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -134,14 +109,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 90CB64DA1EF290F400DAA382 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B62B1C5E6CE2BE2D914927B /* libPods-SVGAPlayer React.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -150,8 +117,6 @@ children = ( 8AD65028FA2D122A34DC4A63 /* Pods-SVGAPlayer.debug.xcconfig */, E02B8713B25C0283C736EE03 /* Pods-SVGAPlayer.release.xcconfig */, - 2EF4851C027B3C0E45E3C5C0 /* Pods-SVGAPlayer React.debug.xcconfig */, - FF89C40C3E9839DA5DE71191 /* Pods-SVGAPlayer React.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -159,7 +124,6 @@ 90A676D41D13A6DF008A69F3 = { isa = PBXGroup; children = ( - 90CB64C81EF290E600DAA382 /* React */, 90A676F71D13A70E008A69F3 /* Source */, 90A676DF1D13A6DF008A69F3 /* SVGAPlayer */, 90A676DE1D13A6DF008A69F3 /* Products */, @@ -172,7 +136,6 @@ isa = PBXGroup; children = ( 90A676DD1D13A6DF008A69F3 /* SVGAPlayer.app */, - 90CB64E51EF290F400DAA382 /* SVGAPlayer React.app */, ); name = Products; sourceTree = ""; @@ -239,15 +202,6 @@ path = Source; sourceTree = ""; }; - 90CB64C81EF290E600DAA382 /* React */ = { - isa = PBXGroup; - children = ( - 90CB64F51EF2925000DAA382 /* SVGAPlayerManager.h */, - 90CB64F61EF2925000DAA382 /* SVGAPlayerManager.m */, - ); - path = React; - sourceTree = ""; - }; 90D7C9FA1F7E2AA3006E74F0 /* Samples */ = { isa = PBXGroup; children = ( @@ -278,7 +232,6 @@ children = ( 90D7CA1D1F7FB34E006E74F0 /* libz.tbd */, 1DDA5FF396660C7C932DF9B8 /* libPods-SVGAPlayer.a */, - 92332F7A897BF4379D765B05 /* libPods-SVGAPlayer React.a */, ); name = Frameworks; sourceTree = ""; @@ -304,24 +257,6 @@ productReference = 90A676DD1D13A6DF008A69F3 /* SVGAPlayer.app */; productType = "com.apple.product-type.application"; }; - 90CB64C91EF290F400DAA382 /* SVGAPlayer React */ = { - isa = PBXNativeTarget; - buildConfigurationList = 90CB64E21EF290F400DAA382 /* Build configuration list for PBXNativeTarget "SVGAPlayer React" */; - buildPhases = ( - 890FC763F2C82314110A5C8F /* [CP] Check Pods Manifest.lock */, - 90CB64CB1EF290F400DAA382 /* Sources */, - 90CB64DA1EF290F400DAA382 /* Frameworks */, - 90CB64DC1EF290F400DAA382 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "SVGAPlayer React"; - productName = SVGAPlayer; - productReference = 90CB64E51EF290F400DAA382 /* SVGAPlayer React.app */; - productType = "com.apple.product-type.application"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -335,9 +270,6 @@ CreatedOnToolsVersion = 7.3; DevelopmentTeam = S2RM275849; }; - 90CB64C91EF290F400DAA382 = { - DevelopmentTeam = 8M2FQ87SLP; - }; }; }; buildConfigurationList = 90A676D81D13A6DF008A69F3 /* Build configuration list for PBXProject "SVGAPlayer" */; @@ -355,7 +287,6 @@ projectRoot = ""; targets = ( 90A676DC1D13A6DF008A69F3 /* SVGAPlayer */, - 90CB64C91EF290F400DAA382 /* SVGAPlayer React */, ); }; /* End PBXProject section */ @@ -381,37 +312,9 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 90CB64DC1EF290F400DAA382 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 90CB64DD1EF290F400DAA382 /* LaunchScreen.storyboard in Resources */, - 90CB64DE1EF290F400DAA382 /* Assets.xcassets in Resources */, - 90CB64DF1EF290F400DAA382 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 890FC763F2C82314110A5C8F /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SVGAPlayer React-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; CD70B01EE331E392E355CD26 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -458,28 +361,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 90CB64CB1EF290F400DAA382 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 90CB64F71EF2925000DAA382 /* SVGAPlayerManager.m in Sources */, - 90CB64CC1EF290F400DAA382 /* ViewController.m in Sources */, - 90CB64CD1EF290F400DAA382 /* SVGAExporter.m in Sources */, - 90CB64CE1EF290F400DAA382 /* SVGAVideoEntity.m in Sources */, - 90CB64CF1EF290F400DAA382 /* SVGAVideoSpriteFrameEntity.m in Sources */, - 90CB64D01EF290F400DAA382 /* SVGABitmapLayer.m in Sources */, - 90CB64D11EF290F400DAA382 /* SVGABezierPath.m in Sources */, - 90CB64D21EF290F400DAA382 /* SVGAVideoSpriteEntity.m in Sources */, - 90CB64D31EF290F400DAA382 /* AppDelegate.m in Sources */, - 90CB64D41EF290F400DAA382 /* SVGAContentLayer.m in Sources */, - 90CB64D51EF290F400DAA382 /* SVGA.m in Sources */, - 90CB64D61EF290F400DAA382 /* SVGAPlayer.m in Sources */, - 90CB64D71EF290F400DAA382 /* SVGAVectorLayer.m in Sources */, - 90CB64D81EF290F400DAA382 /* main.m in Sources */, - 90CB64D91EF290F400DAA382 /* SVGAParser.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ @@ -618,40 +499,6 @@ }; name = Release; }; - 90CB64E31EF290F400DAA382 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2EF4851C027B3C0E45E3C5C0 /* Pods-SVGAPlayer React.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - DEVELOPMENT_TEAM = 8M2FQ87SLP; - INFOPLIST_FILE = "$(SRCROOT)/SVGAPlayer/SVGAPlayer React-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.opensource.SVGAPlayer; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 90CB64E41EF290F400DAA382 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FF89C40C3E9839DA5DE71191 /* Pods-SVGAPlayer React.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_IDENTITY = "iPhone Developer"; - DEVELOPMENT_TEAM = 8M2FQ87SLP; - INFOPLIST_FILE = "$(SRCROOT)/SVGAPlayer/SVGAPlayer React-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.opensource.SVGAPlayer; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = ""; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -673,15 +520,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 90CB64E21EF290F400DAA382 /* Build configuration list for PBXNativeTarget "SVGAPlayer React" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 90CB64E31EF290F400DAA382 /* Debug */, - 90CB64E41EF290F400DAA382 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = 90A676D51D13A6DF008A69F3 /* Project object */; diff --git a/SVGAPlayer.xcodeproj/xcuserdata/saiakirahui.xcuserdatad/xcschemes/xcschememanagement.plist b/SVGAPlayer.xcodeproj/xcuserdata/saiakirahui.xcuserdatad/xcschemes/xcschememanagement.plist index 45700c1..ef983a6 100644 --- a/SVGAPlayer.xcodeproj/xcuserdata/saiakirahui.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/SVGAPlayer.xcodeproj/xcuserdata/saiakirahui.xcuserdatad/xcschemes/xcschememanagement.plist @@ -9,11 +9,21 @@ orderHint 7 + SVGAPlayer React.xcscheme_^#shared#^_ + + orderHint + 4 + SVGAPlayer.xcscheme orderHint 6 + SVGAPlayer.xcscheme_^#shared#^_ + + orderHint + 3 + diff --git a/SVGAPlayer.xcworkspace/xcuserdata/saiakirahui.xcuserdatad/UserInterfaceState.xcuserstate b/SVGAPlayer.xcworkspace/xcuserdata/saiakirahui.xcuserdatad/UserInterfaceState.xcuserstate index cb27b8a..bf9bfea 100644 Binary files a/SVGAPlayer.xcworkspace/xcuserdata/saiakirahui.xcuserdatad/UserInterfaceState.xcuserstate and b/SVGAPlayer.xcworkspace/xcuserdata/saiakirahui.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/SVGAPlayer/ViewController.m b/SVGAPlayer/ViewController.m index fd0f546..97e5272 100644 --- a/SVGAPlayer/ViewController.m +++ b/SVGAPlayer/ViewController.m @@ -37,17 +37,17 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - (IBAction)onChange:(id)sender { NSArray *items = @[ - @"https://github.com/yyued/SVGA-Samples/blob/master/EmptyState.svga?raw=true", - @"https://github.com/yyued/SVGA-Samples/blob/master/HamburgerArrow.svga?raw=true", - @"https://github.com/yyued/SVGA-Samples/blob/master/PinJump.svga?raw=true", + @"https://cdn.jsdelivr.net/gh/svga/SVGA-Samples@master/EmptyState.svga?raw=true", + @"https://cdn.jsdelivr.net/gh/svga/SVGA-Samples@master/HamburgerArrow.svga?raw=true", + @"https://cdn.jsdelivr.net/gh/svga/SVGA-Samples@master/PinJump.svga?raw=true", @"https://github.com/svga/SVGA-Samples/raw/master/Rocket.svga", - @"https://github.com/yyued/SVGA-Samples/blob/master/TwitterHeart.svga?raw=true", - @"https://github.com/yyued/SVGA-Samples/blob/master/Walkthrough.svga?raw=true", - @"https://github.com/yyued/SVGA-Samples/blob/master/angel.svga?raw=true", - @"https://github.com/yyued/SVGA-Samples/blob/master/halloween.svga?raw=true", - @"https://github.com/yyued/SVGA-Samples/blob/master/kingset.svga?raw=true", - @"https://github.com/yyued/SVGA-Samples/blob/master/posche.svga?raw=true", - @"https://github.com/yyued/SVGA-Samples/blob/master/rose.svga?raw=true", + @"https://cdn.jsdelivr.net/gh/svga/SVGA-Samples@master/TwitterHeart.svga?raw=true", + @"https://cdn.jsdelivr.net/gh/svga/SVGA-Samples@master/Walkthrough.svga?raw=true", + @"https://cdn.jsdelivr.net/gh/svga/SVGA-Samples@master/angel.svga?raw=true", + @"https://cdn.jsdelivr.net/gh/svga/SVGA-Samples@master/halloween.svga?raw=true", + @"https://cdn.jsdelivr.net/gh/svga/SVGA-Samples@master/kingset.svga?raw=true", + @"https://cdn.jsdelivr.net/gh/svga/SVGA-Samples@master/posche.svga?raw=true", + @"https://cdn.jsdelivr.net/gh/svga/SVGA-Samples@master/rose.svga?raw=true", ]; [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; // parser.enabledMemoryCache = YES; diff --git a/Source/SVGAContentLayer.m b/Source/SVGAContentLayer.m index e20f736..471a741 100644 --- a/Source/SVGAContentLayer.m +++ b/Source/SVGAContentLayer.m @@ -50,7 +50,17 @@ - (void)stepToFrame:(NSInteger)frame { CGFloat offsetX = self.frame.origin.x - nx; CGFloat offsetY = self.frame.origin.y - ny; self.position = CGPointMake(self.position.x - offsetX, self.position.y - offsetY); - self.mask = frameItem.maskLayer; + if (frameItem.maskLayer != nil) { + if ([frameItem.maskLayer isKindOfClass:[CAShapeLayer class]]) { + CAShapeLayer *cloneShapeLayer = [CAShapeLayer layer]; + cloneShapeLayer.path = [(CAShapeLayer *)frameItem.maskLayer path]; + cloneShapeLayer.fillColor = [(CAShapeLayer *)frameItem.maskLayer fillColor]; + self.mask = cloneShapeLayer; + } + } + else { + self.mask = nil; + } [self.bitmapLayer stepToFrame:frame]; [self.vectorLayer stepToFrame:frame]; } diff --git a/Source/SVGAVectorLayer.m b/Source/SVGAVectorLayer.m index 57cc844..153411f 100644 --- a/Source/SVGAVectorLayer.m +++ b/Source/SVGAVectorLayer.m @@ -347,10 +347,12 @@ - (void)resetStyles:(CAShapeLayer *)shapeLayer protoShape:(SVGAProtoShapeEntity break; } shapeLayer.lineDashPhase = protoShape.styles.lineDashIii; - shapeLayer.lineDashPattern = @[ - (protoShape.styles.lineDashI < 1.0 ? @(1.0) : @(protoShape.styles.lineDashI)), - (protoShape.styles.lineDashIi < 0.1 ? @(0.1) : @(protoShape.styles.lineDashIi)) - ]; + if (protoShape.styles.lineDashI > 0.0 || protoShape.styles.lineDashIi > 0.0) { + shapeLayer.lineDashPattern = @[ + (protoShape.styles.lineDashI < 1.0 ? @(1.0) : @(protoShape.styles.lineDashI)), + (protoShape.styles.lineDashIi < 0.1 ? @(0.1) : @(protoShape.styles.lineDashIi)) + ]; + } shapeLayer.miterLimit = protoShape.styles.miterLimit; } } diff --git a/backer/alipay.jpg b/backer/alipay.jpg deleted file mode 100644 index c0ff3a8..0000000 Binary files a/backer/alipay.jpg and /dev/null differ diff --git a/backer/donate.md b/backer/donate.md deleted file mode 100644 index cf8e794..0000000 --- a/backer/donate.md +++ /dev/null @@ -1,9 +0,0 @@ -# Donate - -One-time donation via AliPay or WeChat. - -![](./wechat.jpg) - -![](./alipay.jpg) - -We also provide a way to thank your help, please contact `cuis@vip.qq.com`. \ No newline at end of file diff --git a/backer/hire.md b/backer/hire.md deleted file mode 100644 index dc5f4bd..0000000 --- a/backer/hire.md +++ /dev/null @@ -1,9 +0,0 @@ -# Counselor Service - -The author PonyCui could help you resolve kinds of problem, including SVGA, cross-platform application development issue. - -If you have any usage question, please contact `cuis@vip.qq.com` for further resolution. - ---- - -PonyCui 可以帮助你解决包括 SVGA、跨平台应用开发等问题,如果遇到任何使用上的问题,可以联系 `cuis@vip.qq.com` 获得更好的方案。 \ No newline at end of file diff --git a/backer/wechat.jpg b/backer/wechat.jpg deleted file mode 100644 index bab8e99..0000000 Binary files a/backer/wechat.jpg and /dev/null differ