[05/15] incubator-weex git commit: * [ios] use bitmap context to draw compositing
* [ios] use bitmap context to draw compositing Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/3a714ac3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/3a714ac3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/3a714ac3 Branch: refs/heads/0.12-dev Commit: 3a714ac333b2d230d11e6c8c2e94ab94988049da Parents: c6d980d Author: éé£Authored: Wed Apr 5 20:17:20 2017 +0800 Committer: éé£ Committed: Wed Apr 5 20:17:20 2017 +0800 -- .../Sources/Component/WXImageComponent.m| 2 +- .../WeexSDK/Sources/Component/WXTextComponent.m | 10 ++-- .../Sources/Display/WXComponent+Display.m | 49 +--- ios/sdk/WeexSDK/Sources/Model/WXComponent.h | 4 +- 4 files changed, 38 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3a714ac3/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m index 1e2594c..2527adc 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m @@ -167,7 +167,7 @@ static dispatch_queue_t WXImageUpdateQueue; } } -- (UIImage *)drawRect:(CGRect)rect +- (UIImage *)drawRect:(CGRect)rect withContext:(CGContextRef)context; { if (!self.image) { [self updateImage]; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3a714ac3/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m index 4ee3860..ff98d2d 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m @@ -201,13 +201,13 @@ do {\ return YES; } -- (UIImage *)drawRect:(CGRect)rect +- (UIImage *)drawRect:(CGRect)rect withContext:(CGContextRef)context; { if (_isCompositingChild) { -[self drawTextWithBounds:rect padding:_padding view:nil]; +[self drawTextWithContext:context bounds:rect padding:_padding view:nil]; } else { WXText *textView = ((WXText *)self.view); -[self drawTextWithBounds:rect padding:_padding view:textView]; +[self drawTextWithContext:context bounds:rect padding:_padding view:textView]; } return nil; @@ -413,14 +413,12 @@ do {\ [self syncTextStorageForView]; } -- (void)drawTextWithBounds:(CGRect)bounds padding:(UIEdgeInsets)padding view:(WXText *)view +- (void)drawTextWithContext:(CGContextRef)context bounds:(CGRect)bounds padding:(UIEdgeInsets)padding view:(WXText *)view { if (bounds.size.width <=0 || bounds.size.height <= 0) { return; } -CGContextRef context = UIGraphicsGetCurrentContext(); - if ([self _needsDrawBorder]) { [self _drawBorderWithContext:context size:bounds.size]; } else { http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3a714ac3/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m -- diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m index fdd02a1..b548663 100644 --- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m +++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m @@ -58,7 +58,7 @@ return YES; } -- (UIImage *)drawRect:(CGRect)rect +- (UIImage *)drawRect:(CGRect)rect withContext:(CGContextRef)context { CGSize size = rect.size; if (size.width <= 0 || size.height <= 0) { @@ -66,7 +66,6 @@ return nil; } -CGContextRef context = UIGraphicsGetCurrentContext(); [self _drawBorderWithContext:context size:size]; return nil; @@ -80,7 +79,8 @@ } UIGraphicsBeginImageContextWithOptions(bounds.size, [self _bitmapOpaqueWithSize:bounds.size] , 0.0); -UIImage *image = [self drawRect:bounds]; +CGContextRef context = UIGraphicsGetCurrentContext(); +UIImage *image = [self drawRect:bounds withContext:context]; if (!image) { image = UIGraphicsGetImageFromCurrentImageContext(); } @@ -176,16 +176,32 @@ - (CGContextRef)beginDrawContext:(CGRect)bounds { -UIGraphicsBeginImageContextWithOptions(bounds.size, [self _bitmapOpaqueWithSize:bounds.size], 0.0); -CGContextRef context = UIGraphicsGetCurrentContext(); +//UIGraphicsBeginImageContextWithOptions(bounds.size, [self
[10/15] incubator-weex git commit: Merge remote-tracking branch 'upstream/0.12-dev' into ios-feature-composite
Merge remote-tracking branch 'upstream/0.12-dev' into ios-feature-composite Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/29a47f87 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/29a47f87 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/29a47f87 Branch: refs/heads/0.12-dev Commit: 29a47f87f1b3c7522bf7ce4bdfdddcb2af320813 Parents: e3ee82f 6e4dcfb Author: éé£Authored: Sun Apr 9 19:54:53 2017 +0800 Committer: éé£ Committed: Sun Apr 9 19:54:53 2017 +0800 -- android/sdk/assets/main.js | 14 ++-- .../java/com/taobao/weex/WXSDKInstance.java | 15 ++-- .../com/taobao/weex/ui/component/WXSlider.java | 81 ++-- .../taobao/weex/ui/view/WXCircleViewPager.java | 21 +++-- build/config.js | 8 +- build/karma.vue.conf.js | 15 ++-- build/webpack.examples.config.js| 4 +- doc/source/cn/references/modules/dom.md | 3 +- doc/source/references/modules/dom.md| 3 +- examples/module/componentRect.we| 4 +- html5/frameworks/legacy/app/ctrl/init.js| 42 -- html5/frameworks/legacy/static/life.js | 8 +- ios/sdk/WeexSDK/Resources/main.js | 14 ++-- .../WeexSDK/Sources/Bridge/WXBridgeContext.m| 4 + ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m | 77 +++ .../WeexSDK/Sources/Protocol/WXBridgeProtocol.h | 5 ++ package.json| 9 ++- test/pages/slider-infinite.vue | 49 test/scripts/components/slider-infinite.test.js | 38 + 19 files changed, 357 insertions(+), 57 deletions(-) --
[04/15] incubator-weex git commit: * [ios] support view compositing
* [ios] support view compositing Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/c6d980d3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/c6d980d3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/c6d980d3 Branch: refs/heads/0.12-dev Commit: c6d980d30001fa50c25b6c91434cbbb85b24021f Parents: dbe2f32 Author: éé£Authored: Wed Apr 5 19:48:08 2017 +0800 Committer: éé£ Committed: Wed Apr 5 19:48:08 2017 +0800 -- .../Sources/Component/WXComponent_internal.h| 8 +- .../Sources/Component/WXImageComponent.m| 50 ++--- .../WeexSDK/Sources/Component/WXTextComponent.m | 89 - .../Sources/Display/WXComponent+Display.m | 191 --- ios/sdk/WeexSDK/Sources/Display/WXRoundedRect.h | 2 + .../WeexSDK/Sources/Display/WXRoundedRect.mm| 5 + ios/sdk/WeexSDK/Sources/Model/WXComponent.h | 55 +- ios/sdk/WeexSDK/Sources/Model/WXComponent.m | 7 +- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 6 +- 9 files changed, 248 insertions(+), 165 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c6d980d3/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h index 28f9d2e..00f0ef4 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h +++ b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h @@ -81,8 +81,8 @@ * Display */ CALayer *_layer; -BOOL _composite; -BOOL _compositingChild; +BOOL _useCompositing; +BOOL _isCompositingChild; WXThreadSafeCounter *_displayCounter; UIColor *_borderTopColor; @@ -185,6 +185,10 @@ - (void)_setupNavBarWithStyles:(NSMutableDictionary *)styles attributes:(NSMutableDictionary *)attributes; +- (void)_initCompositingAttribute:(NSDictionary *)attributes; + +- (BOOL)_bitmapOpaqueWithSize:(CGSize)size; + - (void)_updateNavBarAttributes:(NSDictionary *)attributes; - (void)_handleFirstScreenTime; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c6d980d3/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m index d5d9ca6..1e2594c 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m @@ -158,38 +158,21 @@ static dispatch_queue_t WXImageUpdateQueue; } -- (WXDisplayBlock)displayBlock +- (BOOL)needsDrawRect { -if ([self isViewLoaded]) { -// if has a image view, image is setted by image view, displayBlock is not needed -return nil; +if (_isCompositingChild) { +return YES; +} else { +return NO; } - -__weak typeof(self) weakSelf = self; -return ^UIImage *(CGRect bounds, BOOL(^isCancelled)(void)) { -if (isCancelled()) { -return nil; -} - -if (!weakSelf.image) { -[weakSelf updateImage]; -return nil; -} - -if (isCancelled && isCancelled()) { -return nil; -} - -UIGraphicsBeginImageContextWithOptions(bounds.size, self.layer.opaque, 1.0); - -[weakSelf.image drawInRect:bounds]; - -UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - -UIGraphicsEndImageContext(); - -return image; -}; +} + +- (UIImage *)drawRect:(CGRect)rect +{ +if (!self.image) { +[self updateImage]; +} +return self.image; } - (void)viewWillUnload @@ -262,6 +245,9 @@ static dispatch_queue_t WXImageUpdateQueue; ((UIImageView *)strongSelf.view).image = image; weakSelf.imageDownloadFinish = YES; [self readyToRender]; +} else if (strongSelf->_isCompositingChild) { +strongSelf->_image = image; +weakSelf.imageDownloadFinish = YES; } }); }]; @@ -302,6 +288,10 @@ static dispatch_queue_t WXImageUpdateQueue; strongSelf.imageDownloadFinish = YES; ((UIImageView *)strongSelf.view).image = image; [strongSelf readyToRender]; +} else if (strongSelf->_isCompositingChild) { +strongSelf.imageDownloadFinish = YES; +strongSelf->_image = image; +
[13/15] incubator-weex git commit: * [ios] remove unused if
* [ios] remove unused if Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/99b83db4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/99b83db4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/99b83db4 Branch: refs/heads/0.12-dev Commit: 99b83db46fd46f6adf0c4d7ba36caa70749dfef2 Parents: 4a7a54b Author: éé£Authored: Mon Apr 10 11:13:58 2017 +0800 Committer: éé£ Committed: Mon Apr 10 11:13:58 2017 +0800 -- ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m | 3 --- 1 file changed, 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/99b83db4/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m -- diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m index a02f53a..937339e 100644 --- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m +++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m @@ -277,9 +277,6 @@ if (shouldDisplay) { dispatch_block_t displayBlockToPush = ^{ -if (!context) { - -} CGContextSaveGState(context); CGContextTranslateCTM(context, frame.origin.x, frame.origin.y);
[15/15] incubator-weex git commit: Merge branch 'ios-feature-composite' of https://github.com/cxfeng1/incubator-weex into 0.12-dev
Merge branch 'ios-feature-composite' of https://github.com/cxfeng1/incubator-weex into 0.12-dev Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/219cd30a Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/219cd30a Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/219cd30a Branch: refs/heads/0.12-dev Commit: 219cd30a5e92e645c66d3dbc8e0b91fb6b00614e Parents: 68b2b57 c8c75a2 Author: cxfengAuthored: Mon Apr 10 13:53:35 2017 +0800 Committer: cxfeng Committed: Mon Apr 10 13:53:35 2017 +0800 -- examples/vue/index.vue | 10 +- examples/vue/showcase/compositing.vue | 89 .../WeexSDK/Sources/Component/WXCellComponent.m | 10 +- .../Sources/Component/WXComponent_internal.h| 8 +- .../Sources/Component/WXImageComponent.m| 90 +--- .../WeexSDK/Sources/Component/WXTextComponent.m | 134 .../Sources/Display/WXComponent+Display.m | 218 +-- ios/sdk/WeexSDK/Sources/Display/WXRoundedRect.h | 4 + .../WeexSDK/Sources/Display/WXRoundedRect.mm| 10 + ios/sdk/WeexSDK/Sources/Model/WXComponent.h | 68 +- ios/sdk/WeexSDK/Sources/Model/WXComponent.m | 7 +- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 4 +- test/scripts/components/recycler.test.js| 2 - 13 files changed, 434 insertions(+), 220 deletions(-) --
[02/15] incubator-weex git commit: Merge remote-tracking branch 'upstream/0.12-dev' into ios-feature-composite
Merge remote-tracking branch 'upstream/0.12-dev' into ios-feature-composite Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/82412d7a Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/82412d7a Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/82412d7a Branch: refs/heads/0.12-dev Commit: 82412d7a6782a178ac45cada69aa7ce184fa06ae Parents: 5312427 d240048 Author: éé£Authored: Wed Apr 5 14:38:19 2017 +0800 Committer: éé£ Committed: Wed Apr 5 14:38:19 2017 +0800 -- .eslintrc | 13 +- .flowconfig | 16 + .../src/main/java/com/alibaba/weex/Utility.java | 277 + .../java/com/alibaba/weex/WXPageActivity.java | 58 + .../app/src/main/res/layout/id_stub.xml | 57 + .../java/com/taobao/weex/WXSDKInstance.java | 12 +- .../taobao/weex/ui/component/WXComponent.java |7 +- .../com/taobao/weex/ui/component/WXImage.java |6 + bin/dist-vue.sh | 42 + build/config.js |9 +- build/karma.vue.conf.js | 64 +- build/webpack.examples.web.config.js| 24 +- dangerfile.js | 30 + examples/vue/animation.vue |4 +- examples/vue/components/countdown.vue |2 +- examples/vue/components/image.vue |2 +- examples/vue/components/list.vue| 19 +- examples/vue/components/marquee.vue |3 +- examples/vue/components/navigator.vue |7 +- examples/vue/components/scroller.vue| 34 +- examples/vue/components/slider.vue | 22 +- examples/vue/components/text.vue|2 +- examples/vue/components/textarea.vue| 57 + examples/vue/components/video.vue |2 +- examples/vue/components/web.vue |2 +- examples/vue/iconfont.vue |2 +- examples/vue/include/base-url.js|4 +- examples/vue/include/button.vue |2 +- examples/vue/include/countdown.vue |2 +- examples/vue/include/example-list-item.vue |2 +- examples/vue/include/example-list.vue |2 +- examples/vue/include/h1.vue |2 +- examples/vue/include/h2.vue |2 +- examples/vue/include/h3.vue |2 +- examples/vue/include/hn.vue |2 +- examples/vue/include/list-item.vue |2 +- examples/vue/include/marquee.vue|4 +- examples/vue/include/navbar.vue |2 +- examples/vue/include/navpage.vue|2 +- examples/vue/include/panel.vue | 10 +- examples/vue/include/slider-item.vue|2 +- examples/vue/include/slider-page.vue|5 +- examples/vue/include/tabbar.vue |6 +- examples/vue/include/tabitem.vue|2 +- examples/vue/include/tip.vue|2 +- examples/vue/include/wxc-list-item.vue |2 +- examples/vue/modules/stream.vue |2 +- examples/vue/showcase/calculator.vue|2 +- examples/vue/showcase/include/banners.vue |4 +- examples/vue/showcase/include/brand.vue |2 +- examples/vue/showcase/include/category.vue |8 +- examples/vue/showcase/include/coupon.vue|2 +- examples/vue/showcase/include/goods.vue |4 +- examples/vue/showcase/include/headlines.vue |2 +- examples/vue/showcase/include/match.vue |4 +- examples/vue/showcase/include/resource.vue |2 +- examples/vue/showcase/include/scene.vue |4 +- examples/vue/showcase/itemlist.vue | 246 +- examples/vue/showcase/new-fashion.vue |2 +- examples/vue/style/index.vue|2 +- examples/vue/style/style-box.vue|2 +- examples/vue/style/style-flex.vue |2 +- examples/vue/style/style-item.vue |2 +- examples/vue/syntax/hello-world-3.vue |4 +- examples/vue/syntax/hello-world-4.vue |4 +- examples/vue/syntax/hello-world-5.vue |4 +- examples/vue/syntax/hello-world.vue |4 +- examples/vue/syntax/include/btn.vue |2 +- examples/vue/syntax/include/sub.vue |2 +- examples/vue/syntax/script-component.vue|2 +- examples/vue/syntax/script-data.vue |2 +- examples/vue/syntax/script-events.vue |4 +- examples/vue/syntax/script-instance.vue |2
[08/15] incubator-weex git commit: * [ios] Add public method to trigger display
* [ios] Add public method to trigger display Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/a069edb7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/a069edb7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/a069edb7 Branch: refs/heads/0.12-dev Commit: a069edb7ad815893eb2e330307bca5c211ebacfd Parents: 3844a25 Author: éé£Authored: Thu Apr 6 15:59:20 2017 +0800 Committer: éé£ Committed: Thu Apr 6 15:59:20 2017 +0800 -- ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m | 5 + ios/sdk/WeexSDK/Sources/Model/WXComponent.h | 5 + 2 files changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a069edb7/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m -- diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m index 0d4bca1..a72e84d 100644 --- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m +++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m @@ -191,6 +191,11 @@ } } +- (void)triggerDisplay +{ +[self _willDisplayLayer:_layer]; +} + - (CGContextRef)beginDrawContext:(CGRect)bounds { UIGraphicsBeginImageContextWithOptions(bounds.size, [self _bitmapOpaqueWithSize:bounds.size], 0.0); http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a069edb7/ios/sdk/WeexSDK/Sources/Model/WXComponent.h -- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.h b/ios/sdk/WeexSDK/Sources/Model/WXComponent.h index bec45d1..c2cc3b9 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.h +++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.h @@ -361,6 +361,11 @@ NS_ASSUME_NONNULL_BEGIN - (void)readyToRender; /** + * @abstract trigger display if you do not have a WXLayer + */ +- (void)triggerDisplay; + +/** * @abstract Creates a graphics context with the specified bounds, the context will be used for `drawRect:` in compositing environment * @discussion You can override this method to use your own graphics context. */
[11/15] incubator-weex git commit: * [ios] support border-x-x-radius in image.
* [ios] support border-x-x-radius in image. Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/aab1eefb Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/aab1eefb Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/aab1eefb Branch: refs/heads/0.12-dev Commit: aab1eefbbce4dbe3b47c555afe834a85a5b16cd7 Parents: 29a47f8 Author: éé£Authored: Sun Apr 9 21:43:23 2017 +0800 Committer: éé£ Committed: Sun Apr 9 21:43:23 2017 +0800 -- .../Sources/Component/WXImageComponent.m| 44 +++- .../Sources/Display/WXComponent+Display.m | 2 +- ios/sdk/WeexSDK/Sources/Display/WXRoundedRect.h | 2 + .../WeexSDK/Sources/Display/WXRoundedRect.mm| 5 +++ 4 files changed, 50 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/aab1eefb/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m index 73696fd..974bd65 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m @@ -14,6 +14,8 @@ #import "WXType.h" #import "WXConvert.h" #import "WXURLRewriteProtocol.h" +#import "WXRoundedRect.h" +#import "UIBezierPath+Weex.h" @interface WXImageView : UIImageView @@ -154,6 +156,8 @@ static dispatch_queue_t WXImageUpdateQueue; imageView.clipsToBounds = YES; imageView.exclusiveTouch = YES; +[self _clipsToBounds]; + [self updateImage]; } @@ -171,6 +175,16 @@ static dispatch_queue_t WXImageUpdateQueue; { if (!self.image) { [self updateImage]; +return nil; +} + +WXRoundedRect *borderRect = [[WXRoundedRect alloc] initWithRect:rect topLeft:_borderTopLeftRadius topRight:_borderTopRightRadius bottomLeft:_borderBottomLeftRadius bottomRight:_borderBottomRightRadius]; + +WXRadii *radii = borderRect.radii; +if ([radii hasBorderRadius]) { +CGFloat topLeft = radii.topLeft, topRight = radii.topRight, bottomLeft = radii.bottomLeft, bottomRight = radii.bottomRight; +UIBezierPath *bezierPath = [UIBezierPath wx_bezierPathWithRoundedRect:rect topLeft:topLeft topRight:topRight bottomLeft:bottomLeft bottomRight:bottomRight]; +[bezierPath addClip]; } return self.image; } @@ -182,6 +196,13 @@ static dispatch_queue_t WXImageUpdateQueue; _image = nil; } +- (void)_frameDidCalculated:(BOOL)isChanged +{ +if ([self isViewLoaded] && isChanged) { +[self _clipsToBounds]; +} +} + - (void)setImageSrc:(NSString*)src { if (![src isEqualToString:_imageSrc]) { @@ -325,9 +346,28 @@ static dispatch_queue_t WXImageUpdateQueue; return imageLoader; } -- (BOOL)_needsDrawBorder +- (void)_clipsToBounds { -return NO; +if (!_clipToBounds) { +return; +} + +WXRoundedRect *borderRect = [[WXRoundedRect alloc] initWithRect:self.view.bounds topLeft:_borderTopLeftRadius topRight:_borderTopRightRadius bottomLeft:_borderBottomLeftRadius bottomRight:_borderBottomRightRadius]; +// here is computed radii, do not use original style +WXRadii *radii = borderRect.radii; + +if ([radii radiusesAreEqual]) { +return; +} + +CGFloat topLeft = radii.topLeft, topRight = radii.topRight, bottomLeft = radii.bottomLeft, bottomRight = radii.bottomRight; + +// clip to border radius +UIBezierPath *bezierPath = [UIBezierPath wx_bezierPathWithRoundedRect:self.view.bounds topLeft:topLeft topRight:topRight bottomLeft:bottomLeft bottomRight:bottomRight]; + +CAShapeLayer *shapeLayer = [CAShapeLayer layer]; +shapeLayer.path = bezierPath.CGPath; +self.layer.mask = shapeLayer; } #ifdef UITEST http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/aab1eefb/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m -- diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m index 9dbe63a..a02f53a 100644 --- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m +++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m @@ -555,7 +555,7 @@ do {\ WXRoundedRect *borderRect = [[WXRoundedRect alloc] initWithRect:rect topLeft:_borderTopLeftRadius topRight:_borderTopRightRadius bottomLeft:_borderBottomLeftRadius bottomRight:_borderBottomRightRadius]; WXRadii *radii = borderRect.radii; BOOL hasBorderRadius = [radii hasBorderRadius]; -return (!hasBorderRadius) &&
[06/15] incubator-weex git commit: * [ios] UIGraphicsPushContext to push context, fix invalid context 0x0 problem.
* [ios] UIGraphicsPushContext to push context, fix invalid context 0x0 problem. Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d81b656f Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d81b656f Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d81b656f Branch: refs/heads/0.12-dev Commit: d81b656f146b5642faf7aa38b1d469b50c6e8051 Parents: 3a714ac Author: éé£Authored: Wed Apr 5 20:25:42 2017 +0800 Committer: éé£ Committed: Wed Apr 5 20:25:42 2017 +0800 -- ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m | 2 +- ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m | 3 ++- .../WeexSDK/Sources/Display/WXComponent+Display.m| 15 +-- ios/sdk/WeexSDK/Sources/Model/WXComponent.h | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d81b656f/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m index 2527adc..73696fd 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m @@ -167,7 +167,7 @@ static dispatch_queue_t WXImageUpdateQueue; } } -- (UIImage *)drawRect:(CGRect)rect withContext:(CGContextRef)context; +- (UIImage *)drawRect:(CGRect)rect; { if (!self.image) { [self updateImage]; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d81b656f/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m index ff98d2d..42fccfb 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m @@ -201,8 +201,9 @@ do {\ return YES; } -- (UIImage *)drawRect:(CGRect)rect withContext:(CGContextRef)context; +- (UIImage *)drawRect:(CGRect)rect; { +CGContextRef context = UIGraphicsGetCurrentContext(); if (_isCompositingChild) { [self drawTextWithContext:context bounds:rect padding:_padding view:nil]; } else { http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d81b656f/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m -- diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m index b548663..6428ecb 100644 --- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m +++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m @@ -58,7 +58,7 @@ return YES; } -- (UIImage *)drawRect:(CGRect)rect withContext:(CGContextRef)context +- (UIImage *)drawRect:(CGRect)rect { CGSize size = rect.size; if (size.width <= 0 || size.height <= 0) { @@ -66,6 +66,7 @@ return nil; } +CGContextRef context = UIGraphicsGetCurrentContext(); [self _drawBorderWithContext:context size:size]; return nil; @@ -79,8 +80,7 @@ } UIGraphicsBeginImageContextWithOptions(bounds.size, [self _bitmapOpaqueWithSize:bounds.size] , 0.0); -CGContextRef context = UIGraphicsGetCurrentContext(); -UIImage *image = [self drawRect:bounds withContext:context]; +UIImage *image = [self drawRect:bounds]; if (!image) { image = UIGraphicsGetImageFromCurrentImageContext(); } @@ -228,6 +228,8 @@ [self _collectCompositingDisplayBlocks:displayBlocks context:context isCancelled:isCancelled]; +UIGraphicsPushContext(context); + for (dispatch_block_t block in displayBlocks) { if (isCancelled()) { UIGraphicsEndImageContext(); @@ -236,6 +238,8 @@ block(); } +UIGraphicsPopContext(); + UIImage *image = [self endDrawContext:context]; return image; }; @@ -273,10 +277,9 @@ [[UIBezierPath bezierPathWithRect:bounds] addClip]; } -UIImage *image = [self drawRect:bounds withContext:context]; +UIImage *image = [self drawRect:bounds]; if (image) { -CGContextDrawImage(context, bounds, image.CGImage); -//[image drawInRect:bounds]; +[image drawInRect:bounds]; } }; [displayBlocks addObject:[displayBlockToPush copy]];
[03/15] incubator-weex git commit: * [ios] remove NSTextStorage lock because it is not necessary for thread safety
* [ios] remove NSTextStorage lock because it is not necessary for thread safety Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/dbe2f321 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/dbe2f321 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/dbe2f321 Branch: refs/heads/0.12-dev Commit: dbe2f321bc37fc308c3b75ef8c48d77b7a4b17be Parents: 82412d7 Author: éé£Authored: Wed Apr 5 17:50:47 2017 +0800 Committer: éé£ Committed: Wed Apr 5 17:50:47 2017 +0800 -- .../WeexSDK/Sources/Component/WXTextComponent.m | 46 +--- 1 file changed, 1 insertion(+), 45 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/dbe2f321/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m index f18ac94..77e7ce2 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.m @@ -119,16 +119,6 @@ WXTextDecoration _textDecoration; NSString *_textOverflow; CGFloat _lineHeight; - - -pthread_mutex_t _textStorageMutex; -pthread_mutexattr_t _textStorageMutexAttr; -} - -static BOOL _isUsingTextStorageLock = NO; -+ (void)useTextStorageLock:(BOOL)isUsingTextStorageLock -{ -_isUsingTextStorageLock = isUsingTextStorageLock; } - (instancetype)initWithRef:(NSString *)ref @@ -140,12 +130,6 @@ static BOOL _isUsingTextStorageLock = NO; { self = [super initWithRef:ref type:type styles:styles attributes:attributes events:events weexInstance:weexInstance]; if (self) { -if (_isUsingTextStorageLock) { -pthread_mutexattr_init(&_textStorageMutexAttr); -pthread_mutexattr_settype(&_textStorageMutexAttr, PTHREAD_MUTEX_RECURSIVE); -pthread_mutex_init(&_textStorageMutex, &_textStorageMutexAttr); -} - [self fillCSSStyles:styles]; [self fillAttributes:attributes]; } @@ -155,10 +139,6 @@ static BOOL _isUsingTextStorageLock = NO; - (void)dealloc { -if (_isUsingTextStorageLock) { -pthread_mutex_destroy(&_textStorageMutex); -pthread_mutexattr_destroy(&_textStorageMutexAttr); -} [[NSNotificationCenter defaultCenter] removeObserver:self]; } @@ -226,13 +206,7 @@ do {\ - (void)setNeedsRepaint { -if (_isUsingTextStorageLock) { -pthread_mutex_lock(&_textStorageMutex); -} _textStorage = nil; -if (_isUsingTextStorageLock) { -pthread_mutex_unlock(&_textStorageMutex); -} } #pragma mark - Subclass @@ -244,13 +218,7 @@ do {\ - (void)viewDidLoad { -if (_isUsingTextStorageLock) { -pthread_mutex_lock(&_textStorageMutex); -} ((WXText *)self.view).textStorage = _textStorage; -if (_isUsingTextStorageLock) { -pthread_mutex_unlock(&_textStorageMutex); -} [self setNeedsDisplay]; } @@ -435,14 +403,7 @@ do {\ [layoutManager ensureLayoutForTextContainer:textContainer]; _textStorageWidth = width; - -if (_isUsingTextStorageLock) { -pthread_mutex_lock(&_textStorageMutex); -} _textStorage = textStorage; -if (_isUsingTextStorageLock) { -pthread_mutex_unlock(&_textStorageMutex); -} return textStorage; } @@ -454,13 +415,8 @@ do {\ [self.weexInstance.componentManager _addUITask:^{ if ([self isViewLoaded]) { -if (_isUsingTextStorageLock) { -pthread_mutex_lock(&_textStorageMutex); -} ((WXText *)self.view).textStorage = textStorage; -if (_isUsingTextStorageLock) { -pthread_mutex_unlock(&_textStorageMutex); -} + [self readyToRender]; // notify super component [self setNeedsDisplay]; }
[09/15] incubator-weex git commit: * [ios] bring triggerDisplay to main thread
* [ios] bring triggerDisplay to main thread Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e3ee82fb Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e3ee82fb Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e3ee82fb Branch: refs/heads/0.12-dev Commit: e3ee82fb483031404131eba65fd66f9eb8c10083 Parents: a069edb Author: éé£Authored: Thu Apr 6 16:03:51 2017 +0800 Committer: éé£ Committed: Thu Apr 6 16:03:51 2017 +0800 -- ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e3ee82fb/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m -- diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m index a72e84d..9dbe63a 100644 --- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m +++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m @@ -193,7 +193,9 @@ - (void)triggerDisplay { -[self _willDisplayLayer:_layer]; +WXPerformBlockOnMainThread(^{ +[self _willDisplayLayer:_layer]; +}); } - (CGContextRef)beginDrawContext:(CGRect)bounds
[14/15] incubator-weex git commit: Merge branch '0.12-dev' into ios-feature-composite
Merge branch '0.12-dev' into ios-feature-composite Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/c8c75a26 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/c8c75a26 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/c8c75a26 Branch: refs/heads/0.12-dev Commit: c8c75a268433640d30ba23453398c3872bef298a Parents: 99b83db 5b1126a Author: éå°é£Authored: Mon Apr 10 11:53:06 2017 +0800 Committer: GitHub Committed: Mon Apr 10 11:53:06 2017 +0800 -- .../taobao/weex/ui/component/WXComponent.java | 23 ++- .../taobao/weex/ui/view/gesture/WXGesture.java | 14 ++ .../Component/Recycler/WXRecyclerComponent.m| 1 + .../WeexSDK/Sources/Component/WXListComponent.m | 2 + .../Sources/Display/WXComponent+Display.m | 1 + ios/sdk/WeexSDK/Sources/Model/WXComponent.h | 6 + ios/sdk/WeexSDK/Sources/Model/WXComponent.m | 5 + ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 2 +- ios/sdk/WeexSDK/Sources/Utility/WXDefine.h | 11 ++ ios/sdk/WeexSDK/Sources/Utility/WXType.h| 5 + .../Sources/View/WXComponent+ViewManagement.m | 3 + test/pages/components/recycler.vue | 29 ++-- test/scripts/components/recycler.test.js| 147 ++- 13 files changed, 160 insertions(+), 89 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c8c75a26/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c8c75a26/ios/sdk/WeexSDK/Sources/Model/WXComponent.h -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c8c75a26/ios/sdk/WeexSDK/Sources/Model/WXComponent.m -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c8c75a26/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m -- diff --cc ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index 66985a9,83bcd7d..f7ef622 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@@ -292,10 -292,8 +292,10 @@@ typedef enum : NSUInteger } [[WXSDKManager bridgeMgr] destroyInstance:self.instanceId]; - + -[self.componentManager invalidate]; +if (_componentManager) { +[_componentManager invalidate]; +} __weak typeof(self) weakSelf = self; WXPerformBlockOnComponentThread(^{ __strong typeof(self) strongSelf = weakSelf; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c8c75a26/test/scripts/components/recycler.test.js -- diff --cc test/scripts/components/recycler.test.js index bbf20a8,21e8f79..9850945 --- a/test/scripts/components/recycler.test.js +++ b/test/scripts/components/recycler.test.js @@@ -37,9 -37,11 +37,9 @@@ describe('recycler', function () const driver = util.createDriver(wd) before(function () { - -console.log(util.getPage('/components/recycler.js')) return util.init(driver) .get(util.getPage('/components/recycler.js')) - .waitForElementByXPath('//recycler[1]',util.getGETActionWaitTimeMills(),1000) + .waitForElementById('waterfall',util.getGETActionWaitTimeMills(),1000) }); after(function () {
[12/15] incubator-weex git commit: + [example] Add compositing showcase
+ [example] Add compositing showcase Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/4a7a54b3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/4a7a54b3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/4a7a54b3 Branch: refs/heads/0.12-dev Commit: 4a7a54b3aed794774fd0e242ca1c2bd33e00d439 Parents: aab1eef Author: éé£Authored: Sun Apr 9 22:05:10 2017 +0800 Committer: éé£ Committed: Sun Apr 9 22:05:10 2017 +0800 -- examples/vue/index.vue| 10 +++- examples/vue/showcase/compositing.vue | 89 ++ 2 files changed, 98 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4a7a54b3/examples/vue/index.vue -- diff --git a/examples/vue/index.vue b/examples/vue/index.vue index e37931d..fb4693d 100644 --- a/examples/vue/index.vue +++ b/examples/vue/index.vue @@ -6,8 +6,9 @@ module.exports = { data: function () { var root = typeof window === 'object' ? 'vue-web/vue' : 'vue' + return { -items: [ +items: [ // common {name: root + '/syntax/hello-world', title: 'Hello World'}, {name: root + '/style/index', title: 'Common Style'}, @@ -49,6 +50,13 @@ }, components: { exampleList: require('./include/example-list.vue') +}, +created: function() { + let root = typeof window === 'object' ? 'vue-web/vue' : 'vue' + let platform = this.$getConfig().env.platform.toLowerCase() + if (platform === 'ios') { +this.items.push({name: root + '/showcase/compositing', title: 'Compositing'}) + } } } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/4a7a54b3/examples/vue/showcase/compositing.vue -- diff --git a/examples/vue/showcase/compositing.vue b/examples/vue/showcase/compositing.vue new file mode 100644 index 000..58e238f --- /dev/null +++ b/examples/vue/showcase/compositing.vue @@ -0,0 +1,89 @@ + + + + + + + Thomas Carlyle + +https://gw.alicdn.com/tps/TB1Jl1CPFcJ-370-370.jpg;> + + Genius only means hard-working all one\'s life + + + + + + + + Thomas Carlyle + +https://gw.alicdn.com/tps/TB1Jl1CPFcJ-370-370.jpg;> + + Genius only means hard-working all one\'s life + + + + + + + + .wrapper { +align-items: center; +opacity: 0.8; + } + .itemWrapper { +flex:1; +border-top-right-radius: 80; +border-bottom-right-radius: 80; +border-top-width: 10; +border-top-color: red; +border-style: dashed; +align-items: center; +background-color: white; + } + .nameWrapper { +background-color:rgba(255,0,0,0.5); +border-radius: 30; +overflow: visible; +border-color: black; +border-width: 10; + } + .item { +margin-top: 120px; +background-color: #CC; +align-items: center; + } + .itemName { +font-size:28; +color:#33; +line-height:42; +text-align:left; +margin-top: 24; + } + .itemPhoto { +margin-top: 18; +width: 220; +height: 220; +margin-bottom: 18; +border-radius: 30; +overflow: hidden; +background-color: blue; + } + .itemDesc { +font-size:24; +margin:12; +color:#99; +line-height:36; +text-align:left; + } + + + + module.exports = { +data: { +}, +methods: { +} + } +
[07/15] incubator-weex git commit: * [ios] deprecate displayBlock and completionDisplayBlock method
* [ios] deprecate displayBlock and completionDisplayBlock method Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/3844a253 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/3844a253 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/3844a253 Branch: refs/heads/0.12-dev Commit: 3844a2532e1ec046abae2fe6132ff1bbf0a432ac Parents: d81b656 Author: éé£Authored: Thu Apr 6 12:14:27 2017 +0800 Committer: éé£ Committed: Thu Apr 6 12:14:27 2017 +0800 -- .../WeexSDK/Sources/Component/WXCellComponent.m | 10 +-- .../Sources/Display/WXComponent+Display.m | 73 +++- ios/sdk/WeexSDK/Sources/Model/WXComponent.h | 24 --- 3 files changed, 58 insertions(+), 49 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3844a253/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m index 24a5a1d..5e67ec7 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.m @@ -59,15 +59,9 @@ } } -- (WXDisplayCompletionBlock)displayCompletionBlock +- (void)didFinishDrawingLayer:(BOOL)success { -return ^(CALayer *layer, BOOL finished) { -if ([super displayCompletionBlock]) { -[super displayCompletionBlock](layer, finished); -} - -[self.delegate cellDidRendered:self]; -}; +[self.delegate cellDidRendered:self]; } - (void)updateAttributes:(NSDictionary *)attributes http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/3844a253/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m -- diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m index 6428ecb..0d4bca1 100644 --- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m +++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m @@ -46,6 +46,10 @@ - (BOOL)needsDrawRect { +if (_useCompositing || _isCompositingChild) { +return YES; +} + if (![self _needsDrawBorder]) { WXLogDebug(@"No need to draw border for %@", self.ref); WXPerformBlockOnMainThread(^{ @@ -72,13 +76,20 @@ return nil; } +- (void)didFinishDrawingLayer:(BOOL)success +{ +WXAssertMainThread(); +} + +#pragma mark Private + - (WXDisplayBlock)_displayBlock { WXDisplayBlock displayBlock = ^UIImage *(CGRect bounds, BOOL(^isCancelled)(void)) { if (isCancelled()) { return nil; } - + UIGraphicsBeginImageContextWithOptions(bounds.size, [self _bitmapOpaqueWithSize:bounds.size] , 0.0); UIImage *image = [self drawRect:bounds]; if (!image) { @@ -92,7 +103,13 @@ return displayBlock; } -#pragma mark Private +- (WXDisplayCompletionBlock)_displayCompletionBlock +{ +__weak typeof(self) weakSelf = self; +return ^(CALayer *layer, BOOL finished) { +[weakSelf didFinishDrawingLayer:finished]; +}; +} - (void)_initCompositingAttribute:(NSDictionary *)attributes { @@ -117,7 +134,7 @@ } else { displayBlock = [self _displayBlock]; } -WXDisplayCompletionBlock completionBlock = [self displayCompletionBlock]; +WXDisplayCompletionBlock completionBlock = [self _displayCompletionBlock]; if (!displayBlock || !needsDrawRect) { if (completionBlock) { @@ -176,32 +193,32 @@ - (CGContextRef)beginDrawContext:(CGRect)bounds { -//UIGraphicsBeginImageContextWithOptions(bounds.size, [self _bitmapOpaqueWithSize:bounds.size], 0.0); -//CGContextRef context = UIGraphicsGetCurrentContext(); - -float scaleFactor = [[UIScreen mainScreen] scale]; -CGColorSpaceRefcolorSpace = CGColorSpaceCreateDeviceRGB(); -CGContextRef context = CGBitmapContextCreate(NULL, bounds.size.width * scaleFactor, bounds.size.height * scaleFactor, 8, 4 * bounds.size.width * scaleFactor, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); -CGContextScaleCTM(context, scaleFactor, scaleFactor); - -// Adjusts position and invert the image. -// The OpenGL uses the image data upside-down compared commom image files. -CGContextTranslateCTM(context, 0, bounds.size.height); -CGContextScaleCTM(context, 1.0, -1.0); +UIGraphicsBeginImageContextWithOptions(bounds.size, [self _bitmapOpaqueWithSize:bounds.size], 0.0); +CGContextRef context = UIGraphicsGetCurrentContext(); -CGColorSpaceRelease(colorSpace); +//
[1/2] incubator-weex git commit: * [ios] fix bug ci
Repository: incubator-weex Updated Branches: refs/heads/0.12-dev 51ba98801 -> 68b2b5710 * [ios] fix bug ci Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/acb310fe Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/acb310fe Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/acb310fe Branch: refs/heads/0.12-dev Commit: acb310fedc542c4dcc0ed95d6c5aaf94d9f08fa3 Parents: 5b1126a Author: é½å±±Authored: Mon Apr 10 11:45:07 2017 +0800 Committer: é½å±± Committed: Mon Apr 10 11:45:07 2017 +0800 -- ios/sdk/WeexSDK/Sources/Protocol/WXBridgeProtocol.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/acb310fe/ios/sdk/WeexSDK/Sources/Protocol/WXBridgeProtocol.h -- diff --git a/ios/sdk/WeexSDK/Sources/Protocol/WXBridgeProtocol.h b/ios/sdk/WeexSDK/Sources/Protocol/WXBridgeProtocol.h index cafa1ba..cf80c5f 100644 --- a/ios/sdk/WeexSDK/Sources/Protocol/WXBridgeProtocol.h +++ b/ios/sdk/WeexSDK/Sources/Protocol/WXBridgeProtocol.h @@ -44,13 +44,12 @@ typedef void (^WXJSCallNativeComponent)(NSString *instanceId, NSString *componen */ - (void)resetEnvironment; +@optional /** * Remove instance's timer. */ -(void)removeTimers:(NSString *)instance; -@optional - /** * Called when garbage collection is wanted by sdk. */
[2/2] incubator-weex git commit: Merge branch '0.12-dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into 0.12-dev
Merge branch '0.12-dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into 0.12-dev Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/68b2b571 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/68b2b571 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/68b2b571 Branch: refs/heads/0.12-dev Commit: 68b2b57100569ef5158c49274a50cc8eb6f2291b Parents: acb310f 51ba988 Author: cxfengAuthored: Mon Apr 10 13:51:23 2017 +0800 Committer: cxfeng Committed: Mon Apr 10 13:51:23 2017 +0800 -- ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 8 + .../Sources/Component/WXCycleSliderComponent.h | 18 + .../Sources/Component/WXCycleSliderComponent.m | 594 +++ .../Sources/Component/WXIndicatorComponent.h| 8 + .../Sources/Component/WXIndicatorComponent.m| 16 +- .../Sources/Component/WXSliderComponent.m | 5 +- .../Component/WXSliderNeighborComponent.h | 3 + .../Component/WXSliderNeighborComponent.m | 5 +- ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m| 1 + 9 files changed, 646 insertions(+), 12 deletions(-) --
[6/9] incubator-weex git commit: * [ios] rename recycleslider to cycleslider
* [ios] rename recycleslider to cycleslider Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9f8771bd Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9f8771bd Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9f8771bd Branch: refs/heads/0.12-dev Commit: 9f8771bdfb2a1c11063965c338b24cf123df9b9b Parents: ec1d008 Author: LiuHongfeng(GuJian)Authored: Fri Apr 7 16:10:05 2017 +0800 Committer: LiuHongfeng(GuJian) Committed: Fri Apr 7 16:10:05 2017 +0800 -- ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 16 +- .../Sources/Component/WXCycleSliderComponent.h | 18 + .../Sources/Component/WXCycleSliderComponent.m | 593 +++ .../Sources/Component/WXIndicatorComponent.m| 6 +- ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m| 2 +- 5 files changed, 623 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9f8771bd/ios/sdk/WeexSDK.xcodeproj/project.pbxproj -- diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index 16f0b53..fd4eac8 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -37,8 +37,8 @@ 2AE5B7561CABA04E0082FDDB /* WXEventModuleProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AE5B7551CABA04E0082FDDB /* WXEventModuleProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2AFEB17B1C747139000507FA /* WXInstanceWrap.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AFEB1791C747139000507FA /* WXInstanceWrap.h */; }; 2AFEB17C1C747139000507FA /* WXInstanceWrap.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AFEB17A1C747139000507FA /* WXInstanceWrap.m */; }; - 37D940681E9492C600A5C45F /* WXRecycleSliderComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 37D940661E9492C600A5C45F /* WXRecycleSliderComponent.m */; }; - 37D940691E9492C600A5C45F /* WXRecycleSliderComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 37D940671E9492C600A5C45F /* WXRecycleSliderComponent.h */; }; + 37B51EE41E97804D0040A743 /* WXCycleSliderComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 37B51EE21E97804D0040A743 /* WXCycleSliderComponent.h */; }; + 37B51EE51E97804D0040A743 /* WXCycleSliderComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 37B51EE31E97804D0040A743 /* WXCycleSliderComponent.m */; }; 591324A31D49B7F1004E89ED /* WXTimerModuleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 591324A21D49B7F1004E89ED /* WXTimerModuleTests.m */; }; 591DD3311D23AD5800BE8709 /* WXErrorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 591DD32F1D23AD5800BE8709 /* WXErrorView.m */; }; 591DD3321D23AD5800BE8709 /* WXErrorView.h in Headers */ = {isa = PBXBuildFile; fileRef = 591DD3301D23AD5800BE8709 /* WXErrorView.h */; }; @@ -347,8 +347,8 @@ 2AE5B7551CABA04E0082FDDB /* WXEventModuleProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXEventModuleProtocol.h; sourceTree = ""; }; 2AFEB1791C747139000507FA /* WXInstanceWrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXInstanceWrap.h; sourceTree = ""; }; 2AFEB17A1C747139000507FA /* WXInstanceWrap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXInstanceWrap.m; sourceTree = ""; }; - 37D940661E9492C600A5C45F /* WXRecycleSliderComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXRecycleSliderComponent.m; sourceTree = ""; }; - 37D940671E9492C600A5C45F /* WXRecycleSliderComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXRecycleSliderComponent.h; sourceTree = ""; }; + 37B51EE21E97804D0040A743 /* WXCycleSliderComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXCycleSliderComponent.h; sourceTree = ""; }; + 37B51EE31E97804D0040A743 /* WXCycleSliderComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXCycleSliderComponent.m; sourceTree = ""; }; 591324A21D49B7F1004E89ED /* WXTimerModuleTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXTimerModuleTests.m; sourceTree = ""; }; 591DD32F1D23AD5800BE8709
[2/9] incubator-weex git commit: * [ios] fix:edit the comments and change the value to weex type
* [ios] fix:edit the comments and change the value to weex type Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/552f6f2a Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/552f6f2a Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/552f6f2a Branch: refs/heads/0.12-dev Commit: 552f6f2a24ab9ae66f49d192baeb817722ffdb58 Parents: b7bcdb1 Author: LiuHongfeng(GuJian)Authored: Wed Apr 5 12:21:39 2017 +0800 Committer: LiuHongfeng(GuJian) Committed: Wed Apr 5 12:21:39 2017 +0800 -- .../Component/WXRecycleSliderComponent.m| 21 ++-- 1 file changed, 10 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/552f6f2a/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m index d4e1058..52f8607 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m @@ -83,7 +83,7 @@ typedef NS_ENUM(NSInteger, Direction) { [self resetItemViewsFrame]; } -#pragma mark --private methods-- +#pragma mark Private Methods - (CGFloat)height { return self.scrollView.frame.size.height; } @@ -104,14 +104,14 @@ typedef NS_ENUM(NSInteger, Direction) { - (void)setCurrentIndex:(NSInteger)currentIndex { _currentIndex = currentIndex; -if (_direction == DirectionRight) { // å¦ææ¯åå³æ»å¨ +if (_direction == DirectionRight) { self.nextItemFrame = CGRectMake(0, 0, self.width, self.height); self.nextIndex = self.currentIndex - 1; if (self.nextIndex < 0) { self.nextIndex = _itemViews.count - 1; } -}else if (_direction == DirectionLeft){ // å¦ææ¯å左边æ»å¨ +}else if (_direction == DirectionLeft) { self.nextItemFrame = CGRectMake(self.width * 2, 0, self.width, self.height); self.nextIndex = (self.currentIndex + 1) % _itemViews.count; } @@ -123,7 +123,7 @@ typedef NS_ENUM(NSInteger, Direction) { } } -#pragma mark - 设置æ»å¨æ¹å +#pragma mark Scroll & Frames - (void)setDirection:(Direction)direction { //åæ¢æ¹åæ¶è®¾ç½®ä¸æ¬¡åview frame if (_direction == direction) return; @@ -285,15 +285,15 @@ typedef NS_ENUM(NSInteger, Direction) { _lastOffsetXRatio = 0; if (attributes[@"autoPlay"]) { -_autoPlay = [attributes[@"autoPlay"] boolValue]; +_autoPlay = [WXConvert BOOL:attributes[@"autoPlay"]]; } if (attributes[@"interval"]) { -_interval = [attributes[@"interval"] integerValue]; +_interval = [WXConvert NSInteger:attributes[@"interval"]]; } if (attributes[@"index"]) { -_index = [attributes[@"index"] integerValue]; +_index = [WXConvert NSInteger:attributes[@"index"]]; } _scrollable = attributes[@"scrollable"] ? [WXConvert BOOL:attributes[@"scrollable"]] : YES; @@ -402,7 +402,7 @@ typedef NS_ENUM(NSInteger, Direction) { - (void)updateAttributes:(NSDictionary *)attributes { if (attributes[@"autoPlay"]) { -_autoPlay = [attributes[@"autoPlay"] boolValue]; +_autoPlay = [WXConvert BOOL:attributes[@"autoPlay"]]; if (_autoPlay) { [self _startAutoPlayTimer]; } else { @@ -411,8 +411,7 @@ typedef NS_ENUM(NSInteger, Direction) { } if (attributes[@"interval"]) { -_interval = [attributes[@"interval"] integerValue]; - +_interval = [WXConvert NSInteger:attributes[@"interval"]]; [self _stopAutoPlayTimer]; if (_autoPlay) { @@ -421,7 +420,7 @@ typedef NS_ENUM(NSInteger, Direction) { } if (attributes[@"index"]) { -_index = [attributes[@"index"] integerValue]; +_index = [WXConvert NSInteger:attributes[@"index"]]; self.currentIndex = _index; self.recycleSliderView.currentIndex = _index; }
[5/9] incubator-weex git commit: Merge branch '0.12-dev' of https://github.com/apache/incubator-weex into 0.12-dev-newSlider
Merge branch '0.12-dev' of https://github.com/apache/incubator-weex into 0.12-dev-newSlider * '0.12-dev' of https://github.com/apache/incubator-weex: (22 commits) * [jsfm] v0.20.3 * [android] fix NPE in move fixed view * [doc] add scrollToElement animation support eslint warning * [jsfm] fix function markupState call C++ timer instead of WxTimerModule with in week jsfm * [example] fix banner * [jsfm] v0.20.2 * [jsfm] update jsfm version to 0.19.17 for fixed Vue leak * [jsfm] v0.19.17 * [jsfm] update weex-vue-framework to 2.2.1-weex.2 && destroy runtime document * [android] fix setSize when defaultHeight is use screen height * [jsfm] update vue framework to 2.2.2-weex.1 * [test] Closes #141: invalid/pullrequest * [android] avoid remove-readd view when fixed component view already moved * [html5] clear log. * [ios] fix box shadow shadowColor get method circularly called * [ios] add default value * [ios] refactor gradient-color method * [html5] update build & test config. ... Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/ec1d008a Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/ec1d008a Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/ec1d008a Branch: refs/heads/0.12-dev Commit: ec1d008a253ec9384d673de086cd36fae0e1d624 Parents: 7d1dba1 c597a05 Author: LiuHongfeng(GuJian)Authored: Fri Apr 7 15:41:45 2017 +0800 Committer: LiuHongfeng(GuJian) Committed: Fri Apr 7 15:41:45 2017 +0800 -- android/sdk/assets/main.js | 14 +-- .../java/com/taobao/weex/WXSDKInstance.java | 15 +-- build/config.js | 8 +- build/karma.vue.conf.js | 15 ++- build/webpack.examples.config.js| 4 +- doc/source/cn/references/modules/dom.md | 3 +- doc/source/references/modules/dom.md| 3 +- examples/module/componentRect.we| 4 +- html5/frameworks/legacy/app/ctrl/init.js| 42 ++- html5/frameworks/legacy/static/life.js | 8 +- ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 8 -- ios/sdk/WeexSDK/Resources/main.js | 14 +-- .../Component/WXComponent+GradientColor.h | 18 --- .../Component/WXComponent+GradientColor.m | 124 --- .../Sources/Component/WXComponent_internal.h| 3 + .../WeexSDK/Sources/Layout/WXComponent+Layout.m | 1 - ios/sdk/WeexSDK/Sources/Model/WXComponent.m | 29 - ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m | 2 +- ios/sdk/WeexSDK/Sources/Utility/WXUtility.h | 27 ios/sdk/WeexSDK/Sources/Utility/WXUtility.m | 101 +++ .../Sources/View/WXComponent+ViewManagement.m | 1 - package.json| 9 +- 22 files changed, 253 insertions(+), 200 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ec1d008a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj --
[4/9] incubator-weex git commit: * [ios] fix some bugs of recycleSlider’s infinite property, especially in status of two pages.
* [ios] fix some bugs of recycleSliderâs infinite property, especially in status of two pages. Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/7d1dba1c Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/7d1dba1c Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/7d1dba1c Branch: refs/heads/0.12-dev Commit: 7d1dba1cd8ec4070ce4ae6344143a712609bfa2a Parents: 98345a4 Author: LiuHongfeng(GuJian)Authored: Fri Apr 7 15:40:37 2017 +0800 Committer: LiuHongfeng(GuJian) Committed: Fri Apr 7 15:40:37 2017 +0800 -- .../Sources/Component/WXIndicatorComponent.m| 3 -- .../Component/WXRecycleSliderComponent.m| 55 +--- 2 files changed, 24 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7d1dba1c/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m index 4610341..b4af2af 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m @@ -171,9 +171,6 @@ WXSliderNeighborComponent *parentSlider = (WXSliderNeighborComponent *)parent; [parentSlider setIndicatorView:_indicatorView]; } -else { - NSAssert(NO, @""); -} } - (void)updateStyles:(NSDictionary *)styles http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/7d1dba1c/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m index bc86db7..48d9b73 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m @@ -95,6 +95,9 @@ typedef NS_ENUM(NSInteger, Direction) { - (void)setCurrentIndex:(NSInteger)currentIndex { +if (currentIndex >= _itemViews.count || currentIndex < 0) { +currentIndex = 0; +} _currentIndex = currentIndex; if (_infinite) { if (_direction == DirectionRight) { @@ -104,15 +107,11 @@ typedef NS_ENUM(NSInteger, Direction) { { self.nextIndex = _itemViews.count - 1; } -NSLog(@"setCurrentIndex DirectionRight"); - }else if (_direction == DirectionLeft) { -NSLog(@"setCurrentIndex DirectionLeft"); - self.nextItemFrame = CGRectMake(self.width * 2, 0, self.width, self.height); self.nextIndex = (self.currentIndex + 1) % _itemViews.count; -NSLog(@"setCurrentIndex DirectionLeft nextIndex:%ld",_nextIndex); - +}else { +self.nextIndex = (self.currentIndex + 1) % _itemViews.count; } [self resetAllViewsFrame]; } else { @@ -142,36 +141,23 @@ typedef NS_ENUM(NSInteger, Direction) { { self.nextIndex = _itemViews.count - 1; } -NSLog(@"DirectionRight"); -NSLog(@"DirectionRight nextIndex:%ld",_nextIndex); -//[self getItemAtIndex:_nextIndex].frame = _nextItemFrame; UIView *view = [self getItemAtIndex:_nextIndex]; if (view) { view.frame = _nextItemFrame; } - - }else if (_direction == DirectionLeft){ -NSLog(@"DirectionLeft"); self.nextItemFrame = CGRectMake(self.width * 2, 0, self.width, self.height); self.nextIndex = (self.currentIndex + 1) % _itemViews.count; -NSLog(@"DirectionLeft nextIndex:%ld",_nextIndex); UIView *view = [self getItemAtIndex:_nextIndex]; if (view) { view.frame = _nextItemFrame; } - -NSLog(@"frame %@",NSStringFromCGRect(view.frame)); -if (view) { -self.nextIndex = (self.currentIndex + 1) % _itemViews.count; -NSLog(@"DirectionLeft nextIndex:%ld",_nextIndex); -} } } - (void)resetAllViewsFrame { -if (_infinite) { +if (_infinite && _itemViews.count > 1) { self.scrollView.frame = CGRectMake(0, 0, self.width, self.height); self.scrollView.contentOffset = CGPointMake(self.width, 0); if (self.itemViews.count > 1) { @@ -180,7 +166,6 @@ typedef NS_ENUM(NSInteger, Direction) { self.scrollView.contentSize = CGSizeZero; } _currentItemFrame = CGRectMake(self.width, 0, self.width, self.height); -_nextItemFrame = CGRectMake(self.width * 2, 0, self.width, self.height); for (int i = 0;
[8/9] incubator-weex git commit: * [ios] Relieve the dependency of WXIndicatorComponent on the parent component .
* [ios] Relieve the dependency of WXIndicatorComponent on the parent component . Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1f7a7dbf Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1f7a7dbf Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1f7a7dbf Branch: refs/heads/0.12-dev Commit: 1f7a7dbf57069bd82e1d7577e2a0d11be8264754 Parents: 10665be Author: LiuHongfeng(GuJian)Authored: Mon Apr 10 11:17:43 2017 +0800 Committer: LiuHongfeng(GuJian) Committed: Mon Apr 10 11:17:43 2017 +0800 -- .../Sources/Component/WXCycleSliderComponent.m | 5 +++-- .../Sources/Component/WXIndicatorComponent.h| 8 .../Sources/Component/WXIndicatorComponent.m| 21 +++- .../Sources/Component/WXSliderComponent.m | 5 +++-- .../Component/WXSliderNeighborComponent.m | 5 - 5 files changed, 25 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1f7a7dbf/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m index a8fc879..1db172a 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m @@ -303,7 +303,7 @@ typedef NS_ENUM(NSInteger, Direction) { @end -@interface WXCycleSliderComponent () +@interface WXCycleSliderComponent () @property (nonatomic, strong) WXRecycleSliderView *recycleSliderView; @property (nonatomic, strong) NSTimer *autoTimer; @@ -417,6 +417,7 @@ typedef NS_ENUM(NSInteger, Direction) { WXRecycleSliderView *recycleSliderView = (WXRecycleSliderView *)self.view; if ([view isKindOfClass:[WXIndicatorView class]]) { +((WXIndicatorComponent *)subcomponent).delegate = self; [recycleSliderView addSubview:view]; return; } @@ -512,7 +513,7 @@ typedef NS_ENUM(NSInteger, Direction) { } } -#pragma mark Public Methods +#pragma mark WXIndicatorComponentDelegate Methods -(void)setIndicatorView:(WXIndicatorView *)indicatorView { http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1f7a7dbf/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.h -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.h index faeae40..88347fd 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.h +++ b/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.h @@ -28,6 +28,14 @@ typedef enum @end +@protocol WXIndicatorComponentDelegate + +-(void)setIndicatorView:(WXIndicatorView *)indicatorView; + +@end + @interface WXIndicatorComponent : WXComponent +@property (nonatomic, weak) id delegate; + @end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1f7a7dbf/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m index 2647d61..39c081a 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.m @@ -7,10 +7,7 @@ */ #import "WXIndicatorComponent.h" -#import "WXSliderComponent.h" -#import "WXCycleSliderComponent.h" #import "WXConvert.h" -#import "WXSliderNeighborComponent.h" #import "WXSDKInstance.h" @implementation WXIndicatorView @@ -159,17 +156,13 @@ _indicatorView.lightColor = _itemSelectedColor; _indicatorView.pointSize = _itemSize; -WXComponent *parent = self.supercomponent; -if([parent isKindOfClass:[WXSliderComponent class]]) { -WXSliderComponent *parentSlider = (WXSliderComponent *)parent; -[parentSlider setIndicatorView:_indicatorView]; -} -if([parent isKindOfClass:[WXCycleSliderComponent class]]) { -WXCycleSliderComponent *parentSlider = (WXCycleSliderComponent *)parent; -[parentSlider setIndicatorView:_indicatorView]; -}else if ([parent isKindOfClass:[WXSliderNeighborComponent class]]) { -WXSliderNeighborComponent *parentSlider = (WXSliderNeighborComponent *)parent; -[parentSlider setIndicatorView:_indicatorView]; + +} + +- (void)layoutDidFinish +{ +if (self.delegate && [self.delegate respondsToSelector:@selector(setIndicatorView:)]) { +
[7/9] incubator-weex git commit: * [ios] remove WXRecycleSliderComponent files
* [ios] remove WXRecycleSliderComponent files Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/10665be8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/10665be8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/10665be8 Branch: refs/heads/0.12-dev Commit: 10665be8aea3de87ad7708f6323867156962af95 Parents: 9f8771b Author: LiuHongfeng(GuJian)Authored: Fri Apr 7 16:11:28 2017 +0800 Committer: LiuHongfeng(GuJian) Committed: Fri Apr 7 16:11:28 2017 +0800 -- .../Component/WXRecycleSliderComponent.h| 18 - .../Component/WXRecycleSliderComponent.m| 593 --- 2 files changed, 611 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/10665be8/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.h -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.h b/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.h deleted file mode 100644 index 5dd0798..000 --- a/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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 -#import "WXComponent.h" - -@class WXIndicatorView; - -@interface WXRecycleSliderComponent : WXComponent - -- (void)setIndicatorView:(WXIndicatorView *)indicatorView; - -@end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/10665be8/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m deleted file mode 100644 index 48d9b73..000 --- a/ios/sdk/WeexSDK/Sources/Component/WXRecycleSliderComponent.m +++ /dev/null @@ -1,593 +0,0 @@ -/** - * 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 "WXRecycleSliderComponent.h" -#import "WXIndicatorComponent.h" -#import "WXComponent_internal.h" -#import "NSTimer+Weex.h" -#import "WXSDKManager.h" -#import "WXUtility.h" - -typedef NS_ENUM(NSInteger, Direction) { -DirectionNone = 1 << 0, -DirectionLeft = 1 << 1, -DirectionRight = 1 << 2 -}; - -@class WXRecycleSliderView; -@class WXIndicatorView; - -@protocol WXRecycleSliderViewDelegate - -- (void)recycleSliderView:(WXRecycleSliderView *)recycleSliderView didScroll:(UIScrollView *)scrollView; -- (void)recycleSliderView:(WXRecycleSliderView *)recycleSliderView didScrollToItemAtIndex:(NSInteger)index; -- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView; -- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate; - -@end - -@interface WXRecycleSliderView : UIView - -@property (nonatomic, strong) WXIndicatorView *indicator; -@property (nonatomic, weak) id delegate; - -@property (nonatomic, strong) UIScrollView *scrollView; -@property (nonatomic, strong) NSMutableArray *itemViews; -@property (nonatomic, assign) Direction direction; -@property (nonatomic, assign) NSInteger currentIndex; -@property (nonatomic, assign) NSInteger nextIndex; -@property (nonatomic, assign) CGRect currentItemFrame; -@property (nonatomic, assign) CGRect nextItemFrame; -@property (nonatomic, assign) BOOL infinite; - -- (void)insertItemView:(UIView *)view atIndex:(NSInteger)index; -- (void)removeItemView:(UIView *)view; - -@end - -@implementation WXRecycleSliderView - -- (id)initWithFrame:(CGRect)frame -{ -self = [super initWithFrame:frame]; -if (self) { -_currentIndex = 0; -_itemViews = [[NSMutableArray alloc] init]; -_scrollView = [[UIScrollView alloc] init]; -_scrollView.backgroundColor = [UIColor clearColor]; -_scrollView.delegate = self; -_scrollView.showsHorizontalScrollIndicator = NO; -_scrollView.showsVerticalScrollIndicator = NO; -_scrollView.scrollsToTop = NO; -[self addSubview:_scrollView]; -} -return self; -} - -- (void)layoutSubviews -{ -[super layoutSubviews]; -[self resetAllViewsFrame]; -} - -#pragma mark Private Methods -- (CGFloat)height { -return self.frame.size.height; -} - -- (CGFloat)width { -return self.frame.size.width; -} - --
[09/10] incubator-weex git commit: * [test] fix recycler test problems
* [test] fix recycler test problems Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/982da124 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/982da124 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/982da124 Branch: refs/heads/0.12-dev Commit: 982da1245e64f518680b91356abf30a45005287d Parents: 53b61da Author: éé£Authored: Fri Apr 7 11:58:24 2017 +0800 Committer: éé£ Committed: Fri Apr 7 11:58:24 2017 +0800 -- .../Component/Recycler/WXRecyclerComponent.m| 1 + .../WeexSDK/Sources/Component/WXListComponent.m | 2 ++ test/pages/components/recycler.vue | 12 -- test/scripts/components/recycler.test.js| 25 4 files changed, 22 insertions(+), 18 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/982da124/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m index 842fa1f..92daf1c 100644 --- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m @@ -348,6 +348,7 @@ typedef enum : NSUInteger { } [cellView.contentView addSubview:contentView]; +[cellView setAccessibilityIdentifier:contentView.accessibilityIdentifier]; return cellView; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/982da124/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m -- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m index c598a3d..8037799 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m +++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m @@ -610,6 +610,8 @@ [cellView.contentView addSubview:cell.view]; +[cellView setAccessibilityIdentifier:cell.view.accessibilityIdentifier]; + WXLogDebug(@"Created cell:%@ view:%@ cellView:%@ at indexPath:%@", cell.ref, cell.view, cellView, indexPath); return cellView; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/982da124/test/pages/components/recycler.vue -- diff --git a/test/pages/components/recycler.vue b/test/pages/components/recycler.vue index 7a55136..ae52e7a 100644 --- a/test/pages/components/recycler.vue +++ b/test/pages/components/recycler.vue @@ -42,7 +42,7 @@ Content Offset:{{contentOffset}} - + {{item.name}} @@ -304,14 +304,10 @@ ] let repeatItems = []; - // for (let i = 0; i < 3; i++) { + for (let i = 0; i < 3; i++) { repeatItems.push(...items) - // } - - for(let i =0;i< repeatItems.length;i++ ){ - repeatItems[i].testid = 'cell'+i; - console.log(repeatItems[i].testid) -} + } + return { padding: 0, refreshing: false, http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/982da124/test/scripts/components/recycler.test.js -- diff --git a/test/scripts/components/recycler.test.js b/test/scripts/components/recycler.test.js index ba75fa8..21e8f79 100644 --- a/test/scripts/components/recycler.test.js +++ b/test/scripts/components/recycler.test.js @@ -25,7 +25,7 @@ const isAndroid = platform === 'android'; // const footerPath = '//recycler[1]/div[1]' const isApproximate = (x, y) => { - return Math.abs(x - y) <= isAndroid ? 1 : 0.5 + return Math.abs(x - y) <= (isAndroid ? 1 : 1.5) } // if (isAndroid) { @@ -130,7 +130,7 @@ describe('recycler', function () { it('#2 test column count', () => { return driver - .elementById('cell3') + .elementById('cell2') .click() .elementById('cell0') .getRect() @@ -307,14 +307,14 @@ describe('recycler', function () { it('#9 test moving cell', () => { return driver -.elementById('cell28') +.elementById('cell29') .click() .elementById('fixed1') .click() -.elementById('cell28') +.elementById('cell27') .getRect() .then((rect)=>{ - console.log(`cell 28 rect after moving cell 29 to 1:${JSON.stringify(rect)}`) + console.log(`cell 28 rect after moving cell 30 to 1:${JSON.stringify(rect)}`) assert.isOk(isApproximate(rect.x, 381 * scaleFactor)) assert.isOk(isApproximate(rect.y, screenHeight - 94 * scaleFactor -
[07/10] incubator-weex git commit: * [tc] recycler tc
* [tc] recycler tc Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/db99d41e Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/db99d41e Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/db99d41e Branch: refs/heads/0.12-dev Commit: db99d41eec8e5169df0e5a976f91294e420a1e02 Parents: b0a11a2 Author: zshshrAuthored: Thu Apr 6 19:17:21 2017 +0800 Committer: zshshr Committed: Thu Apr 6 19:17:21 2017 +0800 -- test/pages/components/recycler.vue | 39 test/scripts/components/recycler.test.js | 136 +- 2 files changed, 90 insertions(+), 85 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/db99d41e/test/pages/components/recycler.vue -- diff --git a/test/pages/components/recycler.vue b/test/pages/components/recycler.vue index ce4f21f..7a55136 100644 --- a/test/pages/components/recycler.vue +++ b/test/pages/components/recycler.vue @@ -1,5 +1,5 @@ - {{refreshText}} --> - + https://gw.alicdn.com/tps/TB1ESN1PFX1apXX-1000-600.jpg; resize="cover"> @@ -24,9 +24,9 @@ - + -Sticky Header +Sticky Header @@ -42,7 +42,7 @@ Content Offset:{{contentOffset}} - + {{item.name}} @@ -50,10 +50,10 @@ {{item.behaviourName}} - + Footer - + bot @@ -244,7 +244,7 @@ name: 'Thomas Carlyle', desc:'Genius only means hard-working all one\'s life', behaviourName: 'Change width', - behaviour: 'changeColumnWidth', + behaviour: 'changeColumnWidth' }, { src:'https://gw.alicdn.com/tps/TB1Hv1JPFa3-370-370.jpg', @@ -263,13 +263,13 @@ name:'Addison', desc:'Cease to struggle and you cease to live', behaviourName: 'Show scrollbar', - behaviour: 'showScrollbar', + behaviour: 'showScrollbar' }, { src:'https://gw.alicdn.com/tps/TB1ACygPFXwXVXX-370-370.jpg', desc:'A strong man will struggle with the storms of fate', behaviourName: 'Listen appear', - behaviour: 'listenAppear', + behaviour: 'listenAppear' }, { src:'https://gw.alicdn.com/tps/TB1IGShPFaqXVXX-370-370.jpg', @@ -281,32 +281,37 @@ { src:'https://gw.alicdn.com/tps/TB1xU93PFXHaXXX-240-240.jpg', behaviourName: 'waterfall padding', - behaviour: 'setPadding', + behaviour: 'setPadding' }, { src:'https://gw.alicdn.com/tps/TB19hu0PFaXaXXX-240-240.jpg', name:'Balzac', desc:'There is no such thing as a great talent without great will - power', behaviourName: 'listen scroll', - behaviour: 'listenScroll', + behaviour: 'listenScroll' }, { src:'https://gw.alicdn.com/tps/TB1ux2vPFbk-240-240.jpg', behaviourName: 'Remove cell', - behaviour: 'removeCell', + behaviour: 'removeCell' }, { src:'https://gw.alicdn.com/tps/TB1tCCWPFa7aXXX-240-240.jpg', behaviourName: 'Move cell', - behaviour: 'moveCell', + behaviour: 'moveCell' + } ] let repeatItems = []; - for (let i = 0; i < 3; i++) { + // for (let i = 0; i < 3; i++) { repeatItems.push(...items) - } - + // } + + for(let i =0;i< repeatItems.length;i++ ){ + repeatItems[i].testid = 'cell'+i; + console.log(repeatItems[i].testid) +} return { padding: 0, refreshing: false, http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/db99d41e/test/scripts/components/recycler.test.js -- diff --git a/test/scripts/components/recycler.test.js b/test/scripts/components/recycler.test.js index 19f0ad3..6bc67ed 100644 --- a/test/scripts/components/recycler.test.js +++ b/test/scripts/components/recycler.test.js @@ -11,36 +11,36 @@ var util = require("../util.js"); const platform = process.env.platform.toLowerCase() || 'android'; const isAndroid = platform === 'android'; -const fixedPath = '//div[1]' -const header1Path = '//recycler[1]/div[1]/' -const header2Path = '//recycler[1]/div[2]/' -const cell1Path = isAndroid ?
[08/10] incubator-weex git commit: Merge branch '0.12-dev-recycler-tc' into 0.12-dev
Merge branch '0.12-dev-recycler-tc' into 0.12-dev * 0.12-dev-recycler-tc: (209 commits) * [tc] recycler tc * [android] fix NPE in move fixed view * [doc] add scrollToElement animation support * [jsfm] fix function markupState * [example] fix banner * [jsfm] v0.20.2 * [jsfm] update jsfm version to 0.19.17 for fixed Vue leak * [jsfm] v0.19.17 * [jsfm] update weex-vue-framework to 2.2.1-weex.2 && destroy runtime document * [android] fix setSize when defaultHeight is use screen height * [jsfm] update vue framework to 2.2.2-weex.1 * [test] Closes #141: invalid/pullrequest * [test] Closes #141: invalid/pullrequest * [test] fix CI * [android] update imageView * [android] avoid remove-readd view when fixed component view already moved * [android] avoid remove-readd view when fixed component view already moved * [html5] clear log. + [ios] change to color * [ios] fix box shadow shadowColor get method circularly called ... # Conflicts: # test/scripts/components/recycler.test.js Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/53b61da6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/53b61da6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/53b61da6 Branch: refs/heads/0.12-dev Commit: 53b61da6ac1610fe3153d147c67114cd70d478fc Parents: 5445c92 db99d41 Author: zshshrAuthored: Thu Apr 6 19:23:40 2017 +0800 Committer: zshshr Committed: Thu Apr 6 19:23:40 2017 +0800 -- .eslintrc | 16 +- .flowconfig | 16 + README.md | 50 +- android/commons/build.gradle|3 +- .../weex/commons/AbstractWeexActivity.java | 24 + android/playground/app/build.gradle |3 +- .../playground/app/src/main/assets/animation.js | 11 +- .../app/src/main/assets/component/a-demo.js | 11 +- .../src/main/assets/component/countdown-demo.js | 11 +- .../app/src/main/assets/component/image-demo.js | 11 +- .../app/src/main/assets/component/input-demo.js | 11 +- .../main/assets/component/list/list-basic.js|8 + .../assets/component/list/list-demo-horizon.js |8 + .../src/main/assets/component/list/list-demo.js |8 + .../src/main/assets/component/marquee-demo.js | 11 +- .../src/main/assets/component/navigator-demo.js | 15 +- .../main/assets/component/process-bar-demo.js | 11 +- .../src/main/assets/component/scroller-demo.js | 11 +- .../slider-neighbor/slider-neighbor-item.js |8 + .../slider-neighbor/slider-neighbor-page.js |8 + .../src/main/assets/component/slider/index.js | 11 +- .../main/assets/component/slider/slider-item.js |8 + .../main/assets/component/slider/slider-page.js |8 + .../main/assets/component/tabbar/tabbar-demo.js | 15 +- .../main/assets/component/tabbar/tabbar-item.js |8 + .../app/src/main/assets/component/text-demo.js | 11 +- .../app/src/main/assets/component/video-demo.js | 11 +- .../app/src/main/assets/component/web-demo.js | 11 +- android/playground/app/src/main/assets/hello.js |8 + .../playground/app/src/main/assets/iconfont.js |8 + .../app/src/main/assets/module/clipboard.js | 11 +- .../java/com/alibaba/weex/IndexActivity.java|6 + .../src/main/java/com/alibaba/weex/Utility.java | 277 + .../java/com/alibaba/weex/WXApplication.java|4 + .../java/com/alibaba/weex/WXPageActivity.java | 58 + .../extend/WXInstanceStatisticsListener.java| 268 + .../app/src/main/res/layout/id_stub.xml | 57 + android/sdk/assets/main.js | 14 +- android/sdk/build.gradle|2 + android/sdk/libs/armeabi/libweexv8.so | Bin 3583820 -> 3563544 bytes android/sdk/libs/x86/libweexv8.so | Bin 4336768 -> 4545544 bytes .../com/taobao/weex/IWXStatisticsListener.java | 252 + .../main/java/com/taobao/weex/InitConfig.java | 14 + .../java/com/taobao/weex/WXEnvironment.java | 18 + .../main/java/com/taobao/weex/WXSDKEngine.java |5 +- .../java/com/taobao/weex/WXSDKInstance.java | 86 +- .../main/java/com/taobao/weex/WXSDKManager.java | 79 +- .../taobao/weex/adapter/IWXSoLoaderAdapter.java | 236 + .../java/com/taobao/weex/bridge/WXBridge.java |6 + .../com/taobao/weex/bridge/WXBridgeManager.java | 59 +- .../java/com/taobao/weex/bridge/WXParams.java | 13 + .../java/com/taobao/weex/common/Constants.java |8 + .../java/com/taobao/weex/common/IWXBridge.java |7 + .../taobao/weex/common/WXJSBridgeMsgType.java |1 + .../taobao/weex/ui/IExternalMoudleGetter.java | 215 + .../taobao/weex/ui/component/WXComponent.java |7 +-
[04/10] incubator-weex git commit: * [test] update page url
* [test] update page url Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8ebd1735 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8ebd1735 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8ebd1735 Branch: refs/heads/0.12-dev Commit: 8ebd1735b72708f879db434ac203b475936450e0 Parents: 1185fbd Author: sospartanAuthored: Tue Mar 28 10:44:09 2017 +0800 Committer: sospartan Committed: Tue Mar 28 10:44:09 2017 +0800 -- test/scripts/components/recycler.test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8ebd1735/test/scripts/components/recycler.test.js -- diff --git a/test/scripts/components/recycler.test.js b/test/scripts/components/recycler.test.js index bc5f867..bbf20a8 100644 --- a/test/scripts/components/recycler.test.js +++ b/test/scripts/components/recycler.test.js @@ -37,9 +37,8 @@ describe('recycler', function () { const driver = util.createDriver(wd) before(function () { -console.log('wxpage://' + util.getDeviceHost() +'/components/recycler.js') return util.init(driver) - .get('wxpage://' + util.getDeviceHost() +'/components/recycler.js') + .get(util.getPage('/components/recycler.js')) .waitForElementByXPath('//recycler[1]',util.getGETActionWaitTimeMills(),1000) });
[05/10] incubator-weex git commit: Merge remote-tracking branch 'upstream/0.12-dev' into 0.12-dev
Merge remote-tracking branch 'upstream/0.12-dev' into 0.12-dev Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f0f58f5b Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f0f58f5b Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f0f58f5b Branch: refs/heads/0.12-dev Commit: f0f58f5bcaac15a531921330f97655b87e3d027e Parents: 8ebd173 80df1aa Author: éé£Authored: Wed Mar 29 20:14:40 2017 +0800 Committer: éé£ Committed: Wed Mar 29 20:14:40 2017 +0800 -- .../java/com/taobao/weex/common/Constants.java |2 + .../taobao/weex/dom/WXRecyclerDomObject.java|4 +- .../taobao/weex/ui/component/WXComponent.java | 25 + .../com/taobao/weex/ui/component/WXText.java|8 + .../com/taobao/weex/ui/view/WXTextView.java | 18 +- examples/accessibilitySupport.we| 57 + examples/component/input-demo.we| 253 +- examples/component/list/list-basic.we | 79 +- examples/component/scroller-demo.we | 64 +- examples/component/slider-tab.we| 100 + examples/include/example-list-item.we | 30 +- examples/index.we |4 +- examples/linear-gradient.we |3 + examples/module/chatroom-demo.we| 227 ++ examples/module/websocket-demo.we | 50 +- examples/showcase/boxshadow.we | 46 + examples/vue/components/input.vue | 203 +- examples/vue/components/list.vue|3 + examples/vue/index.vue |1 + examples/vue/showcase/boxshadow.vue | 39 + ios/playground/bundlejs/component/image-demo.js |2 +- ios/playground/bundlejs/component/input-demo.js | 2683 -- .../bundlejs/component/lengthunitwx-demo.js | 329 +++ .../bundlejs/component/list/list-basic.js | 132 +- .../component/list/list-demo-horizon.js | 12 +- .../bundlejs/component/list/list-demo.js| 12 +- .../bundlejs/component/list/waterfall.js| 877 ++ .../bundlejs/component/marquee-demo.js | 13 +- .../bundlejs/component/process-bar-demo.js | 17 +- .../bundlejs/component/scroller-demo.js | 219 +- .../bundlejs/component/slider-neighbor/index.js |8 +- .../slider-neighbor/slider-neighbor-item.js | 12 +- .../slider-neighbor/slider-neighbor-page.js | 28 +- ios/playground/bundlejs/component/slider-tab.js | 633 + .../bundlejs/component/slider/index.js | 56 +- .../bundlejs/component/slider/slider-item.js| 12 +- .../bundlejs/component/slider/slider-page.js| 28 +- ios/playground/bundlejs/component/text-demo.js | 24 +- ios/playground/bundlejs/component/video-demo.js | 24 +- ios/playground/bundlejs/component/web-demo.js | 25 +- ios/playground/bundlejs/error.js| 20 +- ios/playground/bundlejs/geolocation.js | 46 +- ios/playground/bundlejs/hello.js|4 +- ios/playground/bundlejs/iconfont.js | 12 +- ios/playground/bundlejs/index.js| 270 +- ios/playground/bundlejs/linear-gradient.js |8 +- ios/playground/bundlejs/module/chatroom-demo.js | 370 +++ ios/playground/bundlejs/module/clipboard.js | 61 +- ios/playground/bundlejs/module/componentRect.js | 28 +- ios/playground/bundlejs/module/instance-api.js | 61 +- ios/playground/bundlejs/module/modal.js | 27 +- ios/playground/bundlejs/module/picker-demo.js | 27 +- ios/playground/bundlejs/module/storage-demo.js | 61 +- ios/playground/bundlejs/module/stream-demo.js | 61 +- .../bundlejs/module/websocket-demo.js | 2661 +++-- ios/playground/bundlejs/showcase/boxshadow.js | 269 ++ ios/playground/bundlejs/showcase/calculator.js | 30 +- .../bundlejs/showcase/dropdown/dropdown-demo.js | 38 +- .../bundlejs/showcase/dropdown/we-dropdown.js | 12 +- ios/playground/bundlejs/showcase/minesweeper.js | 12 +- .../bundlejs/showcase/pseudo-class.js | 30 +- ios/playground/bundlejs/showcase/ui.js | 30 +- ios/playground/bundlejs/style/index.js | 82 +- ios/playground/bundlejs/style/style-box.js | 46 +- ios/playground/bundlejs/style/style-flex.js | 54 +- ios/playground/bundlejs/style/style-item.js | 12 +- ios/playground/bundlejs/syntax/hello-world-1.js |4 +- ios/playground/bundlejs/syntax/hello-world-2.js |4 +- ios/playground/bundlejs/syntax/hello-world-3.js |8 +- ios/playground/bundlejs/syntax/hello-world-4.js | 12 +- ios/playground/bundlejs/syntax/hello-world-5.js | 12 +- ios/playground/bundlejs/syntax/hello-world.js | 12 +-
[02/10] incubator-weex git commit: Merge branch '0.12-dev' into 0.12-dev
Merge branch '0.12-dev' into 0.12-dev Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/44feea0e Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/44feea0e Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/44feea0e Branch: refs/heads/0.12-dev Commit: 44feea0e10602bbfb286f447e6f6b0796c50f7b8 Parents: 8d2411e d073636 Author: éå°é£Authored: Mon Mar 27 15:43:11 2017 +0800 Committer: GitHub Committed: Mon Mar 27 15:43:11 2017 +0800 -- .../app/src/main/assets/component/image-demo.js |2 +- .../assets/component/slider-neighbor/index.js | 264 ++ .../slider-neighbor/silder-neighbor.js | 287 -- .../src/main/assets/component/slider/index.js | 33 + .../app/src/main/assets/component/text-demo.js | 108 + .../app/src/main/assets/component/web-demo.js |1 - android/playground/app/src/main/assets/error.js | 2217 .../app/src/main/assets/geolocation.js | 183 + .../app/src/main/assets/hello_weex.js | 28 - android/playground/app/src/main/assets/index.js |2 +- .../app/src/main/assets/linear-gradient.js | 367 ++ .../app/src/main/assets/module/clipboard.js | 27 +- .../app/src/main/assets/module/componentRect.js | 107 +- .../app/src/main/assets/module/instance-api.js | 14 +- .../app/src/main/assets/module/modal.js | 18 +- .../app/src/main/assets/module/picker-demo.js | 18 +- .../app/src/main/assets/module/storage-demo.js | 14 +- .../app/src/main/assets/module/stream-demo.js | 18 +- .../src/main/assets/module/websocket-demo.js| 2412 + .../app/src/main/assets/showcase/calculator.js | 21 +- .../assets/showcase/dropdown/dropdown-demo.js | 30 +- .../assets/showcase/dropdown/we-dropdown.js | 12 +- .../app/src/main/assets/showcase/minesweeper.js | 12 +- .../main/assets/showcase/new-fashion/banner.js |8 +- .../main/assets/showcase/new-fashion/banners.js | 20 +- .../main/assets/showcase/new-fashion/brand.js | 36 +- .../assets/showcase/new-fashion/category.js | 24 +- .../main/assets/showcase/new-fashion/coupon.js | 12 +- .../main/assets/showcase/new-fashion/fashion.js | 38 +- .../main/assets/showcase/new-fashion/goods.js | 24 +- .../assets/showcase/new-fashion/headlines.js| 48 +- .../main/assets/showcase/new-fashion/index.js | 21 +- .../main/assets/showcase/new-fashion/link.js|8 +- .../main/assets/showcase/new-fashion/main.js| 209 +- .../main/assets/showcase/new-fashion/match.js | 24 +- .../assets/showcase/new-fashion/resource.js | 38 +- .../main/assets/showcase/new-fashion/scene.js | 24 +- .../src/main/assets/showcase/pseudo-class.js| 2425 + .../app/src/main/assets/showcase/ui.js | 24 +- .../app/src/main/assets/style/index.js | 76 +- .../app/src/main/assets/style/style-box.js | 40 +- .../app/src/main/assets/style/style-flex.js | 48 +- .../app/src/main/assets/style/style-item.js | 12 +- .../app/src/main/assets/syntax/hello-world-1.js |4 +- .../app/src/main/assets/syntax/hello-world-2.js |6 +- .../app/src/main/assets/syntax/hello-world-3.js | 10 +- .../app/src/main/assets/syntax/hello-world-4.js | 14 +- .../app/src/main/assets/syntax/hello-world-5.js | 14 +- .../app/src/main/assets/syntax/hello-world.js | 14 +- .../app/src/main/assets/syntax/index.js | 20 +- .../src/main/assets/syntax/script-component.js | 24 +- .../app/src/main/assets/syntax/script-data.js | 12 +- .../app/src/main/assets/syntax/script-events.js | 12 +- .../src/main/assets/syntax/script-instance.js | 12 +- .../src/main/assets/syntax/script-lifecycle.js | 12 +- .../app/src/main/assets/syntax/script-module.js | 12 +- .../src/main/assets/syntax/script-options.js| 12 +- .../src/main/assets/syntax/template-class.js| 12 +- .../src/main/assets/syntax/template-content.js | 20 +- .../src/main/assets/syntax/template-event.js| 12 +- .../app/src/main/assets/syntax/template-if.js | 12 +- .../assets/syntax/template-repeat-update.js | 12 +- .../src/main/assets/syntax/template-repeat.js | 12 +- .../src/main/assets/syntax/template-style.js|8 +- .../playground/app/src/main/assets/template.js | 12 +- android/playground/app/src/main/assets/test.js | 128 + .../app/src/main/assets/vue/animation.js| 709 .../app/src/main/assets/vue/components/a.js | 438 +++ .../src/main/assets/vue/components/countdown.js | 640 .../app/src/main/assets/vue/components/image.js | 641 .../app/src/main/assets/vue/components/input.js | 364 ++ .../app/src/main/assets/vue/components/list.js | 246 ++ .../src/main/assets/vue/components/marquee.js
[01/10] incubator-weex git commit: Merge remote-tracking branch 'upstream/0.12-dev' into 0.12-dev
Repository: incubator-weex Updated Branches: refs/heads/0.12-dev 35a3f8c21 -> 5b1126a56 Merge remote-tracking branch 'upstream/0.12-dev' into 0.12-dev Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8d2411e4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8d2411e4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8d2411e4 Branch: refs/heads/0.12-dev Commit: 8d2411e42fbe85047c05053fd515e184fce538d0 Parents: 20f0dc1 e1be952 Author: éé£Authored: Mon Mar 27 15:36:15 2017 +0800 Committer: éé£ Committed: Mon Mar 27 15:36:15 2017 +0800 -- CHANGELOG.md|7 + .../java/com/taobao/weex/WXSDKInstance.java |6 +- .../main/java/com/taobao/weex/WXSDKManager.java | 10 + .../taobao/weex/adapter/DefaultUriAdapter.java |8 +- .../com/taobao/weex/bridge/WXBridgeManager.java |3 +- .../com/taobao/weex/dom/ApplyStyleConsumer.java | 245 .../java/com/taobao/weex/dom/DOMAction.java | 216 +++ .../com/taobao/weex/dom/DOMActionContext.java | 255 .../taobao/weex/dom/DOMActionContextImpl.java | 620 + .../java/com/taobao/weex/dom/RenderAction.java | 215 +++ .../taobao/weex/dom/RenderActionContext.java| 218 +++ .../com/taobao/weex/dom/RenderActionTask.java | 227 .../java/com/taobao/weex/dom/WXDomHandler.java | 82 +- .../java/com/taobao/weex/dom/WXDomManager.java | 300 + .../java/com/taobao/weex/dom/WXDomModule.java | 439 +- .../java/com/taobao/weex/dom/WXDomObject.java |4 +- .../com/taobao/weex/dom/WXDomStatement.java | 1272 -- .../dom/action/AbstractAddElementAction.java| 313 + .../dom/action/AbstractLayoutFinishAction.java | 240 .../java/com/taobao/weex/dom/action/Action.java | 212 +++ .../com/taobao/weex/dom/action/Actions.java | 350 + .../weex/dom/action/AddElementAction.java | 295 .../taobao/weex/dom/action/AddEventAction.java | 262 .../taobao/weex/dom/action/AddRuleAction.java | 254 .../taobao/weex/dom/action/AnimationAction.java | 463 +++ .../weex/dom/action/CreateBodyAction.java | 302 + .../weex/dom/action/CreateFinishAction.java | 224 +++ .../weex/dom/action/GetComponentRectAction.java | 299 .../weex/dom/action/InvokeMethodAction.java | 236 .../weex/dom/action/MoveElementAction.java | 281 .../weex/dom/action/RefreshFinishAction.java| 221 +++ .../weex/dom/action/RemoveElementAction.java| 286 .../weex/dom/action/RemoveEventAction.java | 264 .../weex/dom/action/ScrollToElementAction.java | 257 .../weex/dom/action/UpdateAttributeAction.java | 263 .../weex/dom/action/UpdateFinishAction.java | 237 .../weex/dom/action/UpdateStyleAction.java | 298 .../taobao/weex/ui/RenderActionContextImpl.java | 299 .../com/taobao/weex/ui/WXRenderManager.java | 191 +-- .../com/taobao/weex/ui/WXRenderStatement.java | 556 .../ui/animation/DimensionUpdateListener.java |6 +- .../weex/ui/animation/WXAnimationBean.java |5 +- .../weex/ui/animation/WXAnimationModule.java| 199 +-- .../weex/ui/component/NestedContainer.java |2 + .../taobao/weex/ui/component/WXComponent.java | 12 +- .../com/taobao/weex/ui/component/WXEmbed.java |6 + .../java/com/taobao/weex/WXSDKManagerTest.java |2 +- .../com/taobao/weex/dom/WXDomStatementTest.java | 119 +- .../com/taobao/weex/dom/action/TestActions.java | 59 + .../taobao/weex/ui/WXRenderStatementTest.java |4 +- .../ui/animation/WXAnimationModuleTest.java | 18 +- build/webpack.ci.config.js | 53 + build/webpack.ci.web.config.js | 68 + build/webpack.deprecatedmacacatest.config.js| 53 + build/webpack.macacatest.config.js | 53 - circle.yml | 37 - .../WeexSDK/Sources/Component/WXEditComponent.m | 30 +- package.json| 10 +- test/.gitignore |2 + test/pages/components/scroller-fixed.vue| 64 + test/pages/components/scroller-fixed.we | 62 - test/pages/components/textarea-maxlength.vue| 50 + test/pages/dom-operation.vue| 37 + test/pages/dom-operation.we | 32 - test/pages/image-onload.vue | 21 + test/pages/image-onload.we | 19 - test/pages/index.vue| 30 + test/pages/index.we | 27 - test/pages/list-scroll.vue | 34 + test/pages/list-scroll.we | 31 -
[10/10] incubator-weex git commit: Merge branch '0.12-dev' of https://github.com/cxfeng1/incubator-weex into 0.12-dev
Merge branch '0.12-dev' of https://github.com/cxfeng1/incubator-weex into 0.12-dev * '0.12-dev' of https://github.com/cxfeng1/incubator-weex: * [test] fix recycler test problems * [tc] recycler tc * [ios] fix issue that view unloading will delay if component thread is busy. * invalidate component manager earlier to remove all the component thread tasks. * [test] update page url * [test] fix recycler column gap test and reduce iOS pixel error Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/5b1126a5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/5b1126a5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/5b1126a5 Branch: refs/heads/0.12-dev Commit: 5b1126a56c583b56baa491c67b23e45f6f409d2b Parents: 35a3f8c 982da12 Author: zshshrAuthored: Mon Apr 10 11:24:05 2017 +0800 Committer: zshshr Committed: Mon Apr 10 11:24:05 2017 +0800 -- .../Component/Recycler/WXRecyclerComponent.m| 1 + .../WeexSDK/Sources/Component/WXListComponent.m | 2 + .../Sources/Manager/WXComponentManager.h| 4 + .../Sources/Manager/WXComponentManager.m| 5 + ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 1 + test/pages/components/recycler.vue | 29 ++-- test/scripts/components/recycler.test.js| 164 ++- 7 files changed, 113 insertions(+), 93 deletions(-) --
[3/4] incubator-weex git commit: Merge pull request #1 from yangshengtao/0.12-dev
Merge pull request #1 from yangshengtao/0.12-dev add the component type, when the node is virtual node Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e4823690 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e4823690 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e4823690 Branch: refs/heads/0.12-dev Commit: e48236900f82c6952501ce3f3a28b23099dfb328 Parents: babfa41 ebb1b0e Author: åé <705040...@qq.com> Authored: Thu Apr 6 17:30:20 2017 +0800 Committer: GitHubCommitted: Thu Apr 6 17:30:20 2017 +0800 -- ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m| 1 + ios/sdk/WeexSDK/Sources/Model/WXComponent.h | 6 ++ ios/sdk/WeexSDK/Sources/Model/WXComponent.m | 5 + ios/sdk/WeexSDK/Sources/Utility/WXDefine.h | 11 +++ ios/sdk/WeexSDK/Sources/Utility/WXType.h | 5 + .../WeexSDK/Sources/View/WXComponent+ViewManagement.m| 3 +++ 6 files changed, 31 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e4823690/ios/sdk/WeexSDK/Sources/Model/WXComponent.m -- diff --cc ios/sdk/WeexSDK/Sources/Model/WXComponent.m index cecc708,cfd1dbc..adc252f --- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.m @@@ -450,36 -455,9 +454,37 @@@ } +- (void)setGradientLayer +{ +if (CGRectEqualToRect(self.view.frame, CGRectZero)) { +return; +} +NSDictionary * linearGradient = [WXUtility linearGradientWithBackgroundImage:_backgroundImage]; +if (!linearGradient) { +return ; +} + +__weak typeof(self) weakSelf = self; +dispatch_async(dispatch_get_main_queue(), ^{ +__strong typeof(self) strongSelf = weakSelf; +/* + must insert the gradientLayer at index 0, and then set masksToBounds to match the view bounds + or the subview will be invisible + */ + +if(strongSelf) { +UIColor * startColor = (UIColor*)linearGradient[@"startColor"]; +UIColor * endColor = (UIColor*)linearGradient[@"endColor"]; +CAGradientLayer * gradientLayer = [WXUtility gradientLayerFromColors:@[startColor, endColor] locations:nil frame:strongSelf.view.bounds gradientType:[linearGradient[@"gradientType"] integerValue]]; +[strongSelf.view.layer insertSublayer:gradientLayer atIndex:0]; +strongSelf.view.layer.masksToBounds = YES; +} +}); +} + - (void)_configWXComponentA11yWithAttributes:(NSDictionary *)attributes { + WX_CHECK_COMPONENT_TYPE(self.componentType) if (attributes[@"role"]){ _role = [WXConvert WXUIAccessibilityTraits:attributes[@"role"]]; self.view.accessibilityTraits = _role; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e4823690/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m --
[1/4] incubator-weex git commit: add a member in WXComponent to flag the component have no view
Repository: incubator-weex Updated Branches: refs/heads/0.12-dev 43eb4dfcd -> 35a3f8c21 add a member in WXComponent to flag the component have no view commonly component always has a host view, but some times maybe not, such as a svg label, the sub component like defs will not have a hostview, infact, the ellipse has no view too, it just tell us need to draw a ellipse to it's parent compoent's hostview. example: http://www.w3.org/2000/svg;> Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/babfa411 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/babfa411 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/babfa411 Branch: refs/heads/0.12-dev Commit: babfa411709212973e1bb4f2807f692ff0e174b9 Parents: 41c8ef6 Author: littleseven <705040...@qq.com> Authored: Thu Apr 6 16:44:39 2017 +0800 Committer: littleseven <705040...@qq.com> Committed: Thu Apr 6 16:44:39 2017 +0800 -- .../taobao/weex/ui/component/WXComponent.java| 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/babfa411/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java -- diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java index 44e6c23..7e7259f 100755 --- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java +++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java @@ -230,6 +230,10 @@ public abstract class WXComponent implements IWXObject, IWXActi private PesudoStatus mPesudoStatus = new PesudoStatus(); private boolean mIsDestroyed = false; private boolean mIsDisabled = false; + private int mType = TYPE_COMMON; + + public static final int TYPE_COMMON = 0; + public static final int TYPE_VIRTUAL = 1; //Holding the animation bean when component is uninitialized public void postAnimation(WXAnimationModule.AnimationHolder holder) { @@ -318,9 +322,14 @@ public abstract class WXComponent implements IWXObject, IWXActi } public WXComponent(WXSDKInstance instance, WXDomObject dom, WXVContainer parent) { +this(instance, dom, parent, TYPE_COMMON); + } + + public WXComponent(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, int type) { mInstance = instance; mContext = mInstance.getContext(); mParent = parent; +mType = type; mDomObj = dom.clone(); mCurrentRef = mDomObj.getRef(); mGestureType = new HashSet<>(); @@ -635,7 +644,7 @@ public abstract class WXComponent implements IWXObject, IWXActi @Deprecated public void updateProperties(Mapprops) { -if (props == null || mHost == null) { +if (props == null || (mHost == null && !isVirtualComponent())) { return; } @@ -966,7 +975,7 @@ public abstract class WXComponent implements IWXObject, IWXActi protected void createViewImpl() { if (mContext != null) { mHost = initComponentHostView(mContext); - if (mHost == null) { + if (mHost == null && !isVirtualComponent()) { //compatible initView(); } @@ -1431,11 +1440,15 @@ public abstract class WXComponent implements IWXObject, IWXActi * @return false component add subview */ public boolean isVirtualComponent(){ -return false; +return mType == TYPE_VIRTUAL; } public void removeVirtualComponent() { } + public void setType(int type) { +mType = type; + } + public boolean hasScrollParent(WXComponent component) { if (component.getParent() == null) { return true;
[2/2] incubator-weex git commit: Merge branch '0.12-fix-one-event' of https://github.com/sospartan/incubator-weex into 0.12-dev
Merge branch '0.12-fix-one-event' of https://github.com/sospartan/incubator-weex into 0.12-dev Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/43eb4dfc Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/43eb4dfc Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/43eb4dfc Branch: refs/heads/0.12-dev Commit: 43eb4dfcd0f7cc7de0bc891878d30e0c79ee04db Parents: 6e4dcfb 36a8b88 Author: YorkShenAuthored: Mon Apr 10 10:20:38 2017 +0800 Committer: YorkShen Committed: Mon Apr 10 10:20:38 2017 +0800 -- .../com/taobao/weex/ui/component/WXComponent.java | 4 .../com/taobao/weex/ui/view/gesture/WXGesture.java| 14 ++ 2 files changed, 18 insertions(+) --
[1/2] incubator-weex git commit: * [android] disable click event when gesture already consume touch event
Repository: incubator-weex Updated Branches: refs/heads/0.12-dev 6e4dcfb96 -> 43eb4dfcd * [android] disable click event when gesture already consume touch event Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/36a8b880 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/36a8b880 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/36a8b880 Branch: refs/heads/0.12-dev Commit: 36a8b8805a49bdb4252e10795326d67d73d3daca Parents: 41c8ef6 Author: sospartanAuthored: Thu Apr 6 15:03:11 2017 +0800 Committer: sospartan Committed: Thu Apr 6 15:03:11 2017 +0800 -- .../com/taobao/weex/ui/component/WXComponent.java | 4 .../com/taobao/weex/ui/view/gesture/WXGesture.java| 14 ++ 2 files changed, 18 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/36a8b880/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java -- diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java index 44e6c23..4c0a9a7 100755 --- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java +++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java @@ -422,6 +422,10 @@ public abstract class WXComponent implements IWXObject, IWXActi view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { +if(mGesture != null && mGesture.isTouchEventConsumed()){ + //event is already consumed by gesture + return; +} for (OnClickListener listener : mHostClickListeners){ if(listener != null) { listener.onHostViewClick(); http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/36a8b880/android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java -- diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java b/android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java index 95bb112..05b9c9d 100755 --- a/android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java +++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/gesture/WXGesture.java @@ -256,6 +256,7 @@ public class WXGesture extends GestureDetector.SimpleOnGestureListener implement private WXGestureType mPendingPan = null;//event type to notify when action_up or action_cancel private int mParentOrientation =-1; private boolean mIsPreventMoveEvent = false; + private boolean mIsTouchEventConsumed = false; //Reset to false when first touch event, set to true when gesture event fired. public WXGesture(WXComponent wxComponent, Context context) { this.component = wxComponent; @@ -288,6 +289,15 @@ public class WXGesture extends GestureDetector.SimpleOnGestureListener implement mIsPreventMoveEvent = preventMoveEvent; } + /** + * + * @return true if current touch event is already consumed by gesture. + * Reset to false when next first touch event, set to true when gesture event fired. + */ + public boolean isTouchEventConsumed(){ +return mIsTouchEventConsumed; + } + @Override public boolean onTouch(View v, MotionEvent event) { try { @@ -295,6 +305,7 @@ public class WXGesture extends GestureDetector.SimpleOnGestureListener implement switch (event.getActionMasked()) { case MotionEvent.ACTION_POINTER_DOWN: case MotionEvent.ACTION_DOWN: + mIsTouchEventConsumed = false; /** * If component has same scroll orientation with it's parent and it's parent not scrollable * , we should disallow parent in DOWN. @@ -309,12 +320,14 @@ public class WXGesture extends GestureDetector.SimpleOnGestureListener implement break; case MotionEvent.ACTION_MOVE: result |= handleMotionEvent(LowLevelGesture.ACTION_MOVE, event); + mIsTouchEventConsumed = mIsTouchEventConsumed || result; break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_POINTER_UP: finishDisallowInterceptTouchEvent(v); result |= handleMotionEvent(LowLevelGesture.ACTION_UP, event); result |= handlePanMotionEvent(event); + mIsTouchEventConsumed = mIsTouchEventConsumed || result; break; case MotionEvent.ACTION_CANCEL: finishDisallowInterceptTouchEvent(v); @@ -627,6 +640,7 @@ public class WXGesture extends GestureDetector.SimpleOnGestureListener
[3/7] incubator-weex git commit: * [html5] update slider infinite
* [html5] update slider infinite Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/15d9ed4c Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/15d9ed4c Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/15d9ed4c Branch: refs/heads/0.11-dev Commit: 15d9ed4c83800eee8ed4cb881aa0a901fbf40404 Parents: 1ac3795 a7c108e Author: tancyAuthored: Thu Apr 6 18:25:35 2017 +0800 Committer: tancy Committed: Thu Apr 6 18:25:35 2017 +0800 -- .eslintrc |13 +- .flowconfig |16 + .gitignore | 2 + .travis.yml |56 +- CONTRIBUTING.md |38 +- Dangerfile-ios | 4 + Gemfile |15 + Gemfile.lock| 122 + README.md | 2 +- android/.gitignore | 3 +- android/commons/build.gradle|12 +- .../weex/commons/AbstractWeexActivity.java | 2 +- .../commons/adapter/JSExceptionAdapter.java | 222 + android/playground/app/build.gradle | 9 +- .../app/src/main/assets/component/image-demo.js | 2 +- .../assets/component/slider-neighbor/index.js | 264 + .../slider-neighbor/silder-neighbor.js | 287 - .../src/main/assets/component/slider/index.js |33 + .../app/src/main/assets/component/text-demo.js | 108 + .../app/src/main/assets/component/web-demo.js | 1 - android/playground/app/src/main/assets/error.js | 2217 ++ .../app/src/main/assets/geolocation.js | 183 + .../app/src/main/assets/hello_weex.js |28 - android/playground/app/src/main/assets/index.js | 2 +- .../app/src/main/assets/linear-gradient.js | 367 + .../app/src/main/assets/module/clipboard.js |27 +- .../app/src/main/assets/module/componentRect.js | 107 +- .../app/src/main/assets/module/instance-api.js |14 +- .../app/src/main/assets/module/modal.js |18 +- .../app/src/main/assets/module/picker-demo.js |18 +- .../app/src/main/assets/module/storage-demo.js |14 +- .../app/src/main/assets/module/stream-demo.js |18 +- .../src/main/assets/module/websocket-demo.js| 2412 ++ .../app/src/main/assets/showcase/calculator.js |21 +- .../assets/showcase/dropdown/dropdown-demo.js |30 +- .../assets/showcase/dropdown/we-dropdown.js |12 +- .../app/src/main/assets/showcase/minesweeper.js |12 +- .../main/assets/showcase/new-fashion/banner.js | 8 +- .../main/assets/showcase/new-fashion/banners.js |20 +- .../main/assets/showcase/new-fashion/brand.js |36 +- .../assets/showcase/new-fashion/category.js |24 +- .../main/assets/showcase/new-fashion/coupon.js |12 +- .../main/assets/showcase/new-fashion/fashion.js |38 +- .../main/assets/showcase/new-fashion/goods.js |24 +- .../assets/showcase/new-fashion/headlines.js|48 +- .../main/assets/showcase/new-fashion/index.js |21 +- .../main/assets/showcase/new-fashion/link.js| 8 +- .../main/assets/showcase/new-fashion/main.js| 209 +- .../main/assets/showcase/new-fashion/match.js |24 +- .../assets/showcase/new-fashion/resource.js |38 +- .../main/assets/showcase/new-fashion/scene.js |24 +- .../src/main/assets/showcase/pseudo-class.js| 2425 ++ .../app/src/main/assets/showcase/ui.js |24 +- .../app/src/main/assets/style/index.js |76 +- .../app/src/main/assets/style/style-box.js |40 +- .../app/src/main/assets/style/style-flex.js |48 +- .../app/src/main/assets/style/style-item.js |12 +- .../app/src/main/assets/syntax/hello-world-1.js | 4 +- .../app/src/main/assets/syntax/hello-world-2.js | 6 +- .../app/src/main/assets/syntax/hello-world-3.js |10 +- .../app/src/main/assets/syntax/hello-world-4.js |14 +- .../app/src/main/assets/syntax/hello-world-5.js |14 +- .../app/src/main/assets/syntax/hello-world.js |14 +- .../app/src/main/assets/syntax/index.js |20 +- .../src/main/assets/syntax/script-component.js |24 +- .../app/src/main/assets/syntax/script-data.js |12 +- .../app/src/main/assets/syntax/script-events.js |12 +- .../src/main/assets/syntax/script-instance.js |12 +- .../src/main/assets/syntax/script-lifecycle.js |12 +- .../app/src/main/assets/syntax/script-module.js |12 +- .../src/main/assets/syntax/script-options.js|12 +- .../src/main/assets/syntax/template-class.js|12 +-
[6/7] incubator-weex git commit: * [html5] add slider infinte demo
* [html5] add slider infinte demo Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/44866b74 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/44866b74 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/44866b74 Branch: refs/heads/0.11-dev Commit: 44866b749415234e9969d31a56505a18adbcac5f Parents: 66df2cb Author: tancyAuthored: Fri Apr 7 12:03:15 2017 +0800 Committer: tancy Committed: Fri Apr 7 12:03:15 2017 +0800 -- examples/vue/components/sliderinfinite.vue | 46 + 1 file changed, 46 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/44866b74/examples/vue/components/sliderinfinite.vue -- diff --git a/examples/vue/components/sliderinfinite.vue b/examples/vue/components/sliderinfinite.vue new file mode 100644 index 000..4a3702e --- /dev/null +++ b/examples/vue/components/sliderinfinite.vue @@ -0,0 +1,46 @@ + + + + + + + + + + + + .image { +width: 700px; +height: 300px; + } + .slider { +margin-top: 25px; +margin-left: 25px; +width: 700px; +height: 300px; +border-width: 2px; +border-style: solid; +border-color: #41B883; + } + .frame { +width: 700px; +height: 300px; +position: relative; + } + + + + export default { +data () { + return { +imageList: [ + { src: 'https://gw.alicdn.com/tfs/TB1SA2wQXXDapXX-1400-600.png'}, + { src: 'https://gw.alicdn.com/tfs/TB1KS_OQXcSXVXX-1400-600.png'}, + { src: 'https://gw.alicdn.com/tfs/TB1Ez7XQXbN-1400-600.png'}, + { src: 'https://gw.alicdn.com/tfs/TB1XLn6QXb2XpXX-1400-600.png'} +] + + } +} + } + \ No newline at end of file
[1/7] incubator-weex git commit: + [html5] slider infinite
Repository: incubator-weex Updated Branches: refs/heads/0.11-dev 83a2b46c3 -> 9afe27b96 + [html5] slider infinite Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/98d0e1c0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/98d0e1c0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/98d0e1c0 Branch: refs/heads/0.11-dev Commit: 98d0e1c05a86ab8d30d96f760e5487cf4f35a44c Parents: 146968b Author: tancyAuthored: Thu Mar 23 18:42:45 2017 +0800 Committer: tancy Committed: Thu Mar 23 18:42:45 2017 +0800 -- examples/vue/components/slider.vue | 5 html5/render/vue/components/slider/index.js | 7 - .../render/vue/components/slider/slideMixin.js | 27 ++-- vue.html| 10 4 files changed, 41 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/98d0e1c0/examples/vue/components/slider.vue -- diff --git a/examples/vue/components/slider.vue b/examples/vue/components/slider.vue index 5985b68..2734bbe 100644 --- a/examples/vue/components/slider.vue +++ b/examples/vue/components/slider.vue @@ -1,5 +1,10 @@ + + + + + http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/98d0e1c0/html5/render/vue/components/slider/index.js -- diff --git a/html5/render/vue/components/slider/index.js b/html5/render/vue/components/slider/index.js index cb82b86..87b3b5c 100644 --- a/html5/render/vue/components/slider/index.js +++ b/html5/render/vue/components/slider/index.js @@ -13,7 +13,12 @@ export default { interval: { type: [String, Number], default: 3000 +}, +infinite: { + type: [String, Boolean], + default: false } + }, data () { @@ -104,7 +109,7 @@ export default { this._autoPlayTimer = setTimeout(autoPlayFn, interval) } - +// this.order() this.reorder() fireLazyload(this.$el, true) }, http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/98d0e1c0/html5/render/vue/components/slider/slideMixin.js -- diff --git a/html5/render/vue/components/slider/slideMixin.js b/html5/render/vue/components/slider/slideMixin.js index db78dcc..b8ec37c 100644 --- a/html5/render/vue/components/slider/slideMixin.js +++ b/html5/render/vue/components/slider/slideMixin.js @@ -14,6 +14,13 @@ export default { }, slideTo (index) { + if (this.infinite && this.infinite !== 'false') { +if (index === -1 || index > (this._cells.length - 1)) { + this.slideTo(this.currentIndex) + return +} + } + const newIndex = this.normalizeIndex(index) const inner = this.$refs.inner const step = this._cells.length <= 1 ? 0 : this.currentIndex - index @@ -44,7 +51,18 @@ export default { setTimeout(() => { this.reorder() }, TRANSITION_TIME) } }, - +order () { + this.$nextTick(() => { +for (let i = 1, l = this._cells.length; i < l; i++) { + const nextElm = this._cells[i].elm + const nextOffset = this.wrapperWidth * i + // console.log(this.wrapperWidth + ' - ' + this.innerOffset) + nextElm.style.webkitTransform = `translate3d(${nextOffset}px, 0, 0)` + nextElm.style.transform = `translate3d(${nextOffset}px, 0, 0)` +} +// this.reorder() + }) +}, reorder () { const removeClone = (clone, prevElm) => { // switch current page. @@ -56,10 +74,14 @@ export default { } this.$nextTick(() => { +console.log(this.infinite) if (this._cells.length <= 1) { return } - +if (this.infinite && this.infinite !== 'false') { + this.order() + return +} const lastPrev = this._prevElm const prevIndex = this.normalizeIndex(this.currentIndex - 1) const nextIndex = this.normalizeIndex(this.currentIndex + 1) @@ -67,6 +89,7 @@ export default { const nextElm = this._cells[nextIndex].elm const currentElm = this._cells[this.currentIndex].elm +currentElm.style.zIndex = 1 // clone prevCell if there are only tow slides. if (this._cells.length === 2) { this._clonePrev && removeClone(this._clonePrev, lastPrev) http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/98d0e1c0/vue.html -- diff --git a/vue.html b/vue.html
[5/7] incubator-weex git commit: * [html5] update infinte default value
* [html5] update infinte default value Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/66df2cbb Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/66df2cbb Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/66df2cbb Branch: refs/heads/0.11-dev Commit: 66df2cbb90691ebc04b74132bedf18aefb477cf3 Parents: 22e9364 Author: tancyAuthored: Fri Apr 7 12:01:23 2017 +0800 Committer: tancy Committed: Fri Apr 7 12:01:23 2017 +0800 -- html5/render/vue/components/slider/index.js | 2 +- html5/render/vue/components/slider/slideMixin.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/66df2cbb/html5/render/vue/components/slider/index.js -- diff --git a/html5/render/vue/components/slider/index.js b/html5/render/vue/components/slider/index.js index 9a7058e..5707432 100644 --- a/html5/render/vue/components/slider/index.js +++ b/html5/render/vue/components/slider/index.js @@ -16,7 +16,7 @@ export default { }, infinite: { type: [String, Boolean], - default: false + default: true } }, http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/66df2cbb/html5/render/vue/components/slider/slideMixin.js -- diff --git a/html5/render/vue/components/slider/slideMixin.js b/html5/render/vue/components/slider/slideMixin.js index 8ae2dd2..de2736c 100644 --- a/html5/render/vue/components/slider/slideMixin.js +++ b/html5/render/vue/components/slider/slideMixin.js @@ -14,7 +14,7 @@ export default { }, slideTo (index) { - if (this.infinite && this.infinite !== 'false') { + if (!this.infinite || this.infinite === 'false') { if (index === -1 || index > (this._cells.length - 1)) { this.slideTo(this.currentIndex) return @@ -76,7 +76,7 @@ export default { if (this._cells.length <= 1) { return } -if (this.infinite && this.infinite !== 'false') { +if (!this.infinite || this.infinite === 'false') { this.order() return }
[4/7] incubator-weex git commit: * [html5] update del console
* [html5] update del console Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/22e93644 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/22e93644 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/22e93644 Branch: refs/heads/0.11-dev Commit: 22e93644ccdda7f23efd725470916cb1999af69e Parents: 15d9ed4 Author: tancyAuthored: Thu Apr 6 19:05:19 2017 +0800 Committer: tancy Committed: Thu Apr 6 19:05:19 2017 +0800 -- html5/render/vue/components/slider/index.js | 1 - html5/render/vue/components/slider/slideMixin.js | 2 -- 2 files changed, 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/22e93644/html5/render/vue/components/slider/index.js -- diff --git a/html5/render/vue/components/slider/index.js b/html5/render/vue/components/slider/index.js index 87b3b5c..9a7058e 100644 --- a/html5/render/vue/components/slider/index.js +++ b/html5/render/vue/components/slider/index.js @@ -109,7 +109,6 @@ export default { this._autoPlayTimer = setTimeout(autoPlayFn, interval) } -// this.order() this.reorder() fireLazyload(this.$el, true) }, http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/22e93644/html5/render/vue/components/slider/slideMixin.js -- diff --git a/html5/render/vue/components/slider/slideMixin.js b/html5/render/vue/components/slider/slideMixin.js index 97292b4..8ae2dd2 100644 --- a/html5/render/vue/components/slider/slideMixin.js +++ b/html5/render/vue/components/slider/slideMixin.js @@ -56,7 +56,6 @@ export default { for (let i = 1, l = this._cells.length; i < l; i++) { const nextElm = this._cells[i].elm const nextOffset = this.wrapperWidth * i - // console.log(this.wrapperWidth + ' - ' + this.innerOffset) nextElm.style.webkitTransform = `translate3d(${nextOffset}px, 0, 0)` nextElm.style.transform = `translate3d(${nextOffset}px, 0, 0)` } @@ -74,7 +73,6 @@ export default { } this.$nextTick(() => { -console.log(this.infinite) if (this._cells.length <= 1) { return }
[2/7] incubator-weex git commit: * [example] slider
* [example] slider Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1ac37956 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1ac37956 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1ac37956 Branch: refs/heads/0.11-dev Commit: 1ac37956d49e96da00dfb2a119c69e137a9d9af6 Parents: 98d0e1c Author: tancyAuthored: Wed Apr 5 14:57:43 2017 +0800 Committer: tancy Committed: Wed Apr 5 14:57:43 2017 +0800 -- examples/vue/components/slider.vue | 5 - 1 file changed, 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1ac37956/examples/vue/components/slider.vue -- diff --git a/examples/vue/components/slider.vue b/examples/vue/components/slider.vue index 2734bbe..5985b68 100644 --- a/examples/vue/components/slider.vue +++ b/examples/vue/components/slider.vue @@ -1,10 +1,5 @@ - - - - -
[7/7] incubator-weex git commit: Merge branch 'html5-feature-vue-render-slider-infinite' of https://github.com/Tancy/incubator-weex into 0.11-dev
Merge branch 'html5-feature-vue-render-slider-infinite' of https://github.com/Tancy/incubator-weex into 0.11-dev Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9afe27b9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9afe27b9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9afe27b9 Branch: refs/heads/0.11-dev Commit: 9afe27b964af4b4b4c035cf19c3436b7594ea4fb Parents: 83a2b46 44866b7 Author: MrRaindropAuthored: Sun Apr 9 16:32:04 2017 +0800 Committer: MrRaindrop Committed: Sun Apr 9 16:32:04 2017 +0800 -- examples/vue/components/sliderinfinite.vue | 46 html5/render/vue/components/slider/index.js | 6 ++- .../render/vue/components/slider/slideMixin.js | 24 +- vue.html| 10 ++--- 4 files changed, 78 insertions(+), 8 deletions(-) --