You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by bo...@apache.org on 2017/03/29 11:46:58 UTC
[1/3] incubator-weex git commit: * [android] recycler demo bugfix
Repository: incubator-weex
Updated Branches:
refs/heads/0.11-dev 61ab9f49e -> c2f0b6552
* [android] recycler demo bugfix
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/5c543fa4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/5c543fa4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/5c543fa4
Branch: refs/heads/0.11-dev
Commit: 5c543fa40dbb3240aa37e998962fcc3b3c22474a
Parents: 0dc2daa
Author: zshshr <zh...@gmail.com>
Authored: Tue Mar 28 19:13:42 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Tue Mar 28 19:13:42 2017 +0800
----------------------------------------------------------------------
test/pages/components/recycler.vue | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/5c543fa4/test/pages/components/recycler.vue
----------------------------------------------------------------------
diff --git a/test/pages/components/recycler.vue b/test/pages/components/recycler.vue
index 12ca01c..ce4f21f 100644
--- a/test/pages/components/recycler.vue
+++ b/test/pages/components/recycler.vue
@@ -5,13 +5,14 @@
:show-scrollbar="showScrollbar" :scrollable="scrollable"
@scroll="recylerScroll" @loadmore="loadmore" loadmoreoffset=3000
>
- <refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown" :display="refreshing ? 'show' : 'hide'">
+ <!--<refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown" :display="refreshing ? 'show' : 'hide'">
<loading-indicator class="indicator"></loading-indicator>
<text class="refreshText">{{refreshText}}</text>
- </refresh>
+ </refresh>-->
<header class="header" ref="header" v-if="showHeader">
- <image class="banner" src="https://gw.alicdn.com/tps/TB1ESN1PFXXXXX1apXXXXXXXXXX-1000-600.jpg" resize="cover">
- <div class="bannerInfo">
+ <div class="banner">
+ <image class="absolute" src="https://gw.alicdn.com/tps/TB1ESN1PFXXXXX1apXXXXXXXXXX-1000-600.jpg" resize="cover"></image>
+ <div class="bannerInfo">
<image class="avatar" src="https://gw.alicdn.com/tps/TB1EP9bPFXXXXbpXVXXXXXXXXXX-150-110.jpg" resize="cover"></image>
<text class="name">Adam Cat</text>
<div class="titleWrap">
@@ -21,9 +22,9 @@
<div class="bannerPhotoWrap">
<image class="bannerPhoto" v-for="photo in banner.photos" :src="photo.src"></image>
</div>
- </image>
+ </div>
</header>
- <header class="stickyHeader" @click="showOrRemoveHeader">
+ <header class="stickyHeader" >
<div v-if="stickyHeaderType === 'none'" class="stickyWrapper">
<text class="stickyText">Sticky Header</text>
</div>
@@ -79,6 +80,12 @@
width: 40;
margin-right: 30;
}
+ .absolute {
+ position: absolute;
+ top: 0px;
+ width: 750;
+ height: 377;
+}
.banner {
height: 377;
flex-direction: row;
[3/3] incubator-weex git commit: * [ios] fix issue that scrollable
components can not scroll to top if frame.size < contentSize
Posted by bo...@apache.org.
* [ios] fix issue that scrollable components can not scroll to top if frame.size < contentSize
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/c2f0b655
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/c2f0b655
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/c2f0b655
Branch: refs/heads/0.11-dev
Commit: c2f0b6552530370effb6637db955616e0aad95e4
Parents: cae9aa8
Author: \u9690\u98ce <cx...@apache.org>
Authored: Wed Mar 29 19:31:36 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Wed Mar 29 19:31:36 2017 +0800
----------------------------------------------------------------------
.../Component/Recycler/WXRecyclerComponent.m | 16 ++++++++--------
ios/sdk/WeexSDK/Sources/Component/WXListComponent.m | 7 +------
.../WeexSDK/Sources/Component/WXScrollerComponent.m | 10 ++--------
3 files changed, 11 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c2f0b655/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 b5b5ac8..842fa1f 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.m
@@ -45,6 +45,11 @@ typedef enum : NSUInteger {
[self.wx_component layoutDidFinish];
}
+- (void)setContentOffset:(CGPoint)contentOffset
+{
+ [super setContentOffset:contentOffset];
+}
+
@end
@interface WXCollectionViewCell : UICollectionViewCell
@@ -211,24 +216,19 @@ typedef enum : NSUInteger {
- (void)scrollToComponent:(WXComponent *)component withOffset:(CGFloat)offset animated:(BOOL)animated
{
- if (_collectionView.contentSize.height <= _collectionView.frame.size.height) {
- // can not scroll
- return;
- }
-
CGPoint contentOffset = _collectionView.contentOffset;
CGFloat contentOffsetY = 0;
CGRect rect;
while (component) {
if ([component isKindOfClass:[WXCellComponent class]]) {
- NSIndexPath *toIndexPath = [self.dataController indexPathForCell:component];
+ NSIndexPath *toIndexPath = [self.dataController indexPathForCell:(WXCellComponent *)component];
UICollectionViewLayoutAttributes *attributes = [_collectionView layoutAttributesForItemAtIndexPath:toIndexPath];
rect = attributes.frame;
break;
}
if ([component isKindOfClass:[WXHeaderComponent class]]) {
- NSUInteger toIndex = [self.dataController indexForHeader:component];
+ NSUInteger toIndex = [self.dataController indexForHeader:(WXHeaderComponent *)component];
UICollectionViewLayoutAttributes *attributes = [_collectionView layoutAttributesForSupplementaryElementOfKind:kCollectionSupplementaryViewKindHeader atIndexPath:[NSIndexPath indexPathWithIndex:toIndex]];
rect = attributes.frame;
break;
@@ -240,7 +240,7 @@ typedef enum : NSUInteger {
contentOffsetY += rect.origin.y;
contentOffsetY += offset * self.weexInstance.pixelScaleFactor;
- if (contentOffsetY > _collectionView.contentSize.height - _collectionView.frame.size.height) {
+ if (_collectionView.contentSize.height >= _collectionView.frame.size.height && contentOffsetY > _collectionView.contentSize.height - _collectionView.frame.size.height) {
contentOffset.y = _collectionView.contentSize.height - _collectionView.frame.size.height;
} else {
contentOffset.y = contentOffsetY;
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c2f0b655/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 bc31995..c598a3d 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.m
@@ -173,11 +173,6 @@
- (void)scrollToComponent:(WXComponent *)component withOffset:(CGFloat)offset animated:(BOOL)animated
{
- if (_tableView.contentSize.height <= _tableView.frame.size.height) {
- // can not scroll
- return;
- }
-
CGPoint contentOffset = _tableView.contentOffset;
CGFloat contentOffsetY = 0;
@@ -201,7 +196,7 @@
contentOffsetY += cellRect.origin.y;
contentOffsetY += offset * self.weexInstance.pixelScaleFactor;
- if (contentOffsetY > _tableView.contentSize.height - _tableView.frame.size.height) {
+ if (_tableView.contentSize.height >= _tableView.frame.size.height && contentOffsetY > _tableView.contentSize.height - _tableView.frame.size.height) {
contentOffset.y = _tableView.contentSize.height - _tableView.frame.size.height;
} else {
contentOffset.y = contentOffsetY;
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c2f0b655/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
index 50dc059..eb7c15d 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
@@ -318,12 +318,6 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
- (void)scrollToComponent:(WXComponent *)component withOffset:(CGFloat)offset animated:(BOOL)animated
{
UIScrollView *scrollView = (UIScrollView *)self.view;
-
- if ((_scrollDirection == WXScrollDirectionHorizontal && scrollView.contentSize.width <= scrollView.frame.size.width)
- || (_scrollDirection == WXScrollDirectionVertical && scrollView.contentSize.height <= scrollView.frame.size.height)) {
- // can not scroll
- return;
- }
CGPoint contentOffset = scrollView.contentOffset;
CGFloat scaleFactor = self.weexInstance.pixelScaleFactor;
@@ -332,7 +326,7 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
CGFloat contentOffetX = [component.supercomponent.view convertPoint:component.view.frame.origin toView:self.view].x;
contentOffetX += offset * scaleFactor;
- if (contentOffetX > scrollView.contentSize.width - scrollView.frame.size.width) {
+ if (scrollView.contentSize.width >= scrollView.frame.size.width && contentOffetX > scrollView.contentSize.width - scrollView.frame.size.width) {
contentOffset.x = scrollView.contentSize.width - scrollView.frame.size.width;
} else {
contentOffset.x = contentOffetX;
@@ -341,7 +335,7 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
CGFloat contentOffetY = [component.supercomponent.view convertPoint:component.view.frame.origin toView:self.view].y;
contentOffetY += offset * scaleFactor;
- if (contentOffetY > scrollView.contentSize.height - scrollView.frame.size.height) {
+ if (scrollView.contentSize.height >= scrollView.frame.size.height && contentOffetY > scrollView.contentSize.height - scrollView.frame.size.height) {
contentOffset.y = scrollView.contentSize.height - scrollView.frame.size.height;
} else {
contentOffset.y = contentOffetY;
[2/3] incubator-weex git commit: Merge remote-tracking branch
'upstream/0.11-dev' into 0.11-dev
Posted by bo...@apache.org.
Merge remote-tracking branch 'upstream/0.11-dev' 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/cae9aa8a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/cae9aa8a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/cae9aa8a
Branch: refs/heads/0.11-dev
Commit: cae9aa8ac675919f577dace712944b817d7d0bea
Parents: 5c543fa 61ab9f4
Author: \u9690\u98ce <cx...@apache.org>
Authored: Tue Mar 28 21:28:42 2017 +0800
Committer: \u9690\u98ce <cx...@apache.org>
Committed: Tue Mar 28 21:28:42 2017 +0800
----------------------------------------------------------------------
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/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 +-
ios/playground/bundlejs/syntax/index.js | 296 +-
.../bundlejs/syntax/script-component.js | 24 +-
ios/playground/bundlejs/syntax/script-data.js | 12 +-
ios/playground/bundlejs/syntax/script-events.js | 20 +-
.../bundlejs/syntax/script-instance.js | 12 +-
.../bundlejs/syntax/script-lifecycle.js | 12 +-
ios/playground/bundlejs/syntax/script-module.js | 12 +-
.../bundlejs/syntax/script-options.js | 12 +-
.../bundlejs/syntax/template-class.js | 12 +-
.../bundlejs/syntax/template-content.js | 20 +-
.../bundlejs/syntax/template-event.js | 12 +-
ios/playground/bundlejs/syntax/template-if.js | 12 +-
.../bundlejs/syntax/template-repeat-update.js | 12 +-
.../bundlejs/syntax/template-repeat.js | 12 +-
.../bundlejs/syntax/template-style.js | 8 +-
ios/playground/bundlejs/template.js | 12 +-
ios/playground/bundlejs/test.js | 8 +-
ios/playground/bundlejs/vue/animation.js | 120 +-
ios/playground/bundlejs/vue/components/a.js | 97 +-
.../bundlejs/vue/components/countdown.js | 122 +-
ios/playground/bundlejs/vue/components/image.js | 142 +-
ios/playground/bundlejs/vue/components/input.js | 735 +++--
ios/playground/bundlejs/vue/components/list.js | 44 +-
.../bundlejs/vue/components/marquee.js | 105 +-
.../bundlejs/vue/components/navigator.js | 187 +-
.../bundlejs/vue/components/scroller.js | 48 +-
.../bundlejs/vue/components/slider.js | 341 +--
.../bundlejs/vue/components/tabbar.js | 133 +-
ios/playground/bundlejs/vue/components/text.js | 132 +-
ios/playground/bundlejs/vue/components/video.js | 72 +-
.../bundlejs/vue/components/waterfall.js | 24 +-
ios/playground/bundlejs/vue/components/web.js | 74 +-
ios/playground/bundlejs/vue/hello.js | 19 +-
ios/playground/bundlejs/vue/iconfont.js | 36 +-
ios/playground/bundlejs/vue/index.js | 139 +-
.../bundlejs/vue/modules/clipboard.js | 147 +-
.../bundlejs/vue/modules/instance-api.js | 59 +-
ios/playground/bundlejs/vue/modules/modal.js | 105 +-
ios/playground/bundlejs/vue/modules/storage.js | 71 +-
ios/playground/bundlejs/vue/modules/stream.js | 95 +-
.../bundlejs/vue/showcase/boxshadow.js | 244 ++
.../bundlejs/vue/showcase/calculator.js | 72 +-
.../bundlejs/vue/showcase/itemlist.js | 166 +-
.../bundlejs/vue/showcase/new-fashion.js | 557 ++--
.../bundlejs/vue/showcase/progress.js | 63 +-
ios/playground/bundlejs/vue/style/index.js | 418 +--
ios/playground/bundlejs/vue/style/style-box.js | 180 +-
ios/playground/bundlejs/vue/style/style-flex.js | 238 +-
ios/playground/bundlejs/vue/style/style-item.js | 26 +-
.../bundlejs/vue/syntax/hello-world-1.js | 17 +-
.../bundlejs/vue/syntax/hello-world-2.js | 23 +-
.../bundlejs/vue/syntax/hello-world-3.js | 28 +-
.../bundlejs/vue/syntax/hello-world-4.js | 32 +-
.../bundlejs/vue/syntax/hello-world-5.js | 32 +-
.../bundlejs/vue/syntax/hello-world.js | 32 +-
.../bundlejs/vue/syntax/script-component.js | 64 +-
.../bundlejs/vue/syntax/script-data.js | 36 +-
.../bundlejs/vue/syntax/script-events.js | 32 +-
.../bundlejs/vue/syntax/script-instance.js | 30 +-
.../bundlejs/vue/syntax/script-lifecycle.js | 32 +-
.../bundlejs/vue/syntax/script-module.js | 30 +-
.../bundlejs/vue/syntax/script-options.js | 28 +-
.../bundlejs/vue/syntax/template-class.js | 34 +-
.../bundlejs/vue/syntax/template-content.js | 49 +-
.../bundlejs/vue/syntax/template-event.js | 36 +-
.../bundlejs/vue/syntax/template-if.js | 32 +-
.../vue/syntax/template-repeat-update.js | 40 +-
.../bundlejs/vue/syntax/template-repeat.js | 50 +-
.../bundlejs/vue/syntax/template-style.js | 27 +-
ios/playground/bundlejs/vue/template.js | 181 +-
135 files changed, 9826 insertions(+), 7187 deletions(-)
----------------------------------------------------------------------