Skip to content

Commit

Permalink
chore: weex playground add lottie & lottie bindingx extend
Browse files Browse the repository at this point in the history
  • Loading branch information
对象 committed Sep 14, 2018
1 parent e2a33a0 commit 49d4562
Show file tree
Hide file tree
Showing 8 changed files with 415 additions and 16 deletions.
1 change: 1 addition & 0 deletions weex/playground/ios/Podfile
Expand Up @@ -8,6 +8,7 @@ def common
pod 'SDWebImage', '3.7.5'
pod 'SocketRocket', '0.4.2'
pod 'ATSDK-Weex', '0.0.1'
pod 'lottie-ios', '2.5.0'

pod 'BindingX', :path=>'../../../'
end
Expand Down
24 changes: 22 additions & 2 deletions weex/playground/ios/WeexDemo.xcodeproj/project.pbxproj
Expand Up @@ -33,6 +33,8 @@
D95084AA2046CF9A003F3CC0 /* WXURLResolver.m in Sources */ = {isa = PBXBuildFile; fileRef = D95084A92046CF9A003F3CC0 /* WXURLResolver.m */; };
D95084AD2046CFD0003F3CC0 /* NSString+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = D95084AC2046CFD0003F3CC0 /* NSString+Additions.m */; };
D95084AF2046D431003F3CC0 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D95084AE2046D431003F3CC0 /* Launch Screen.storyboard */; };
D9A8959A214B5C3F00AE5DCC /* WXLottieComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = D9A89596214B5C3F00AE5DCC /* WXLottieComponent.m */; };
D9A8959B214B5C3F00AE5DCC /* WXLottieBindingXHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = D9A89597214B5C3F00AE5DCC /* WXLottieBindingXHandler.m */; };
D9F28AEA207203D100CE451B /* CustomEBHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = D9F28AE9207203D100CE451B /* CustomEBHandler.m */; };
DC5E503E1D0D97130059F0EB /* weex.png in Resources */ = {isa = PBXBuildFile; fileRef = DC5E503C1D0D97130059F0EB /* weex.png */; };
DC5E503F1D0D97130059F0EB /* weex@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DC5E503D1D0D97130059F0EB /* weex@2x.png */; };
Expand Down Expand Up @@ -96,6 +98,10 @@
D95084AB2046CFCF003F3CC0 /* NSString+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+Additions.h"; sourceTree = "<group>"; };
D95084AC2046CFD0003F3CC0 /* NSString+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+Additions.m"; sourceTree = "<group>"; };
D95084AE2046D431003F3CC0 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
D9A89596214B5C3F00AE5DCC /* WXLottieComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXLottieComponent.m; sourceTree = "<group>"; };
D9A89597214B5C3F00AE5DCC /* WXLottieBindingXHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXLottieBindingXHandler.m; sourceTree = "<group>"; };
D9A89598214B5C3F00AE5DCC /* WXLottieComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXLottieComponent.h; sourceTree = "<group>"; };
D9A89599214B5C3F00AE5DCC /* WXLottieBindingXHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXLottieBindingXHandler.h; sourceTree = "<group>"; };
D9F28AE8207203D100CE451B /* CustomEBHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomEBHandler.h; sourceTree = "<group>"; };
D9F28AE9207203D100CE451B /* CustomEBHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomEBHandler.m; sourceTree = "<group>"; };
DC5E503C1D0D97130059F0EB /* weex.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = weex.png; sourceTree = "<group>"; };
Expand Down Expand Up @@ -240,12 +246,13 @@
D5ADF0861C77133B00597CA6 /* Source */ = {
isa = PBXGroup;
children = (
2AE88A291C8544D7003329DE /* scanner */,
DCABAFED1D029642001C8592 /* debug */,
D9A89595214B5C3F00AE5DCC /* lottie */,
D95084AB2046CFCF003F3CC0 /* NSString+Additions.h */,
D95084AC2046CFD0003F3CC0 /* NSString+Additions.m */,
D95084A82046CF9A003F3CC0 /* WXURLResolver.h */,
D95084A92046CF9A003F3CC0 /* WXURLResolver.m */,
2AE88A291C8544D7003329DE /* scanner */,
DCABAFED1D029642001C8592 /* debug */,
74CC79E91C2B9E4700829368 /* UIViewController+WXDemoNaviBar.h */,
74CC79EA1C2B9E4700829368 /* UIViewController+WXDemoNaviBar.m */,
775BEE811C1E8ECC008D1629 /* AppDelegate.h */,
Expand All @@ -261,6 +268,17 @@
name = Source;
sourceTree = "<group>";
};
D9A89595214B5C3F00AE5DCC /* lottie */ = {
isa = PBXGroup;
children = (
D9A89598214B5C3F00AE5DCC /* WXLottieComponent.h */,
D9A89596214B5C3F00AE5DCC /* WXLottieComponent.m */,
D9A89599214B5C3F00AE5DCC /* WXLottieBindingXHandler.h */,
D9A89597214B5C3F00AE5DCC /* WXLottieBindingXHandler.m */,
);
path = lottie;
sourceTree = "<group>";
};
DC65C4421CEB006C00B2F84F /* resource */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -508,6 +526,7 @@
buildActionMask = 2147483647;
files = (
DCABAFF31D029685001C8592 /* WXATLoggerPlugin.m in Sources */,
D9A8959A214B5C3F00AE5DCC /* WXLottieComponent.m in Sources */,
D9F28AEA207203D100CE451B /* CustomEBHandler.m in Sources */,
2AE88A2C1C8544E6003329DE /* WXScannerVC.m in Sources */,
D95084A72046CE71003F3CC0 /* WXNavigationImpl.m in Sources */,
Expand All @@ -520,6 +539,7 @@
775BEE831C1E8ECC008D1629 /* AppDelegate.m in Sources */,
DCABAFF41D029685001C8592 /* WXATViewHierarchyPlugin.m in Sources */,
775BEE801C1E8ECC008D1629 /* main.m in Sources */,
D9A8959B214B5C3F00AE5DCC /* WXLottieBindingXHandler.m in Sources */,
DCABAFFE1D029753001C8592 /* WXImgLoaderDefaultImpl.m in Sources */,
747DF6681E2F176A005C53A8 /* UIView+UIThreadCheck.m in Sources */,
);
Expand Down
14 changes: 7 additions & 7 deletions weex/playground/ios/WeexDemo/CustomEBHandler.h
@@ -1,10 +1,10 @@
//
// CustomEBHandler.h
// WeexDemo
//
// Created by 对象 on 2018/4/2.
// Copyright © 2018年 taobao. All rights reserved.
//
/**
* Created by Weex.
* Copyright (c) 2016, Alibaba, Inc. All rights reserved.
*
* This source code is licensed under the Apache Licence 2.0.
* For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
*/

#import <Foundation/Foundation.h>
#import <BindingX/EBHandlerFactory.h>
Expand Down
14 changes: 7 additions & 7 deletions weex/playground/ios/WeexDemo/CustomEBHandler.m
@@ -1,10 +1,10 @@
//
// CustomEBHandler.m
// WeexDemo
//
// Created by 对象 on 2018/4/2.
// Copyright © 2018年 taobao. All rights reserved.
//
/**
* Created by Weex.
* Copyright (c) 2016, Alibaba, Inc. All rights reserved.
*
* This source code is licensed under the Apache Licence 2.0.
* For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
*/

#import "CustomEBHandler.h"

Expand Down
13 changes: 13 additions & 0 deletions weex/playground/ios/WeexDemo/lottie/WXLottieBindingXHandler.h
@@ -0,0 +1,13 @@
/**
* Created by Weex.
* Copyright (c) 2016, Alibaba, Inc. All rights reserved.
*
* This source code is licensed under the Apache Licence 2.0.
* For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
*/

#import "EBHandlerFactory.h"

@interface WXLottieBindingXHandler : NSObject <EBHandlerProtocol>

@end
24 changes: 24 additions & 0 deletions weex/playground/ios/WeexDemo/lottie/WXLottieBindingXHandler.m
@@ -0,0 +1,24 @@
/**
* Created by Weex.
* Copyright (c) 2016, Alibaba, Inc. All rights reserved.
*
* This source code is licensed under the Apache Licence 2.0.
* For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
*/

#import "WXLottieBindingXHandler.h"
#import "WXLottieComponent.h"

@implementation WXLottieBindingXHandler

- (void)execute:(NSDictionary *)properties to:(id)target {
if ([target isKindOfClass:WXLottieComponent.class]) {
id progress = properties[@"lottie-progress"];
if (progress) {
WXLottieComponent *lottie = (WXLottieComponent *)target;
[lottie setProgress:[WXConvert CGFloat:progress]];
}
}
}

@end
18 changes: 18 additions & 0 deletions weex/playground/ios/WeexDemo/lottie/WXLottieComponent.h
@@ -0,0 +1,18 @@
/**
* Created by Weex.
* Copyright (c) 2016, Alibaba, Inc. All rights reserved.
*
* This source code is licensed under the Apache Licence 2.0.
* For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
*/

#import <Foundation/Foundation.h>
#import <WeexSDK/WeexSDK.h>
#import <WeexSDK/WXResourceLoader.h>
#import <WeexPluginLoader/WeexPluginLoader.h>

@interface WXLottieComponent : WXComponent

- (void)setProgress:(CGFloat)progress;

@end

0 comments on commit 49d4562

Please sign in to comment.