Skip to content

Commit c76e60b

Browse files
committed
Merge branch 'dev' of github.com:alibaba/weex into dev
2 parents 8162124 + 956be54 commit c76e60b

File tree

13 files changed

+82
-24
lines changed

13 files changed

+82
-24
lines changed

examples/component/input-demo.we

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,4 @@
136136
}
137137
}
138138
};
139-
</script>
139+
</script>

examples/component/web-demo.we

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
module.exports = {
4747
methods: {
4848
goback: function() {
49-
var $webview = require('@weex-module/webview');
5049
var webElement = this.$el('webview');
5150
$webview.goBack(webElement.ref);
5251
},

examples/module/stream-demo.we

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@
9191
stream.fetch({
9292
method: 'POST',
9393
url: POST_URL,
94-
type:'json'
94+
type:'json',
95+
body:JSON.stringify({username:'weex'})//or you can just use JSON Object {username:'weex'}
9596
}, function(ret) {
9697
if(!ret.ok){
9798
me.postResult = "request failed";

ios/sdk/WeexSDK/Sources/Component/WXEmbedComponent.m

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,18 @@ - (void)_renderWithURL:(NSURL *)sourceURL
151151
};
152152

153153
_embedInstance.onFailed = ^(NSError *error) {
154-
if (weakSelf.errorView) {
155-
return ;
156-
}
157-
158-
WXErrorView *errorView = [[WXErrorView alloc]initWithFrame:CGRectMake(0.0f, 0.0f, 135.0f, 130.0f)];
159-
errorView.center = CGPointMake(weakSelf.view.bounds.size.width / 2.0f, weakSelf.view.bounds.size.height / 2.0f);
160-
errorView.delegate = weakSelf;
161-
[weakSelf.view addSubview:errorView];
162-
163-
weakSelf.errorView = errorView;
154+
dispatch_async(dispatch_get_main_queue(), ^{
155+
if (weakSelf.errorView) {
156+
return ;
157+
}
158+
159+
WXErrorView *errorView = [[WXErrorView alloc]initWithFrame:CGRectMake(0.0f, 0.0f, 135.0f, 130.0f)];
160+
errorView.center = CGPointMake(weakSelf.view.bounds.size.width / 2.0f, weakSelf.view.bounds.size.height / 2.0f);
161+
errorView.delegate = weakSelf;
162+
[weakSelf.view addSubview:errorView];
163+
164+
weakSelf.errorView = errorView;
165+
});
164166
};
165167

166168
_embedInstance.renderFinish = ^(UIView *view) {

ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ - (void)updateAttributes:(NSDictionary *)attributes
110110
_imageSrc = [[WXConvert NSString:attributes[@"src"]] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
111111
[self updateImage];
112112
}
113-
113+
114114
[self configPlaceHolder:attributes];
115115

116116
if (attributes[@"resize"]) {

ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ - (void)adjustSticky
215215
}
216216
CGFloat scrollOffsetY = ((UIScrollView *)self.view).contentOffset.y;
217217
for(WXComponent *component in self.stickyArray) {
218-
if (CGPointEqualToPoint(component->_absolutePosition, CGPointZero)) {
218+
if (isnan(component->_absolutePosition.x) && isnan(component->_absolutePosition.y)) {
219219
component->_absolutePosition = [component.supercomponent.view convertPoint:component.view.frame.origin toView:self.view];
220220
}
221221
CGPoint relativePosition = component->_absolutePosition;

ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.m

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,23 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gesture shouldReceiveTouch:(UIT
514514
return YES;
515515
}
516516

517+
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
518+
//if the view which the otherGestureRecognizer works on is a scrollview and also it is scrollEnabled vertically ,at this time,we should not block the guesture from being recognized by the otherGestureRecognize
519+
if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {
520+
if ([otherGestureRecognizer.view isKindOfClass:[UIScrollView class]]) {
521+
UIScrollView* scrollview = (UIScrollView *)otherGestureRecognizer.view;
522+
if (scrollview.scrollEnabled) {
523+
UIPanGestureRecognizer* panRcgn= (UIPanGestureRecognizer *)gestureRecognizer;
524+
//check offset for confirming vertival movement
525+
if (fabs([panRcgn translationInView:panRcgn.view].y) > fabs([panRcgn translationInView:panRcgn.view].x)*16) {
526+
return YES;
527+
}
528+
}
529+
}
530+
}
531+
return NO;
532+
}
533+
517534

518535
- (void)didPan:(UIPanGestureRecognizer *)panGesture
519536
{
@@ -526,11 +543,12 @@ - (void)didPan:(UIPanGestureRecognizer *)panGesture
526543
_scrolling = NO;
527544
_decelerating = NO;
528545
_previousTranslation = _vertical? [panGesture translationInView:self].y: [panGesture translationInView:self].x;
529-
546+
530547
[_delegate sliderNeighborWillBeginDragging:self];
531548
break;
532549
}
533550
case UIGestureRecognizerStateEnded:
551+
534552
case UIGestureRecognizerStateCancelled:
535553
case UIGestureRecognizerStateFailed:
536554
{
@@ -566,6 +584,7 @@ - (void)didPan:(UIPanGestureRecognizer *)panGesture
566584
}
567585
case UIGestureRecognizerStateChanged:
568586
{
587+
569588
CGFloat translation = _vertical? [panGesture translationInView:self].y: [panGesture translationInView:self].x;
570589
CGFloat velocity = _vertical? [panGesture velocityInView:self].y: [panGesture velocityInView:self].x;
571590

@@ -1425,6 +1444,22 @@ - (UIView *)loadView
14251444
return _sliderView;
14261445
}
14271446

1447+
- (void)dealloc
1448+
{
1449+
_sliderView.delegate = nil;
1450+
_sliderView.dataSource = nil;
1451+
if (_autoPlay) {
1452+
[self _stopAutoPlayTimer];
1453+
}
1454+
_sliderView = nil;
1455+
[self.items removeAllObjects];
1456+
}
1457+
1458+
- (void)viewDidUnload
1459+
{
1460+
[self.items removeAllObjects];
1461+
}
1462+
14281463
- (void)viewDidLoad
14291464
{
14301465
_sliderView = (WXSliderNeighborView *)self.view;

ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ - (void)removeEvent:(NSString *)removeEventName
122122

123123
- (void)_initEvents:(NSArray *)events
124124
{
125-
NSArray *eventsCopy = [events copy];
126-
for (NSString *addEventName in eventsCopy) {
125+
for (NSString *addEventName in events) {
127126
[self _addEventOnMainThread:addEventName];
128127
}
129128
}

ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ - (void)createFinish
462462
WX_MONITOR_SUCCESS(WXMTNativeRender);
463463

464464
if(instance.renderFinish){
465-
[instance creatFinish];
466465
instance.renderFinish(rootView);
467466
}
468467
}];

ios/sdk/WeexSDK/Sources/Model/WXComponent.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ - (instancetype)initWithRef:(NSString *)ref
6969
_styles = styles ? [NSMutableDictionary dictionaryWithDictionary:styles] : [NSMutableDictionary dictionary];
7070
_attributes = attributes ? [NSMutableDictionary dictionaryWithDictionary:attributes] : [NSMutableDictionary dictionary];
7171
_events = events ? [NSMutableArray arrayWithArray:events] : [NSMutableArray array];
72-
7372
_subcomponents = [NSMutableArray array];
7473

74+
_absolutePosition = CGPointMake(NAN, NAN);
75+
7576
_isNeedJoinLayoutSystem = YES;
7677
_isLayoutDirty = YES;
7778
_isViewFrameSyncWithCalculated = YES;

0 commit comments

Comments
 (0)