* [iOS] rm youga * [ios] fix build error
* [iOS] rm code * [iOS] rm lines Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9acc1bc4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9acc1bc4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9acc1bc4 Branch: refs/heads/master Commit: 9acc1bc46e022b00fc83067f6040861035c0674b Parents: 4641d3e Author: zhongcang <[email protected]> Authored: Tue May 22 13:01:50 2018 +0800 Committer: Adam Feng <[email protected]> Committed: Tue May 22 20:50:44 2018 +0800 ---------------------------------------------------------------------- ios/sdk/WeexSDK.xcodeproj/project.pbxproj | 18 - .../RecycleList/WXCellSlotComponent.mm | 21 - .../Component/Recycler/WXRecyclerComponent.mm | 28 +- .../Sources/Component/WXCellComponent.mm | 23 - .../Sources/Component/WXCycleSliderComponent.mm | 12 +- .../Sources/Component/WXEditComponent.mm | 43 - .../Sources/Component/WXHeaderComponent.mm | 23 - .../Sources/Component/WXListComponent.mm | 17 - .../Sources/Component/WXLoadingComponent.mm | 13 +- .../Sources/Component/WXRefreshComponent.mm | 12 +- .../Sources/Component/WXScrollerComponent.mm | 72 - .../Component/WXSliderNeighborComponent.mm | 11 +- .../Sources/Component/WXSwitchComponent.mm | 15 +- .../Sources/Component/WXTextAreaComponent.mm | 28 - .../Sources/Component/WXTextComponent.mm | 78 +- ios/sdk/WeexSDK/Sources/Layout/Layout.c | 1329 ------------------ ios/sdk/WeexSDK/Sources/Layout/Layout.h | 177 --- .../WeexSDK/Sources/Layout/WXComponent+Layout.h | 22 - .../Sources/Layout/WXComponent+Layout.mm | 378 +---- ios/sdk/WeexSDK/Sources/Layout/WXLayoutDefine.h | 63 - .../Sources/Layout/WXScrollerComponent+Layout.h | 8 - .../Layout/WXScrollerComponent+Layout.mm | 7 - .../Sources/Manager/WXComponentManager.mm | 172 +-- ios/sdk/WeexSDK/Sources/Model/WXComponent.h | 1 - ios/sdk/WeexSDK/Sources/Model/WXComponent.mm | 78 +- ios/sdk/WeexSDK/Sources/Utility/WXConvert.h | 7 - ios/sdk/WeexSDK/Sources/Utility/WXConvert.m | 99 -- ios/sdk/WeexSDK/Sources/WeexSDK.h | 2 - 28 files changed, 49 insertions(+), 2708 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK.xcodeproj/project.pbxproj ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj index 7a59478..685cebd 100644 --- a/ios/sdk/WeexSDK.xcodeproj/project.pbxproj +++ b/ios/sdk/WeexSDK.xcodeproj/project.pbxproj @@ -101,8 +101,6 @@ 59AC02511D2A7E6E00355112 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 59AC02501D2A7E6E00355112 /* [email protected] */; }; 59CE27E81CC387DB000BE37A /* WXEmbedComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 59CE27E61CC387DB000BE37A /* WXEmbedComponent.h */; }; 59CE27E91CC387DB000BE37A /* WXEmbedComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 59CE27E71CC387DB000BE37A /* WXEmbedComponent.m */; }; - 59D3CA401CF9ED57008835DC /* Layout.c in Sources */ = {isa = PBXBuildFile; fileRef = 59D3CA3E1CF9ED57008835DC /* Layout.c */; }; - 59D3CA411CF9ED57008835DC /* Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 59D3CA3F1CF9ED57008835DC /* Layout.h */; settings = {ATTRIBUTES = (Public, ); }; }; 59D3CA4A1CFC3CE1008835DC /* NSTimer+Weex.h in Headers */ = {isa = PBXBuildFile; fileRef = 59D3CA481CFC3CE1008835DC /* NSTimer+Weex.h */; }; 59D3CA4B1CFC3CE1008835DC /* NSTimer+Weex.m in Sources */ = {isa = PBXBuildFile; fileRef = 59D3CA491CFC3CE1008835DC /* NSTimer+Weex.m */; }; 740451EA1E14BB26004157CB /* WXServiceFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 740451E81E14BB26004157CB /* WXServiceFactory.h */; }; @@ -206,7 +204,6 @@ 74A4BAA71CB4F98300195969 /* WXStreamModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 74A4BAA51CB4F98300195969 /* WXStreamModule.m */; }; 74AD99841D5B0E59008F0336 /* WXPolyfillSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AD99821D5B0E59008F0336 /* WXPolyfillSet.h */; }; 74AD99851D5B0E59008F0336 /* WXPolyfillSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 74AD99831D5B0E59008F0336 /* WXPolyfillSet.m */; }; - 74B232D21D2A2BA4006322EA /* WXLayoutDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 74B232D11D2A2BA4006322EA /* WXLayoutDefine.h */; settings = {ATTRIBUTES = (Public, ); }; }; 74B81AE31F73C3E300D3A61D /* WXRecycleListComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 74CFDD371F45939C007A1A66 /* WXRecycleListComponent.h */; }; 74B81AE41F73C3E500D3A61D /* WXRecycleListComponent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 74CFDD381F45939C007A1A66 /* WXRecycleListComponent.mm */; }; 74B81AE51F73C3E900D3A61D /* WXRecycleListDataManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 74CFDD3B1F459400007A1A66 /* WXRecycleListDataManager.h */; }; @@ -485,7 +482,6 @@ DCA445B01EFA576200D0CFA8 /* WXModalUIModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 746319271C71B92600EFEBD4 /* WXModalUIModule.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445B11EFA576800D0CFA8 /* WXLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 77D161601C02ED790010B15B /* WXLog.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445B21EFA576D00D0CFA8 /* WXListComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 74CC7A1E1C2BF9DC00829368 /* WXListComponent.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DCA445B31EFA577300D0CFA8 /* WXLayoutDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 74B232D11D2A2BA4006322EA /* WXLayoutDefine.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445B41EFA577F00D0CFA8 /* WXJSExceptionProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = DCDFED001E68238F00C228D7 /* WXJSExceptionProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445B51EFA578400D0CFA8 /* WXJSExceptionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DCF343651E49CAEE00A2FB34 /* WXJSExceptionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445B61EFA578B00D0CFA8 /* WXIndicatorComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC750221C7565690041D390 /* WXIndicatorComponent.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -505,7 +501,6 @@ DCA445C41EFA57E300D0CFA8 /* WXAppConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 74A4BA941CB365D100195969 /* WXAppConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445C51EFA57E800D0CFA8 /* WXAComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AE5B7501CAB7DBD0082FDDB /* WXAComponent.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445C61EFA57EE00D0CFA8 /* NSObject+WXSwizzle.h in Headers */ = {isa = PBXBuildFile; fileRef = 74896F2E1D1AC79400D1D593 /* NSObject+WXSwizzle.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DCA445C71EFA57F300D0CFA8 /* Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 59D3CA3F1CF9ED57008835DC /* Layout.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCA445C91EFA58CE00D0CFA8 /* native-bundle-main.js in Resources */ = {isa = PBXBuildFile; fileRef = DCF0CD9D1EAF3A6B0062CA8F /* native-bundle-main.js */; }; DCA445CA1EFA58CE00D0CFA8 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 59AC02501D2A7E6E00355112 /* [email protected] */; }; DCA445CB1EFA590600D0CFA8 /* WXComponent+Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 744BEA571D0520F300452B5D /* WXComponent+Layout.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -594,7 +589,6 @@ DCA446221EFA5AC400D0CFA8 /* WXResourceRequestHandlerDefaultImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 742AD7281DF98C45007DC46C /* WXResourceRequestHandlerDefaultImpl.h */; }; DCA446241EFA5AFE00D0CFA8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCA446231EFA5AFE00D0CFA8 /* UIKit.framework */; }; DCA446271EFA5DAF00D0CFA8 /* WeexSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = DCA446261EFA5DAF00D0CFA8 /* WeexSDK.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DCA446281EFA611300D0CFA8 /* Layout.c in Sources */ = {isa = PBXBuildFile; fileRef = 59D3CA3E1CF9ED57008835DC /* Layout.c */; }; DCA446291EFA688B00D0CFA8 /* WeexSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = DCA446261EFA5DAF00D0CFA8 /* WeexSDK.h */; settings = {ATTRIBUTES = (Public, ); }; }; DCAB35FE1D658EB700C0EA70 /* WXRuleManager.h in Headers */ = {isa = PBXBuildFile; fileRef = DCAB35FC1D658EB700C0EA70 /* WXRuleManager.h */; }; DCAB35FF1D658EB700C0EA70 /* WXRuleManager.m in Sources */ = {isa = PBXBuildFile; fileRef = DCAB35FD1D658EB700C0EA70 /* WXRuleManager.m */; }; @@ -730,8 +724,6 @@ 59AC02501D2A7E6E00355112 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; }; 59CE27E61CC387DB000BE37A /* WXEmbedComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXEmbedComponent.h; sourceTree = "<group>"; }; 59CE27E71CC387DB000BE37A /* WXEmbedComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXEmbedComponent.m; sourceTree = "<group>"; }; - 59D3CA3E1CF9ED57008835DC /* Layout.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Layout.c; path = Layout/Layout.c; sourceTree = "<group>"; }; - 59D3CA3F1CF9ED57008835DC /* Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Layout.h; path = Layout/Layout.h; sourceTree = "<group>"; }; 59D3CA461CFC3CC0008835DC /* WXSliderComponent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WXSliderComponent.mm; sourceTree = "<group>"; }; 59D3CA481CFC3CE1008835DC /* NSTimer+Weex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTimer+Weex.h"; sourceTree = "<group>"; }; 59D3CA491CFC3CE1008835DC /* NSTimer+Weex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTimer+Weex.m"; sourceTree = "<group>"; }; @@ -836,7 +828,6 @@ 74A4BAA51CB4F98300195969 /* WXStreamModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXStreamModule.m; sourceTree = "<group>"; }; 74AD99821D5B0E59008F0336 /* WXPolyfillSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXPolyfillSet.h; sourceTree = "<group>"; }; 74AD99831D5B0E59008F0336 /* WXPolyfillSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXPolyfillSet.m; sourceTree = "<group>"; }; - 74B232D11D2A2BA4006322EA /* WXLayoutDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WXLayoutDefine.h; path = Layout/WXLayoutDefine.h; sourceTree = "<group>"; }; 74B8BEFC1DC47B72004A6027 /* WXRootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WXRootView.h; sourceTree = "<group>"; }; 74B8BEFD1DC47B72004A6027 /* WXRootView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXRootView.m; sourceTree = "<group>"; }; 74B8BF001DC49AFE004A6027 /* WXRootViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WXRootViewTests.m; sourceTree = "<group>"; }; @@ -1061,10 +1052,7 @@ 17C7B50320452E1800A2296A /* WXCoreStyle.h */, 17C7B50020452E1800A2296A /* WXScrollerComponent+Layout.h */, 17C7B4FF20452E1800A2296A /* WXScrollerComponent+Layout.mm */, - 59D3CA3E1CF9ED57008835DC /* Layout.c */, - 59D3CA3F1CF9ED57008835DC /* Layout.h */, 744BEA571D0520F300452B5D /* WXComponent+Layout.h */, - 74B232D11D2A2BA4006322EA /* WXLayoutDefine.h */, ); name = Layout; sourceTree = "<group>"; @@ -1666,7 +1654,6 @@ 77D161201C02DDB40010B15B /* WXSDKEngine.h in Headers */, 745ED2DA1C5F2C7E002DB5A8 /* WXView.h in Headers */, 17B122252090AAB000387E33 /* WXSDKError.h in Headers */, - 59D3CA411CF9ED57008835DC /* Layout.h in Headers */, 2AE5B7521CAB7DBD0082FDDB /* WXAComponent.h in Headers */, 77D1614F1C02E3880010B15B /* WXUtility.h in Headers */, 743933B41C7ED9AA00773BB7 /* WXSimulatorShortcutManager.h in Headers */, @@ -1772,7 +1759,6 @@ C43C03E81EC8ACA40044C7FF /* WXPrerenderManager.h in Headers */, 17C74F0C2072145100AB4CAB /* WXAnalyzerCenter.h in Headers */, 17C7B50B20452E1800A2296A /* WXCoreStyle.h in Headers */, - 74B232D21D2A2BA4006322EA /* WXLayoutDefine.h in Headers */, C4B834281DE69B09007AD27E /* WXPickerModule.h in Headers */, 59A596311CB632050012CD52 /* WXRootViewController.h in Headers */, DCF087611DCAE161005CD6EB /* WXInvocationConfig.h in Headers */, @@ -1853,10 +1839,8 @@ DCA445C31EFA57DC00D0CFA8 /* WXAppMonitorProtocol.h in Headers */, DCA445AF1EFA575D00D0CFA8 /* WXModuleProtocol.h in Headers */, ED053501207F4DEB007B4568 /* JSContext+Weex.h in Headers */, - DCA445B31EFA577300D0CFA8 /* WXLayoutDefine.h in Headers */, DCA4459F1EFA56EC00D0CFA8 /* WXURLRewriteProtocol.h in Headers */, DCA445A21EFA570100D0CFA8 /* WXScrollerComponent.h in Headers */, - DCA445C71EFA57F300D0CFA8 /* Layout.h in Headers */, DCA445B71EFA579200D0CFA8 /* WXImgLoaderProtocol.h in Headers */, DCA445C21EFA57D700D0CFA8 /* WXBaseViewController.h in Headers */, DCA445AB1EFA574100D0CFA8 /* WXPrerenderManager.h in Headers */, @@ -2248,7 +2232,6 @@ C43C03E91EC8ACA40044C7FF /* WXPrerenderManager.m in Sources */, 2A837AB51CD9DE9200AEDF03 /* WXLoadingIndicator.m in Sources */, C4F012831E1502E9003378D0 /* WXWebSocketModule.m in Sources */, - 59D3CA401CF9ED57008835DC /* Layout.c in Sources */, DCF087621DCAE161005CD6EB /* WXInvocationConfig.m in Sources */, C47B78CF1F2998EE001D3B0C /* WXExtendCallNativeManager.m in Sources */, 77D161311C02DE4E0010B15B /* WXComponent.mm in Sources */, @@ -2411,7 +2394,6 @@ DCA445551EFA55B300D0CFA8 /* WXIndicatorComponent.m in Sources */, 17E5ACDB2091F05700EE81F1 /* WXComponent+Layout.mm in Sources */, DCA445561EFA55B300D0CFA8 /* WXTextInputComponent.m in Sources */, - DCA446281EFA611300D0CFA8 /* Layout.c in Sources */, DCA445571EFA55B300D0CFA8 /* WXTextAreaComponent.mm in Sources */, DCA445581EFA55B300D0CFA8 /* WXTransform.m in Sources */, DCA445591EFA55B300D0CFA8 /* WXWebComponent.m in Sources */, http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/RecycleList/WXCellSlotComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/RecycleList/WXCellSlotComponent.mm b/ios/sdk/WeexSDK/Sources/Component/RecycleList/WXCellSlotComponent.mm index b1b757a..8e2aa8d 100644 --- a/ios/sdk/WeexSDK/Sources/Component/RecycleList/WXCellSlotComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/RecycleList/WXCellSlotComponent.mm @@ -69,26 +69,7 @@ - (void)triggerLayout { WXAssertComponentThread(); - -//#ifndef USE_FLEX - if(![WXComponent isUseFlex]) - { - //TODO: _isUseContainerWidth? - if (isUndefined(self.cssNode->style.dimensions[CSS_WIDTH])) { - self.cssNode->style.dimensions[CSS_WIDTH] = ((WXScrollerComponent *)(self.supercomponent)).scrollerCSSNode->style.dimensions[CSS_WIDTH]; - } - - if ([self needsLayout]) { - layoutNode(self.cssNode, CSS_UNDEFINED, CSS_UNDEFINED, CSS_DIRECTION_INHERIT); - if ([WXLog logLevel] >= WXLogLevelDebug) { - print_css_node(self.cssNode, (css_print_options_t)(CSS_PRINT_LAYOUT | CSS_PRINT_STYLE | CSS_PRINT_CHILDREN)); - } - } - } -//#else - else - { if (flexIsUndefined(self.flexCssNode->getStyleWidth())) { self.flexCssNode->setStyleWidth(((WXScrollerComponent *)(self.supercomponent)).flexScrollerCSSNode->getStyleWidth(),NO); } @@ -102,8 +83,6 @@ } } - } -//#endif NSMutableSet<WXComponent *> *dirtyComponents = [NSMutableSet set]; [self _calculateFrameWithSuperAbsolutePosition:CGPointZero gatherDirtyComponents:dirtyComponents]; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm index 8406cfe..37bc5ef 100644 --- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm @@ -468,17 +468,7 @@ typedef enum : NSUInteger { - (CGFloat)collectionView:(UICollectionView *)collectionView contentWidthForLayout:(UICollectionViewLayout *)collectionViewLayout { -//#ifndef USE_FLEX - if(![WXComponent isUseFlex]) - { - return self.scrollerCSSNode->style.dimensions[CSS_WIDTH]; - } -//#else - else - { return self.flexScrollerCSSNode->getStyleWidth(); - } -//#endif } - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout heightForItemAtIndexPath:(NSIndexPath *)indexPath @@ -648,28 +638,12 @@ typedef enum : NSUInteger { - (void)_fillPadding { - UIEdgeInsets padding; -//#ifndef USE_FLEX - if(![WXComponent isUseFlex]) - { - padding = { - WXFloorPixelValue(self.cssNode->style.padding[CSS_TOP] + self.cssNode->style.border[CSS_TOP]), - WXFloorPixelValue(self.cssNode->style.padding[CSS_LEFT] + self.cssNode->style.border[CSS_LEFT]), - WXFloorPixelValue(self.cssNode->style.padding[CSS_BOTTOM] + self.cssNode->style.border[CSS_BOTTOM]), - WXFloorPixelValue(self.cssNode->style.padding[CSS_RIGHT] + self.cssNode->style.border[CSS_RIGHT]) - }; - } -//#else - else - { - padding = { + UIEdgeInsets padding = { WXFloorPixelValue(self.flexCssNode->getPaddingTop() + self.flexCssNode->getBorderWidthTop()), WXFloorPixelValue(self.flexCssNode->getPaddingLeft() + self.flexCssNode->getBorderWidthLeft()), WXFloorPixelValue(self.flexCssNode->getPaddingBottom() + self.flexCssNode->getBorderWidthBottom()), WXFloorPixelValue(self.flexCssNode->getPaddingRight() + self.flexCssNode->getBorderWidthRight()) }; - } -//#endif if (!UIEdgeInsetsEqualToEdgeInsets(padding, _padding)) { http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.mm index 62a542c..36b82b3 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXCellComponent.mm @@ -131,26 +131,6 @@ - (void)_calculateFrameWithSuperAbsolutePosition:(CGPoint)superAbsolutePosition gatherDirtyComponents:(NSMutableSet<WXComponent *> *)dirtyComponents { - -//#ifndef USE_FLEX - if (![WXComponent isUseFlex]) { - if (self.delegate && (isUndefined(self.cssNode->style.dimensions[CSS_WIDTH]) || _isUseContainerWidth)) { - self.cssNode->style.dimensions[CSS_WIDTH] = [self.delegate containerWidthForLayout:self]; - //TODO: set _isUseContainerWidth to NO if updateStyles have width - _isUseContainerWidth = YES; - } - - if ([self needsLayout]) { - layoutNode(self.cssNode, CSS_UNDEFINED, CSS_UNDEFINED, CSS_DIRECTION_INHERIT); - if ([WXLog logLevel] >= WXLogLevelDebug) { - print_css_node(self.cssNode, (css_print_options_t)(CSS_PRINT_LAYOUT | CSS_PRINT_STYLE | CSS_PRINT_CHILDREN)); - } - } - } - -//#else - else - { if (self.delegate && (flexIsUndefined(self.flexCssNode->getStyleWidth()) || _isUseContainerWidth)) { self.flexCssNode->setStyleWidth([self.delegate containerWidthForLayout:self],NO); _isUseContainerWidth = YES; @@ -165,9 +145,6 @@ } } - } - -//#endif [super _calculateFrameWithSuperAbsolutePosition:superAbsolutePosition gatherDirtyComponents:dirtyComponents]; } @end http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm index db77b46..425ca16 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm @@ -422,17 +422,7 @@ typedef NS_ENUM(NSInteger, Direction) { _offsetXAccuracy = [WXConvert CGFloat:attributes[@"offsetXAccuracy"]]; } _infinite = attributes[@"infinite"] ? [WXConvert BOOL:attributes[@"infinite"]] : YES; -//#ifndef USE_FLEX - if (![WXComponent isUseFlex]) { - self.cssNode->style.flex_direction = CSS_FLEX_DIRECTION_ROW; - } -//#else - else - { - self.flexCssNode->setFlexDirection(WeexCore::kFlexDirectionRow,NO); - } -//#endif - + self.flexCssNode->setFlexDirection(WeexCore::kFlexDirectionRow,NO); } return self; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm index 43e7538..d4f2488 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.mm @@ -481,21 +481,6 @@ WX_EXPORT_METHOD(@selector(setTextFormatter:)) -(void)updatePattern { -//#ifndef USE_FLEX - if (![WXComponent isUseFlex]) { - UIEdgeInsets padding = UIEdgeInsetsMake(self.cssNode->style.padding[CSS_TOP], self.cssNode->style.padding[CSS_LEFT], self.cssNode->style.padding[CSS_BOTTOM], self.cssNode->style.padding[CSS_RIGHT]); - if (!UIEdgeInsetsEqualToEdgeInsets(padding, _padding)) { - [self setPadding:padding]; - } - - UIEdgeInsets border = UIEdgeInsetsMake(self.cssNode->style.border[CSS_TOP], self.cssNode->style.border[CSS_LEFT], self.cssNode->style.border[CSS_BOTTOM], self.cssNode->style.border[CSS_RIGHT]); - if (!UIEdgeInsetsEqualToEdgeInsets(border, _border)) { - [self setBorder:border]; - } - - } -//#else - else{ UIEdgeInsets padding_flex = UIEdgeInsetsMake( self.flexCssNode->getPaddingTop(), self.flexCssNode->getPaddingLeft(), @@ -516,8 +501,6 @@ WX_EXPORT_METHOD(@selector(setTextFormatter:)) if (!UIEdgeInsetsEqualToEdgeInsets(border_flex, _border)) { [self setBorder:border_flex]; } - } -//#endif } - (CGSize (^)(CGSize))measureBlock @@ -526,29 +509,6 @@ WX_EXPORT_METHOD(@selector(setTextFormatter:)) return ^CGSize (CGSize constrainedSize) { CGSize computedSize = [[[NSString alloc] init]sizeWithAttributes:nil]; - -//#ifndef USE_FLEX - if (![WXComponent isUseFlex]) { - //TODO:more elegant way to use max and min constrained size - if (!isnan(weakSelf.cssNode->style.minDimensions[CSS_WIDTH])) { - computedSize.width = MAX(computedSize.width, weakSelf.cssNode->style.minDimensions[CSS_WIDTH]); - } - - if (!isnan(weakSelf.cssNode->style.maxDimensions[CSS_WIDTH])) { - computedSize.width = MIN(computedSize.width, weakSelf.cssNode->style.maxDimensions[CSS_WIDTH]); - } - - if (!isnan(weakSelf.cssNode->style.minDimensions[CSS_HEIGHT])) { - computedSize.height = MAX(computedSize.height, weakSelf.cssNode->style.minDimensions[CSS_HEIGHT]); - } - - if (!isnan(weakSelf.cssNode->style.maxDimensions[CSS_HEIGHT])) { - computedSize.height = MIN(computedSize.height, weakSelf.cssNode->style.maxDimensions[CSS_HEIGHT]); - } - } -//#else - else - { if (!isnan(weakSelf.flexCssNode->getMinWidth())) { computedSize.width = MAX(computedSize.width, weakSelf.flexCssNode->getMinWidth()); } @@ -564,9 +524,6 @@ WX_EXPORT_METHOD(@selector(setTextFormatter:)) if (!isnan(weakSelf.flexCssNode->getMaxHeight())) { computedSize.height = MIN(computedSize.height, weakSelf.flexCssNode->getMaxHeight()); } - } - -//#endif return (CGSize) { WXCeilPixelValue(computedSize.width), WXCeilPixelValue(computedSize.height) http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/WXHeaderComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXHeaderComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXHeaderComponent.mm index 97e4252..642dac7 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXHeaderComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXHeaderComponent.mm @@ -69,25 +69,6 @@ - (void)_calculateFrameWithSuperAbsolutePosition:(CGPoint)superAbsolutePosition gatherDirtyComponents:(NSMutableSet<WXComponent *> *)dirtyComponents { -//#ifndef USE_FLEX - if(![WXComponent isUseFlex]){ - if (self.delegate && (isUndefined(self.cssNode->style.dimensions[CSS_WIDTH]) || _isUseContainerWidth)) { - self.cssNode->style.dimensions[CSS_WIDTH] = [self.delegate headerWidthForLayout:self]; - //TODO: set _isUseContainerWidth to NO if updateStyles have width - _isUseContainerWidth = YES; - } - - if ([self needsLayout]) { - layoutNode(self.cssNode, CSS_UNDEFINED, CSS_UNDEFINED, CSS_DIRECTION_INHERIT); - if ([WXLog logLevel] >= WXLogLevelDebug) { - print_css_node(self.cssNode, (css_print_options_t)(CSS_PRINT_LAYOUT | CSS_PRINT_STYLE | CSS_PRINT_CHILDREN)); - } - } - } - -//#else - else - { if (self.delegate && ( isnan(self.flexCssNode->getStyleWidth()) || _isUseContainerWidth)) { self.flexCssNode->setStyleWidth([self.delegate headerWidthForLayout:self],NO); //TODO: set _isUseContainerWidth to NO if updateStyles have width @@ -100,10 +81,6 @@ renderPageSize.second = self.weexInstance.frame.size.height; self.flexCssNode->calculateLayout(renderPageSize); } - } - - -//#endif [super _calculateFrameWithSuperAbsolutePosition:superAbsolutePosition gatherDirtyComponents:dirtyComponents]; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm index bd4eb64..854aa3a 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXListComponent.mm @@ -351,16 +351,7 @@ - (float)headerWidthForLayout:(WXHeaderComponent *)cell { -//#ifndef USE_FLEX - if(![WXComponent isUseFlex]){ - return self.scrollerCSSNode->style.dimensions[CSS_WIDTH]; - } -//#else - else - { return self.flexScrollerCSSNode->getStyleWidth(); - } -//#endif } - (void)headerDidLayout:(WXHeaderComponent *)header @@ -448,15 +439,7 @@ - (float)containerWidthForLayout:(WXCellComponent *)cell { -//#ifndef USE_FLEX - if (![WXComponent isUseFlex]) { - return self.scrollerCSSNode->style.dimensions[CSS_WIDTH]; - } -//#else - else{ return self.flexScrollerCSSNode->getStyleWidth(); - } -//#endif } - (void)cellDidRemove:(WXCellComponent *)cell http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.mm index bb5024f..388548f 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXLoadingComponent.mm @@ -49,18 +49,7 @@ WXLogError(@""); } } -//#ifndef USE_FLEX - if(![WXComponent isUseFlex]) - { - self.cssNode->style.position_type = CSS_POSITION_ABSOLUTE; - } -//#else - else - { - self.flexCssNode->setStylePositionType(WeexCore::kAbsolute); - } - -//#endif + self.flexCssNode->setStylePositionType(WeexCore::kAbsolute); } return self; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.mm index f940e3a..e53144c 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.mm @@ -52,17 +52,7 @@ WXLogError(@""); } } -//#ifndef USE_FLEX - if (![WXComponent isUseFlex]) { - self.cssNode->style.position_type = CSS_POSITION_ABSOLUTE; - } -//#else - else - { - self.flexCssNode->setStylePositionType(WeexCore::kAbsolute); - } - -//#endif + self.flexCssNode->setStylePositionType(WeexCore::kAbsolute); } return self; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm index b078300..fcf554a 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm @@ -156,23 +156,6 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) _scrollable = attributes[@"scrollable"] ? [WXConvert BOOL:attributes[@"scrollable"]] : YES; _offsetAccuracy = attributes[@"offsetAccuracy"] ? [WXConvert WXPixelType:attributes[@"offsetAccuracy"] scaleFactor:self.weexInstance.pixelScaleFactor] : 0; -//#ifndef USE_FLEX - if(![WXComponent isUseFlex]) - { - _scrollerCSSNode = new_css_node(); - - // let scroller fill the rest space if it is a child component and has no fixed height & width - if (((_scrollDirection == WXScrollDirectionVertical && - isUndefined(self.cssNode->style.dimensions[CSS_HEIGHT])) || - (_scrollDirection == WXScrollDirectionHorizontal && - isUndefined(self.cssNode->style.dimensions[CSS_WIDTH]))) && - self.cssNode->style.flex <= 0.0) { - self.cssNode->style.flex = 1.0; - } - } -//#else - else - { _flexScrollerCSSNode = new WeexCore::WXCoreLayoutNode(); // let scroller fill the rest space if it is a child component and has no fixed height & width if (((_scrollDirection == WXScrollDirectionVertical && @@ -182,8 +165,6 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) self.flexCssNode->getFlex() <= 0.0) { self.flexCssNode->setFlex(1.0); } - } -//#endif id configCenter = [WXSDKEngine handlerForProtocol:@protocol(WXConfigCenterProtocol)]; if ([configCenter respondsToSelector:@selector(configForKey:defaultValue:isDefault:)]) { BOOL shouldNotifiAppearDescendantView = [[configCenter configForKey:@"iOS_weex_ext_config.shouldNotifiAppearDescendantView" defaultValue:@(YES) isDefault:NULL] boolValue]; @@ -265,13 +246,6 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) ((UIScrollView *)_view).delegate = nil; [self.stickyArray removeAllObjects]; [self.listenerArray removeAllObjects]; -//#ifndef USE_FLEX - if (![WXComponent isUseFlex]) { - free(_scrollerCSSNode); - } -//#else - else - { if(_flexScrollerCSSNode){ delete _flexScrollerCSSNode; @@ -279,8 +253,6 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) _flexScrollerCSSNode=nullptr; } - } -//#endif } - (void)updateAttributes:(NSDictionary *)attributes @@ -919,48 +891,6 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) * layout from children to scroller to get scroller's contentSize */ if ([self needsLayout]) { -//#ifndef USE_FLEX - if (![WXComponent isUseFlex]) { - memcpy(_scrollerCSSNode, self.cssNode, sizeof(css_node_t)); - _scrollerCSSNode->children_count = (int)[self childrenCountForScrollerLayout]; - - _scrollerCSSNode->style.position[CSS_LEFT] = 0; - _scrollerCSSNode->style.position[CSS_TOP] = 0; - - if (_scrollDirection == WXScrollDirectionVertical) { - _scrollerCSSNode->style.flex_direction = CSS_FLEX_DIRECTION_COLUMN; - _scrollerCSSNode->style.dimensions[CSS_WIDTH] = _cssNode->layout.dimensions[CSS_WIDTH]; - _scrollerCSSNode->style.dimensions[CSS_HEIGHT] = CSS_UNDEFINED; - } else { - _scrollerCSSNode->style.flex_direction = CSS_FLEX_DIRECTION_ROW; - _scrollerCSSNode->style.dimensions[CSS_HEIGHT] = _cssNode->layout.dimensions[CSS_HEIGHT]; - _scrollerCSSNode->style.dimensions[CSS_WIDTH] = CSS_UNDEFINED; - } - - _scrollerCSSNode->layout.dimensions[CSS_WIDTH] = CSS_UNDEFINED; - _scrollerCSSNode->layout.dimensions[CSS_HEIGHT] = CSS_UNDEFINED; - - layoutNode(_scrollerCSSNode, CSS_UNDEFINED, CSS_UNDEFINED, CSS_DIRECTION_INHERIT); - if ([WXLog logLevel] >= WXLogLevelDebug) { - print_css_node(_scrollerCSSNode, (css_print_options_t)(CSS_PRINT_LAYOUT | CSS_PRINT_STYLE | CSS_PRINT_CHILDREN)); - } - CGSize size = { - WXRoundPixelValue(_scrollerCSSNode->layout.dimensions[CSS_WIDTH]), - WXRoundPixelValue(_scrollerCSSNode->layout.dimensions[CSS_HEIGHT]) - }; - - if (!CGSizeEqualToSize(size, _contentSize)) { - _contentSize = size; - [dirtyComponents addObject:self]; - } - - _scrollerCSSNode->layout.dimensions[CSS_WIDTH] = CSS_UNDEFINED; - _scrollerCSSNode->layout.dimensions[CSS_HEIGHT] = CSS_UNDEFINED; - } - -//#else - else - { _flexScrollerCSSNode->copyStyle(_flexCssNode); _flexScrollerCSSNode->copyMeasureFunc(_flexCssNode); @@ -988,8 +918,6 @@ WX_EXPORT_METHOD(@selector(resetLoadmore)) _contentSize = size; [dirtyComponents addObject:self]; } - } -//#endif } [super _calculateFrameWithSuperAbsolutePosition:superAbsolutePosition gatherDirtyComponents:dirtyComponents]; http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.mm index 86124ff..cce715c 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXSliderNeighborComponent.mm @@ -1448,16 +1448,7 @@ NSComparisonResult sliderNeighorCompareViewDepth(UIView *view1, UIView *view2, W _scrollable = attributes[@"scrollable"] ? [WXConvert BOOL:attributes[@"scrollable"]] : YES; } -//#ifndef USE_FLEX - if (![WXComponent isUseFlex]) { - self.cssNode->style.flex_direction = CSS_FLEX_DIRECTION_ROW; - } -//#else - else - { - self.flexCssNode->setFlexDirection(WeexCore::kFlexDirectionRow,NO); - } -//#endif + self.flexCssNode->setFlexDirection(WeexCore::kFlexDirectionRow,NO); return self; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.mm index 16903a0..c62a680 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXSwitchComponent.mm @@ -67,20 +67,9 @@ if(attributes[@"tintColor"]){ _tintColor = [WXConvert UIColor:attributes[@"tintColor"]]; - } -//#ifndef USE_FLEX - if (![WXComponent isUseFlex]) - { - self.cssNode->style.dimensions[CSS_WIDTH] = 51; - self.cssNode->style.dimensions[CSS_HEIGHT] = 31; } -//#else - else - { - self.flexCssNode->setStyleWidth(51,NO); - self.flexCssNode->setStyleHeight(31); - } -//#endif + self.flexCssNode->setStyleWidth(51,NO); + self.flexCssNode->setStyleHeight(31); } return self; } http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/WXTextAreaComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextAreaComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXTextAreaComponent.mm index bb263c8..30ab79b 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXTextAreaComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXTextAreaComponent.mm @@ -76,31 +76,6 @@ typedef UITextView WXTextAreaView; CGSize computedSize = [[[NSString alloc] init]sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:weakSelf.textView.font.pointSize]}]; computedSize.height = _rows? computedSize.height *weakSelf.rows + (CorrectY + CorrectY/2):0; -//#ifndef USE_FLEX - - if (![WXComponent isUseFlex]) - { - if (!isnan(weakSelf.cssNode->style.minDimensions[CSS_WIDTH])) { - computedSize.width = MAX(computedSize.width, weakSelf.cssNode->style.minDimensions[CSS_WIDTH]); - } - - if (!isnan(weakSelf.cssNode->style.maxDimensions[CSS_WIDTH])) { - computedSize.width = MIN(computedSize.width, weakSelf.cssNode->style.maxDimensions[CSS_WIDTH]); - } - - if (!isnan(weakSelf.cssNode->style.minDimensions[CSS_HEIGHT])) { - computedSize.height = MAX(computedSize.height, weakSelf.cssNode->style.minDimensions[CSS_HEIGHT]); - } - - if (!isnan(weakSelf.cssNode->style.maxDimensions[CSS_HEIGHT])) { - computedSize.height = MIN(computedSize.height, weakSelf.cssNode->style.maxDimensions[CSS_HEIGHT]); - } - } - -//#else - - else - { if (!isnan(weakSelf.flexCssNode->getMinWidth())) { computedSize.width = MAX(computedSize.width, weakSelf.flexCssNode->getMinWidth()); } @@ -116,9 +91,6 @@ typedef UITextView WXTextAreaView; if (!isnan(weakSelf.flexCssNode->getMaxHeight())) { computedSize.height = MIN(computedSize.height, weakSelf.flexCssNode->getMaxHeight()); } - } - -//#endif return (CGSize) { WXCeilPixelValue(computedSize.width), WXCeilPixelValue(computedSize.height) http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9acc1bc4/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm index c951068..13f470a 100644 --- a/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm +++ b/ios/sdk/WeexSDK/Sources/Component/WXTextComponent.mm @@ -278,25 +278,6 @@ do {\ _observerIconfont = YES; } -//#ifndef USE_FLEX - if(![WXComponent isUseFlex]) - { - UIEdgeInsets padding = { - WXFloorPixelValue(self.cssNode->style.padding[CSS_TOP] + self.cssNode->style.border[CSS_TOP]), - WXFloorPixelValue(self.cssNode->style.padding[CSS_LEFT] + self.cssNode->style.border[CSS_LEFT]), - WXFloorPixelValue(self.cssNode->style.padding[CSS_BOTTOM] + self.cssNode->style.border[CSS_BOTTOM]), - WXFloorPixelValue(self.cssNode->style.padding[CSS_RIGHT] + self.cssNode->style.border[CSS_RIGHT]) - }; - - if (!UIEdgeInsetsEqualToEdgeInsets(padding, _padding)) { - _padding = padding; - [self setNeedsRepaint]; - } - } - -//#else - else - { UIEdgeInsets flex_padding = { WXFloorPixelValue(self.flexCssNode->getPaddingTop()+ self.flexCssNode->getBorderWidthTop()), WXFloorPixelValue(self.flexCssNode->getPaddingLeft() + self.flexCssNode->getBorderWidthLeft()), @@ -308,8 +289,6 @@ do {\ _padding = flex_padding; [self setNeedsRepaint]; } - } -//#endif } @@ -410,20 +389,6 @@ do {\ NSTextStorage *textStorage = nil; //TODO:more elegant way to use max and min constrained size -//#ifndef USE_FLEX - if(![WXComponent isUseFlex]) - { - if (!isnan(weakSelf.cssNode->style.minDimensions[CSS_WIDTH])) { - constrainedSize.width = MAX(constrainedSize.width, weakSelf.cssNode->style.minDimensions[CSS_WIDTH]); - } - - if (!isnan(weakSelf.cssNode->style.maxDimensions[CSS_WIDTH])) { - constrainedSize.width = MIN(constrainedSize.width, weakSelf.cssNode->style.maxDimensions[CSS_WIDTH]); - } - } -//#else - else - { if (!isnan(weakSelf.flexCssNode->getMinWidth())) { constrainedSize.width = MAX(constrainedSize.width, weakSelf.flexCssNode->getMinWidth()); } @@ -431,8 +396,6 @@ do {\ if (!isnan(weakSelf.flexCssNode->getMaxWidth())) { constrainedSize.width = MIN(constrainedSize.width, weakSelf.flexCssNode->getMaxWidth()); } - } -//#endif if (![self useCoreText]) { textStorage = [weakSelf textStorageWithWidth:constrainedSize.width]; @@ -442,30 +405,6 @@ do {\ } else { computedSize = [weakSelf calculateTextHeightWithWidth:constrainedSize.width]; } -//#ifndef USE_FLEX - if(![WXComponent isUseFlex]) - { - //TODO:more elegant way to use max and min constrained size - if (!isnan(weakSelf.cssNode->style.minDimensions[CSS_WIDTH])) { - computedSize.width = MAX(computedSize.width, weakSelf.cssNode->style.minDimensions[CSS_WIDTH]); - } - - if (!isnan(weakSelf.cssNode->style.maxDimensions[CSS_WIDTH])) { - computedSize.width = MIN(computedSize.width, weakSelf.cssNode->style.maxDimensions[CSS_WIDTH]); - } - - if (!isnan(weakSelf.cssNode->style.minDimensions[CSS_HEIGHT])) { - computedSize.height = MAX(computedSize.height, weakSelf.cssNode->style.minDimensions[CSS_HEIGHT]); - } - - if (!isnan(weakSelf.cssNode->style.maxDimensions[CSS_HEIGHT])) { - computedSize.height = MIN(computedSize.height, weakSelf.cssNode->style.maxDimensions[CSS_HEIGHT]); - } - } - -//#else - else - { if (!isnan(weakSelf.flexCssNode->getMinWidth())) { computedSize.width = MAX(computedSize.width, weakSelf.flexCssNode->getMinWidth()); } @@ -481,9 +420,6 @@ do {\ if (!isnan(weakSelf.flexCssNode->getMaxHeight())) { computedSize.height = MIN(computedSize.height, weakSelf.flexCssNode->getMaxHeight()); } - } - -//#endif if (textStorage && [WXUtility isBlankString:textStorage.string]) { // if the text value is empty or nil, then set the height is 0. computedSize.height = 0; @@ -562,12 +498,7 @@ do {\ NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new]; // handle text direction style, default ltr - BOOL isRtl = false; - if ([WXComponent isUseFlex]) { - isRtl = [_direction isEqualToString:@"rtl"]; - }else{ - isRtl = _cssNode->layout.direction == CSS_DIRECTION_RTL; - } + BOOL isRtl = [_direction isEqualToString:@"rtl"]; if (isRtl) { if (0 == _textAlign) { //force text right-align if don't specified any align. @@ -650,12 +581,7 @@ do {\ NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new]; // handle text direction style, default ltr - BOOL isRtl = false; - if ([WXComponent isUseFlex]) { - isRtl = [_direction isEqualToString:@"rtl"]; - }else{ - isRtl = _cssNode->layout.direction == CSS_DIRECTION_RTL; - } + BOOL isRtl = [_direction isEqualToString:@"rtl"]; if (isRtl) { if (0 == _textAlign) { //force text right-align if don't specified any align.
