You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by gu...@apache.org on 2017/10/23 08:10:38 UTC
[10/18] incubator-weex git commit: Revert: * [android] modify
border-android.png
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bdcc5356/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 b7a522a..a7d042e 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.m
@@ -69,8 +69,8 @@
CGPoint _lastContentOffset;
CGPoint _lastScrollEventFiredOffset;
BOOL _scrollable;
- NSString * _alwaysScrollableVertical;
- NSString * _alwaysScrollableHorizontal;
+ BOOL _alwaysScrollableVertical;
+ BOOL _alwaysScrollableHorizontal;
// vertical & horizontal
WXScrollDirection _scrollDirection;
@@ -119,13 +119,10 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
_lastScrollEventFiredOffset = CGPointMake(0, 0);
_scrollDirection = attributes[@"scrollDirection"] ? [WXConvert WXScrollDirection:attributes[@"scrollDirection"]] : WXScrollDirectionVertical;
_showScrollBar = attributes[@"showScrollbar"] ? [WXConvert BOOL:attributes[@"showScrollbar"]] : YES;
-
- if (attributes[@"alwaysScrollableVertical"]) {
- _alwaysScrollableVertical = [WXConvert NSString:attributes[@"alwaysScrollableVertical"]];
- }
- if (attributes[@"alwaysScrollableHorizontal"]) {
- _alwaysScrollableHorizontal = [WXConvert NSString:attributes[@"alwaysScrollableHorizontal"]];
- }
+ // default value is NO;
+ _alwaysScrollableVertical = attributes[@"alwaysScrollableVertical"]?[WXConvert BOOL:attributes[@"alwaysScrollableVertical"]] : NO;
+ // default value is NO;
+ _alwaysScrollableHorizontal = attributes[@"alwaysScrollableHorizontal"]?[WXConvert BOOL:attributes[@"alwaysScrollableHorizontal"]] : NO;
_pagingEnabled = attributes[@"pagingEnabled"] ? [WXConvert BOOL:attributes[@"pagingEnabled"]] : NO;
_loadMoreOffset = attributes[@"loadmoreoffset"] ? [WXConvert WXPixelType:attributes[@"loadmoreoffset"] scaleFactor:self.weexInstance.pixelScaleFactor] : 0;
_loadmoreretry = attributes[@"loadmoreretry"] ? [WXConvert NSUInteger:attributes[@"loadmoreretry"]] : 0;
@@ -165,12 +162,8 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
scrollView.showsHorizontalScrollIndicator = _showScrollBar;
scrollView.scrollEnabled = _scrollable;
scrollView.pagingEnabled = _pagingEnabled;
- if (_alwaysScrollableHorizontal) {
- scrollView.alwaysBounceHorizontal = [WXConvert BOOL:_alwaysScrollableHorizontal];
- }
- if (_alwaysScrollableVertical) {
- scrollView.alwaysBounceVertical = [WXConvert BOOL:_alwaysScrollableVertical];
- }
+ scrollView.alwaysBounceHorizontal = _alwaysScrollableHorizontal;
+ scrollView.alwaysBounceVertical = _alwaysScrollableVertical;
if (WX_SYS_VERSION_GREATER_THAN_OR_EQUAL_TO(@"11.0")) {
// now use the runtime to forbid the contentInset being Adjusted.
// here we add a category for scoller component view class compatible for new API,
@@ -239,13 +232,13 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
((UIScrollView *)self.view).scrollEnabled = _scrollable;
}
if (attributes[@"alwaysScrollableHorizontal"]) {
- _alwaysScrollableHorizontal = [WXConvert NSString:attributes[@"alwaysScrollableHorizontal"]];
- ((UIScrollView*)self.view).alwaysBounceHorizontal = [WXConvert BOOL:_alwaysScrollableHorizontal];
+ _alwaysScrollableHorizontal = [WXConvert BOOL:attributes[@"alwaysScrollableHorizontal"]];
+ ((UIScrollView*)self.view).alwaysBounceHorizontal = _alwaysScrollableHorizontal;
}
if (attributes[@"alwaysScrollableVertical"]) {
- _alwaysScrollableVertical = [WXConvert NSString:attributes[@"alwaysScrollableVertical"]];
- ((UIScrollView*)self.view).alwaysBounceVertical = [WXConvert BOOL:_alwaysScrollableVertical];
+ _alwaysScrollableVertical = [WXConvert BOOL:attributes[@"alwaysScrollableVertical"]];
+ ((UIScrollView*)self.view).alwaysBounceVertical = _alwaysScrollableVertical;
}
if (attributes[@"offsetAccuracy"]) {
_offsetAccuracy = [WXConvert WXPixelType:attributes[@"offsetAccuracy"] scaleFactor:self.weexInstance.pixelScaleFactor];
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bdcc5356/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m
index 792d4c9..f66bd11 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXWebComponent.m
@@ -200,9 +200,6 @@ WX_EXPORT_METHOD(@selector(goForward))
NSMutableDictionary *data = [self baseInfo];
[data setObject:[error localizedDescription] forKey:@"errorMsg"];
[data setObject:[NSString stringWithFormat:@"%ld", (long)error.code] forKey:@"errorCode"];
- if(error.userInfo && ![error.userInfo[NSURLErrorFailingURLStringErrorKey] hasPrefix:@"http"]){
- return;
- }
[self fireEvent:@"error" params:data];
}
}
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bdcc5356/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.m
index fb0c0b3..a72e556 100644
--- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.m
+++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.m
@@ -22,8 +22,6 @@
#import "WXConvert.h"
#import "WXUtility.h"
#import "WXComponent_internal.h"
-#import "UIBezierPath+Weex.h"
-#import "WXRoundedRect.h"
@implementation WXComponent (BoxShadow)
@@ -83,20 +81,15 @@
if (!boxShadow) {
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;
- CGFloat topLeft = radii.topLeft, topRight = radii.topRight, bottomLeft = radii.bottomLeft, bottomRight = radii.bottomRight;
- UIBezierPath *shadowPath = [UIBezierPath wx_bezierPathWithRoundedRect:self.view.bounds topLeft:topLeft topRight:topRight bottomLeft:bottomLeft bottomRight:bottomRight];
if (boxShadow.isInset) {
if (boxShadow.innerLayer) {
boxShadow.innerLayer.frame = self.view.bounds;
if (![boxShadow.innerLayer superlayer] ){
- self.view.layer.masksToBounds = YES;
[self.view.layer addSublayer:boxShadow.innerLayer];
}
}
} else {
+ UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds];
self.view.layer.masksToBounds = NO;
self.view.layer.shadowColor = boxShadow.shadowColor.CGColor;
self.view.layer.shadowOffset = boxShadow.shadowOffset;
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bdcc5356/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m
index fbd62b9..e86221d 100644
--- a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m
+++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m
@@ -37,7 +37,6 @@
#import "WXLog.h"
#import "WXUtility.h"
#import "WXExtendCallNativeManager.h"
-#import "WXExceptionUtils.h"
@implementation WXSDKEngine
@@ -231,9 +230,7 @@
WX_MONITOR_PERF_START(WXPTInitalizeSync)
if (!script || script.length <= 0) {
- NSMutableString *errMsg = [NSMutableString stringWithFormat:@"[WX_KEY_EXCEPTION_SDK_INIT_JSFM_INIT_FAILED] script don't exist:%@",script];
- [WXExceptionUtils commitCriticalExceptionRT:@"WX_KEY_EXCEPTION_SDK_INIT" errCode:[NSString stringWithFormat:@"%d", WX_KEY_EXCEPTION_SDK_INIT] function:@"initSDKEnvironment" exception:errMsg extParams:nil];
- WX_MONITOR_FAIL(WXMTJSFramework, WX_ERR_JSFRAMEWORK_LOAD, errMsg);
+ WX_MONITOR_FAIL(WXMTJSFramework, WX_ERR_JSFRAMEWORK_LOAD, @"framework loading is failure!");
return;
}
static dispatch_once_t onceToken;
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bdcc5356/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h
index e47cb1c..38b1e2b 100644
--- a/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h
+++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h
@@ -51,11 +51,5 @@ typedef NS_ENUM(int, WXSDKErrCode)
WX_ERR_NOT_CONNECTED_TO_INTERNET = -2205,
WX_ERR_CANCEL = -2204,
WX_ERR_DOWNLOAD_END = -2299,
-
- WX_KEY_EXCEPTION_SDK_INIT = -9000,
- WX_KEY_EXCEPTION_INVOKE = -9100,
- WX_KEY_EXCEPTION_JS_DOWNLOAD =-9200,
- WX_KEY_EXCEPTION_DOM = -9300,
- WX_KEY_EXCEPTION_WXBRIDGE=-9400,
};
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bdcc5356/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.h b/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.h
deleted file mode 100644
index c0bcf4b..0000000
--- a/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "WXJSExceptionInfo.h"
-
-@interface WXExceptionUtils : NSObject
-
-+ (void)commitCriticalExceptionRT:(NSString *)instanceId errCode:(NSString *)errCode function:(NSString *)function exception:(NSString *)exception extParams:(NSDictionary *)extParams;
-
-+ (void)commitCriticalExceptionRT:(WXJSExceptionInfo*)jsExceptionInfo;
-@end
-
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bdcc5356/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.m b/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.m
deleted file mode 100644
index 0ed7297..0000000
--- a/ios/sdk/WeexSDK/Sources/Monitor/WXExceptionUtils.m
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "WXExceptionUtils.h"
-#import "WXJSExceptionProtocol.h"
-#import "WXHandlerFactory.h"
-#import "WXSDKEngine.h"
-#import "WXSDKError.h"
-#import "WXJSExceptionInfo.h"
-#import "WXUtility.h"
-#import "WXSDKManager.h"
-
-
-@implementation WXExceptionUtils
-
-+ (void)commitCriticalExceptionRT:(NSString *)instanceId errCode:(NSString *)errCode function:(NSString *)function exception:(NSString *)exception extParams:(NSDictionary *)extParams{
- NSString *bundleUrlCommit = @"BundleUrlDefault";
- NSString *instanceIdCommit = @"InstanceIdDefalut";
-
- if(![WXUtility isBlankString:instanceId]){
- instanceIdCommit = instanceId;
- WXSDKInstance * instance = [WXSDKManager instanceForID:instanceId];
- if(instance){
- bundleUrlCommit = [instance.scriptURL absoluteString]?:bundleUrlCommit;
- }else if([instanceIdCommit hasPrefix:@"WX_KEY_EXCEPTION"]){
- bundleUrlCommit = instanceId;
- }
- }
-
- WXJSExceptionInfo * jsExceptionInfo = [[WXJSExceptionInfo alloc] initWithInstanceId:instanceIdCommit bundleUrl:bundleUrlCommit errorCode:errCode functionName:function exception:exception userInfo: [extParams mutableCopy]];
- [WXExceptionUtils commitCriticalExceptionRT:jsExceptionInfo];
-}
-
-+ (void)commitCriticalExceptionRT:(WXJSExceptionInfo *)jsExceptionInfo{
- id<WXJSExceptionProtocol> jsExceptionHandler = [WXHandlerFactory handlerForProtocol:@protocol(WXJSExceptionProtocol)];
- if ([jsExceptionHandler respondsToSelector:@selector(onJSException:)]) {
- [jsExceptionHandler onJSException:jsExceptionInfo];
- }
-}
-
-@end
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/bdcc5356/ios/sdk/WeexSDK/Sources/WeexSDK.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/WeexSDK.h b/ios/sdk/WeexSDK/Sources/WeexSDK.h
index 562cfa8..3bbc3ea 100644
--- a/ios/sdk/WeexSDK/Sources/WeexSDK.h
+++ b/ios/sdk/WeexSDK/Sources/WeexSDK.h
@@ -53,7 +53,6 @@
#import "WXIndicatorComponent.h"
#import "WXImgLoaderProtocol.h"
#import "WXExtendCallNativeProtocol.h"
-#import "WXExceptionUtils.h"
#import "WXEventModuleProtocol.h"
#import "WXErrorView.h"
#import "WXDefine.h"