Fix naming convetion:
- "Layout node" is changed to "layout spec". - Update tests. - Update Kittens sample.
@ -187,45 +187,45 @@
|
|||||||
AC3C4A521A1139C100143C57 /* ASCollectionView.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A501A1139C100143C57 /* ASCollectionView.mm */; };
|
AC3C4A521A1139C100143C57 /* ASCollectionView.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC3C4A501A1139C100143C57 /* ASCollectionView.mm */; };
|
||||||
AC3C4A541A113EEC00143C57 /* ASCollectionViewProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = AC3C4A531A113EEC00143C57 /* ASCollectionViewProtocols.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
AC3C4A541A113EEC00143C57 /* ASCollectionViewProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = AC3C4A531A113EEC00143C57 /* ASCollectionViewProtocols.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
AC47D9421B3B891B00AAEE9D /* ASCellNode.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6456071B0A335000CF11B8 /* ASCellNode.m */; };
|
AC47D9421B3B891B00AAEE9D /* ASCellNode.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6456071B0A335000CF11B8 /* ASCellNode.m */; };
|
||||||
AC47D9451B3BB41900AAEE9D /* ASStaticLayoutNodeDimension.h in Headers */ = {isa = PBXBuildFile; fileRef = AC47D9431B3BB41900AAEE9D /* ASStaticLayoutNodeDimension.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
AC47D9451B3BB41900AAEE9D /* ASStaticLayoutSpecDimension.h in Headers */ = {isa = PBXBuildFile; fileRef = AC47D9431B3BB41900AAEE9D /* ASStaticLayoutSpecDimension.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
AC47D9461B3BB41900AAEE9D /* ASStaticLayoutNodeDimension.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC47D9441B3BB41900AAEE9D /* ASStaticLayoutNodeDimension.mm */; };
|
AC47D9461B3BB41900AAEE9D /* ASStaticLayoutSpecDimension.mm in Sources */ = {isa = PBXBuildFile; fileRef = AC47D9441B3BB41900AAEE9D /* ASStaticLayoutSpecDimension.mm */; };
|
||||||
AC6456091B0A335000CF11B8 /* ASCellNode.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6456071B0A335000CF11B8 /* ASCellNode.m */; };
|
AC6456091B0A335000CF11B8 /* ASCellNode.m in Sources */ = {isa = PBXBuildFile; fileRef = AC6456071B0A335000CF11B8 /* ASCellNode.m */; };
|
||||||
ACF6ED1A1B17843500DA7C62 /* ASBackgroundLayoutNode.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED011B17843500DA7C62 /* ASBackgroundLayoutNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
ACF6ED1A1B17843500DA7C62 /* ASBackgroundLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED011B17843500DA7C62 /* ASBackgroundLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
ACF6ED1B1B17843500DA7C62 /* ASBackgroundLayoutNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED021B17843500DA7C62 /* ASBackgroundLayoutNode.mm */; };
|
ACF6ED1B1B17843500DA7C62 /* ASBackgroundLayoutSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED021B17843500DA7C62 /* ASBackgroundLayoutSpec.mm */; };
|
||||||
ACF6ED1C1B17843500DA7C62 /* ASCenterLayoutNode.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED031B17843500DA7C62 /* ASCenterLayoutNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
ACF6ED1C1B17843500DA7C62 /* ASCenterLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED031B17843500DA7C62 /* ASCenterLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
ACF6ED1D1B17843500DA7C62 /* ASCenterLayoutNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED041B17843500DA7C62 /* ASCenterLayoutNode.mm */; };
|
ACF6ED1D1B17843500DA7C62 /* ASCenterLayoutSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED041B17843500DA7C62 /* ASCenterLayoutSpec.mm */; };
|
||||||
ACF6ED201B17843500DA7C62 /* ASDimension.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED071B17843500DA7C62 /* ASDimension.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
ACF6ED201B17843500DA7C62 /* ASDimension.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED071B17843500DA7C62 /* ASDimension.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
ACF6ED211B17843500DA7C62 /* ASDimension.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED081B17843500DA7C62 /* ASDimension.mm */; };
|
ACF6ED211B17843500DA7C62 /* ASDimension.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED081B17843500DA7C62 /* ASDimension.mm */; };
|
||||||
ACF6ED221B17843500DA7C62 /* ASInsetLayoutNode.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED091B17843500DA7C62 /* ASInsetLayoutNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
ACF6ED221B17843500DA7C62 /* ASInsetLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED091B17843500DA7C62 /* ASInsetLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
ACF6ED231B17843500DA7C62 /* ASInsetLayoutNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED0A1B17843500DA7C62 /* ASInsetLayoutNode.mm */; };
|
ACF6ED231B17843500DA7C62 /* ASInsetLayoutSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED0A1B17843500DA7C62 /* ASInsetLayoutSpec.mm */; };
|
||||||
ACF6ED241B17843500DA7C62 /* ASLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED0B1B17843500DA7C62 /* ASLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
ACF6ED241B17843500DA7C62 /* ASLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED0B1B17843500DA7C62 /* ASLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
ACF6ED251B17843500DA7C62 /* ASLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED0C1B17843500DA7C62 /* ASLayout.mm */; };
|
ACF6ED251B17843500DA7C62 /* ASLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED0C1B17843500DA7C62 /* ASLayout.mm */; };
|
||||||
ACF6ED261B17843500DA7C62 /* ASLayoutNode.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED0D1B17843500DA7C62 /* ASLayoutNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
ACF6ED261B17843500DA7C62 /* ASLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED0D1B17843500DA7C62 /* ASLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
ACF6ED271B17843500DA7C62 /* ASLayoutNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED0E1B17843500DA7C62 /* ASLayoutNode.mm */; };
|
ACF6ED271B17843500DA7C62 /* ASLayoutSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED0E1B17843500DA7C62 /* ASLayoutSpec.mm */; };
|
||||||
ACF6ED2A1B17843500DA7C62 /* ASLayoutable.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED111B17843500DA7C62 /* ASLayoutable.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
ACF6ED2A1B17843500DA7C62 /* ASLayoutable.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED111B17843500DA7C62 /* ASLayoutable.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
ACF6ED2B1B17843500DA7C62 /* ASOverlayLayoutNode.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED121B17843500DA7C62 /* ASOverlayLayoutNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
ACF6ED2B1B17843500DA7C62 /* ASOverlayLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED121B17843500DA7C62 /* ASOverlayLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
ACF6ED2C1B17843500DA7C62 /* ASOverlayLayoutNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED131B17843500DA7C62 /* ASOverlayLayoutNode.mm */; };
|
ACF6ED2C1B17843500DA7C62 /* ASOverlayLayoutSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED131B17843500DA7C62 /* ASOverlayLayoutSpec.mm */; };
|
||||||
ACF6ED2D1B17843500DA7C62 /* ASRatioLayoutNode.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED141B17843500DA7C62 /* ASRatioLayoutNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
ACF6ED2D1B17843500DA7C62 /* ASRatioLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED141B17843500DA7C62 /* ASRatioLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
ACF6ED2E1B17843500DA7C62 /* ASRatioLayoutNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED151B17843500DA7C62 /* ASRatioLayoutNode.mm */; };
|
ACF6ED2E1B17843500DA7C62 /* ASRatioLayoutSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED151B17843500DA7C62 /* ASRatioLayoutSpec.mm */; };
|
||||||
ACF6ED2F1B17843500DA7C62 /* ASStackLayoutNode.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED161B17843500DA7C62 /* ASStackLayoutNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
ACF6ED2F1B17843500DA7C62 /* ASStackLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED161B17843500DA7C62 /* ASStackLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
ACF6ED301B17843500DA7C62 /* ASStackLayoutNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED171B17843500DA7C62 /* ASStackLayoutNode.mm */; };
|
ACF6ED301B17843500DA7C62 /* ASStackLayoutSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED171B17843500DA7C62 /* ASStackLayoutSpec.mm */; };
|
||||||
ACF6ED311B17843500DA7C62 /* ASStaticLayoutNode.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED181B17843500DA7C62 /* ASStaticLayoutNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
ACF6ED311B17843500DA7C62 /* ASStaticLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED181B17843500DA7C62 /* ASStaticLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
ACF6ED321B17843500DA7C62 /* ASStaticLayoutNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED191B17843500DA7C62 /* ASStaticLayoutNode.mm */; };
|
ACF6ED321B17843500DA7C62 /* ASStaticLayoutSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED191B17843500DA7C62 /* ASStaticLayoutSpec.mm */; };
|
||||||
ACF6ED4B1B17847A00DA7C62 /* ASInternalHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED431B17847A00DA7C62 /* ASInternalHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
ACF6ED4B1B17847A00DA7C62 /* ASInternalHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED431B17847A00DA7C62 /* ASInternalHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||||
ACF6ED4C1B17847A00DA7C62 /* ASInternalHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED441B17847A00DA7C62 /* ASInternalHelpers.mm */; };
|
ACF6ED4C1B17847A00DA7C62 /* ASInternalHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED441B17847A00DA7C62 /* ASInternalHelpers.mm */; };
|
||||||
ACF6ED4D1B17847A00DA7C62 /* ASLayoutNodeUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED451B17847A00DA7C62 /* ASLayoutNodeUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
ACF6ED4D1B17847A00DA7C62 /* ASLayoutSpecUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED451B17847A00DA7C62 /* ASLayoutSpecUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||||
ACF6ED4E1B17847A00DA7C62 /* ASStackLayoutNodeUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED461B17847A00DA7C62 /* ASStackLayoutNodeUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
ACF6ED4E1B17847A00DA7C62 /* ASStackLayoutSpecUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED461B17847A00DA7C62 /* ASStackLayoutSpecUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||||
ACF6ED4F1B17847A00DA7C62 /* ASStackPositionedLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED471B17847A00DA7C62 /* ASStackPositionedLayout.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
ACF6ED4F1B17847A00DA7C62 /* ASStackPositionedLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED471B17847A00DA7C62 /* ASStackPositionedLayout.h */; settings = {ATTRIBUTES = (Private, ); }; };
|
||||||
ACF6ED501B17847A00DA7C62 /* ASStackPositionedLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED481B17847A00DA7C62 /* ASStackPositionedLayout.mm */; };
|
ACF6ED501B17847A00DA7C62 /* ASStackPositionedLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED481B17847A00DA7C62 /* ASStackPositionedLayout.mm */; };
|
||||||
ACF6ED511B17847A00DA7C62 /* ASStackUnpositionedLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED491B17847A00DA7C62 /* ASStackUnpositionedLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
ACF6ED511B17847A00DA7C62 /* ASStackUnpositionedLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED491B17847A00DA7C62 /* ASStackUnpositionedLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
ACF6ED521B17847A00DA7C62 /* ASStackUnpositionedLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED4A1B17847A00DA7C62 /* ASStackUnpositionedLayout.mm */; };
|
ACF6ED521B17847A00DA7C62 /* ASStackUnpositionedLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED4A1B17847A00DA7C62 /* ASStackUnpositionedLayout.mm */; };
|
||||||
ACF6ED5C1B178DC700DA7C62 /* ASCenterLayoutNodeSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED531B178DC700DA7C62 /* ASCenterLayoutNodeSnapshotTests.mm */; };
|
ACF6ED5C1B178DC700DA7C62 /* ASCenterLayoutSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED531B178DC700DA7C62 /* ASCenterLayoutSpecSnapshotTests.mm */; };
|
||||||
ACF6ED5D1B178DC700DA7C62 /* ASDimensionTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED541B178DC700DA7C62 /* ASDimensionTests.mm */; };
|
ACF6ED5D1B178DC700DA7C62 /* ASDimensionTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED541B178DC700DA7C62 /* ASDimensionTests.mm */; };
|
||||||
ACF6ED5E1B178DC700DA7C62 /* ASInsetLayoutNodeSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED551B178DC700DA7C62 /* ASInsetLayoutNodeSnapshotTests.mm */; };
|
ACF6ED5E1B178DC700DA7C62 /* ASInsetLayoutSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED551B178DC700DA7C62 /* ASInsetLayoutSpecSnapshotTests.mm */; };
|
||||||
ACF6ED601B178DC700DA7C62 /* ASLayoutNodeSnapshotTestsHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED581B178DC700DA7C62 /* ASLayoutNodeSnapshotTestsHelper.m */; };
|
ACF6ED601B178DC700DA7C62 /* ASLayoutSpecSnapshotTestsHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED581B178DC700DA7C62 /* ASLayoutSpecSnapshotTestsHelper.m */; };
|
||||||
ACF6ED611B178DC700DA7C62 /* ASOverlayLayoutNodeSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED591B178DC700DA7C62 /* ASOverlayLayoutNodeSnapshotTests.mm */; };
|
ACF6ED611B178DC700DA7C62 /* ASOverlayLayoutSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED591B178DC700DA7C62 /* ASOverlayLayoutSpecSnapshotTests.mm */; };
|
||||||
ACF6ED621B178DC700DA7C62 /* ASRatioLayoutNodeSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED5A1B178DC700DA7C62 /* ASRatioLayoutNodeSnapshotTests.mm */; };
|
ACF6ED621B178DC700DA7C62 /* ASRatioLayoutSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED5A1B178DC700DA7C62 /* ASRatioLayoutSpecSnapshotTests.mm */; };
|
||||||
ACF6ED631B178DC700DA7C62 /* ASStackLayoutNodeSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED5B1B178DC700DA7C62 /* ASStackLayoutNodeSnapshotTests.mm */; };
|
ACF6ED631B178DC700DA7C62 /* ASStackLayoutSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED5B1B178DC700DA7C62 /* ASStackLayoutSpecSnapshotTests.mm */; };
|
||||||
B31A241E1B0114FD0016AE7A /* AsyncDisplayKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BDC61F51978FEA400E50D21 /* AsyncDisplayKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
B31A241E1B0114FD0016AE7A /* AsyncDisplayKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BDC61F51978FEA400E50D21 /* AsyncDisplayKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
B35061DF1B010EDF0018CF92 /* AsyncDisplayKit-iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = B35061DE1B010EDF0018CF92 /* AsyncDisplayKit-iOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
B35061DF1B010EDF0018CF92 /* AsyncDisplayKit-iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = B35061DE1B010EDF0018CF92 /* AsyncDisplayKit-iOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
B35061F31B010EFD0018CF92 /* ASCellNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 055F1A3A19ABD43F004DAFF1 /* ASCellNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
B35061F31B010EFD0018CF92 /* ASCellNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 055F1A3A19ABD43F004DAFF1 /* ASCellNode.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
@ -522,46 +522,46 @@
|
|||||||
AC3C4A4F1A1139C100143C57 /* ASCollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCollectionView.h; sourceTree = "<group>"; };
|
AC3C4A4F1A1139C100143C57 /* ASCollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCollectionView.h; sourceTree = "<group>"; };
|
||||||
AC3C4A501A1139C100143C57 /* ASCollectionView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASCollectionView.mm; sourceTree = "<group>"; };
|
AC3C4A501A1139C100143C57 /* ASCollectionView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASCollectionView.mm; sourceTree = "<group>"; };
|
||||||
AC3C4A531A113EEC00143C57 /* ASCollectionViewProtocols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCollectionViewProtocols.h; sourceTree = "<group>"; };
|
AC3C4A531A113EEC00143C57 /* ASCollectionViewProtocols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCollectionViewProtocols.h; sourceTree = "<group>"; };
|
||||||
AC47D9431B3BB41900AAEE9D /* ASStaticLayoutNodeDimension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASStaticLayoutNodeDimension.h; path = AsyncDisplayKit/Layout/ASStaticLayoutNodeDimension.h; sourceTree = "<group>"; };
|
AC47D9431B3BB41900AAEE9D /* ASStaticLayoutSpecDimension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASStaticLayoutSpecDimension.h; path = AsyncDisplayKit/Layout/ASStaticLayoutSpecDimension.h; sourceTree = "<group>"; };
|
||||||
AC47D9441B3BB41900AAEE9D /* ASStaticLayoutNodeDimension.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASStaticLayoutNodeDimension.mm; path = AsyncDisplayKit/Layout/ASStaticLayoutNodeDimension.mm; sourceTree = "<group>"; };
|
AC47D9441B3BB41900AAEE9D /* ASStaticLayoutSpecDimension.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASStaticLayoutSpecDimension.mm; path = AsyncDisplayKit/Layout/ASStaticLayoutSpecDimension.mm; sourceTree = "<group>"; };
|
||||||
AC6456071B0A335000CF11B8 /* ASCellNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASCellNode.m; sourceTree = "<group>"; };
|
AC6456071B0A335000CF11B8 /* ASCellNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASCellNode.m; sourceTree = "<group>"; };
|
||||||
ACF6ED011B17843500DA7C62 /* ASBackgroundLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASBackgroundLayoutNode.h; path = AsyncDisplayKit/Layout/ASBackgroundLayoutNode.h; sourceTree = "<group>"; };
|
ACF6ED011B17843500DA7C62 /* ASBackgroundLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASBackgroundLayoutSpec.h; path = AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.h; sourceTree = "<group>"; };
|
||||||
ACF6ED021B17843500DA7C62 /* ASBackgroundLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASBackgroundLayoutNode.mm; path = AsyncDisplayKit/Layout/ASBackgroundLayoutNode.mm; sourceTree = "<group>"; };
|
ACF6ED021B17843500DA7C62 /* ASBackgroundLayoutSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASBackgroundLayoutSpec.mm; path = AsyncDisplayKit/Layout/ASBackgroundLayoutSpec.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED031B17843500DA7C62 /* ASCenterLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASCenterLayoutNode.h; path = AsyncDisplayKit/Layout/ASCenterLayoutNode.h; sourceTree = "<group>"; };
|
ACF6ED031B17843500DA7C62 /* ASCenterLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASCenterLayoutSpec.h; path = AsyncDisplayKit/Layout/ASCenterLayoutSpec.h; sourceTree = "<group>"; };
|
||||||
ACF6ED041B17843500DA7C62 /* ASCenterLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASCenterLayoutNode.mm; path = AsyncDisplayKit/Layout/ASCenterLayoutNode.mm; sourceTree = "<group>"; };
|
ACF6ED041B17843500DA7C62 /* ASCenterLayoutSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASCenterLayoutSpec.mm; path = AsyncDisplayKit/Layout/ASCenterLayoutSpec.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED071B17843500DA7C62 /* ASDimension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASDimension.h; path = AsyncDisplayKit/Layout/ASDimension.h; sourceTree = "<group>"; };
|
ACF6ED071B17843500DA7C62 /* ASDimension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASDimension.h; path = AsyncDisplayKit/Layout/ASDimension.h; sourceTree = "<group>"; };
|
||||||
ACF6ED081B17843500DA7C62 /* ASDimension.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASDimension.mm; path = AsyncDisplayKit/Layout/ASDimension.mm; sourceTree = "<group>"; };
|
ACF6ED081B17843500DA7C62 /* ASDimension.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASDimension.mm; path = AsyncDisplayKit/Layout/ASDimension.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED091B17843500DA7C62 /* ASInsetLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASInsetLayoutNode.h; path = AsyncDisplayKit/Layout/ASInsetLayoutNode.h; sourceTree = "<group>"; };
|
ACF6ED091B17843500DA7C62 /* ASInsetLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASInsetLayoutSpec.h; path = AsyncDisplayKit/Layout/ASInsetLayoutSpec.h; sourceTree = "<group>"; };
|
||||||
ACF6ED0A1B17843500DA7C62 /* ASInsetLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASInsetLayoutNode.mm; path = AsyncDisplayKit/Layout/ASInsetLayoutNode.mm; sourceTree = "<group>"; };
|
ACF6ED0A1B17843500DA7C62 /* ASInsetLayoutSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASInsetLayoutSpec.mm; path = AsyncDisplayKit/Layout/ASInsetLayoutSpec.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED0B1B17843500DA7C62 /* ASLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayout.h; path = AsyncDisplayKit/Layout/ASLayout.h; sourceTree = "<group>"; };
|
ACF6ED0B1B17843500DA7C62 /* ASLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayout.h; path = AsyncDisplayKit/Layout/ASLayout.h; sourceTree = "<group>"; };
|
||||||
ACF6ED0C1B17843500DA7C62 /* ASLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASLayout.mm; path = AsyncDisplayKit/Layout/ASLayout.mm; sourceTree = "<group>"; };
|
ACF6ED0C1B17843500DA7C62 /* ASLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASLayout.mm; path = AsyncDisplayKit/Layout/ASLayout.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED0D1B17843500DA7C62 /* ASLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayoutNode.h; path = AsyncDisplayKit/Layout/ASLayoutNode.h; sourceTree = "<group>"; };
|
ACF6ED0D1B17843500DA7C62 /* ASLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayoutSpec.h; path = AsyncDisplayKit/Layout/ASLayoutSpec.h; sourceTree = "<group>"; };
|
||||||
ACF6ED0E1B17843500DA7C62 /* ASLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASLayoutNode.mm; path = AsyncDisplayKit/Layout/ASLayoutNode.mm; sourceTree = "<group>"; };
|
ACF6ED0E1B17843500DA7C62 /* ASLayoutSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASLayoutSpec.mm; path = AsyncDisplayKit/Layout/ASLayoutSpec.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED111B17843500DA7C62 /* ASLayoutable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayoutable.h; path = AsyncDisplayKit/Layout/ASLayoutable.h; sourceTree = "<group>"; };
|
ACF6ED111B17843500DA7C62 /* ASLayoutable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayoutable.h; path = AsyncDisplayKit/Layout/ASLayoutable.h; sourceTree = "<group>"; };
|
||||||
ACF6ED121B17843500DA7C62 /* ASOverlayLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASOverlayLayoutNode.h; path = AsyncDisplayKit/Layout/ASOverlayLayoutNode.h; sourceTree = "<group>"; };
|
ACF6ED121B17843500DA7C62 /* ASOverlayLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASOverlayLayoutSpec.h; path = AsyncDisplayKit/Layout/ASOverlayLayoutSpec.h; sourceTree = "<group>"; };
|
||||||
ACF6ED131B17843500DA7C62 /* ASOverlayLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASOverlayLayoutNode.mm; path = AsyncDisplayKit/Layout/ASOverlayLayoutNode.mm; sourceTree = "<group>"; };
|
ACF6ED131B17843500DA7C62 /* ASOverlayLayoutSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASOverlayLayoutSpec.mm; path = AsyncDisplayKit/Layout/ASOverlayLayoutSpec.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED141B17843500DA7C62 /* ASRatioLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASRatioLayoutNode.h; path = AsyncDisplayKit/Layout/ASRatioLayoutNode.h; sourceTree = "<group>"; };
|
ACF6ED141B17843500DA7C62 /* ASRatioLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASRatioLayoutSpec.h; path = AsyncDisplayKit/Layout/ASRatioLayoutSpec.h; sourceTree = "<group>"; };
|
||||||
ACF6ED151B17843500DA7C62 /* ASRatioLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASRatioLayoutNode.mm; path = AsyncDisplayKit/Layout/ASRatioLayoutNode.mm; sourceTree = "<group>"; };
|
ACF6ED151B17843500DA7C62 /* ASRatioLayoutSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASRatioLayoutSpec.mm; path = AsyncDisplayKit/Layout/ASRatioLayoutSpec.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED161B17843500DA7C62 /* ASStackLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASStackLayoutNode.h; path = AsyncDisplayKit/Layout/ASStackLayoutNode.h; sourceTree = "<group>"; };
|
ACF6ED161B17843500DA7C62 /* ASStackLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASStackLayoutSpec.h; path = AsyncDisplayKit/Layout/ASStackLayoutSpec.h; sourceTree = "<group>"; };
|
||||||
ACF6ED171B17843500DA7C62 /* ASStackLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASStackLayoutNode.mm; path = AsyncDisplayKit/Layout/ASStackLayoutNode.mm; sourceTree = "<group>"; };
|
ACF6ED171B17843500DA7C62 /* ASStackLayoutSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASStackLayoutSpec.mm; path = AsyncDisplayKit/Layout/ASStackLayoutSpec.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED181B17843500DA7C62 /* ASStaticLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASStaticLayoutNode.h; path = AsyncDisplayKit/Layout/ASStaticLayoutNode.h; sourceTree = "<group>"; };
|
ACF6ED181B17843500DA7C62 /* ASStaticLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASStaticLayoutSpec.h; path = AsyncDisplayKit/Layout/ASStaticLayoutSpec.h; sourceTree = "<group>"; };
|
||||||
ACF6ED191B17843500DA7C62 /* ASStaticLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASStaticLayoutNode.mm; path = AsyncDisplayKit/Layout/ASStaticLayoutNode.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
ACF6ED191B17843500DA7C62 /* ASStaticLayoutSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASStaticLayoutSpec.mm; path = AsyncDisplayKit/Layout/ASStaticLayoutSpec.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||||
ACF6ED431B17847A00DA7C62 /* ASInternalHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASInternalHelpers.h; sourceTree = "<group>"; };
|
ACF6ED431B17847A00DA7C62 /* ASInternalHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASInternalHelpers.h; sourceTree = "<group>"; };
|
||||||
ACF6ED441B17847A00DA7C62 /* ASInternalHelpers.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASInternalHelpers.mm; sourceTree = "<group>"; };
|
ACF6ED441B17847A00DA7C62 /* ASInternalHelpers.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASInternalHelpers.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED451B17847A00DA7C62 /* ASLayoutNodeUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutNodeUtilities.h; sourceTree = "<group>"; };
|
ACF6ED451B17847A00DA7C62 /* ASLayoutSpecUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutSpecUtilities.h; sourceTree = "<group>"; };
|
||||||
ACF6ED461B17847A00DA7C62 /* ASStackLayoutNodeUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackLayoutNodeUtilities.h; sourceTree = "<group>"; };
|
ACF6ED461B17847A00DA7C62 /* ASStackLayoutSpecUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackLayoutSpecUtilities.h; sourceTree = "<group>"; };
|
||||||
ACF6ED471B17847A00DA7C62 /* ASStackPositionedLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackPositionedLayout.h; sourceTree = "<group>"; };
|
ACF6ED471B17847A00DA7C62 /* ASStackPositionedLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackPositionedLayout.h; sourceTree = "<group>"; };
|
||||||
ACF6ED481B17847A00DA7C62 /* ASStackPositionedLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASStackPositionedLayout.mm; sourceTree = "<group>"; };
|
ACF6ED481B17847A00DA7C62 /* ASStackPositionedLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASStackPositionedLayout.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED491B17847A00DA7C62 /* ASStackUnpositionedLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackUnpositionedLayout.h; sourceTree = "<group>"; };
|
ACF6ED491B17847A00DA7C62 /* ASStackUnpositionedLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackUnpositionedLayout.h; sourceTree = "<group>"; };
|
||||||
ACF6ED4A1B17847A00DA7C62 /* ASStackUnpositionedLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ASStackUnpositionedLayout.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
ACF6ED4A1B17847A00DA7C62 /* ASStackUnpositionedLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ASStackUnpositionedLayout.mm; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||||
ACF6ED531B178DC700DA7C62 /* ASCenterLayoutNodeSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASCenterLayoutNodeSnapshotTests.mm; sourceTree = "<group>"; };
|
ACF6ED531B178DC700DA7C62 /* ASCenterLayoutSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASCenterLayoutSpecSnapshotTests.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED541B178DC700DA7C62 /* ASDimensionTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASDimensionTests.mm; sourceTree = "<group>"; };
|
ACF6ED541B178DC700DA7C62 /* ASDimensionTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASDimensionTests.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED551B178DC700DA7C62 /* ASInsetLayoutNodeSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASInsetLayoutNodeSnapshotTests.mm; sourceTree = "<group>"; };
|
ACF6ED551B178DC700DA7C62 /* ASInsetLayoutSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASInsetLayoutSpecSnapshotTests.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED571B178DC700DA7C62 /* ASLayoutNodeSnapshotTestsHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutNodeSnapshotTestsHelper.h; sourceTree = "<group>"; };
|
ACF6ED571B178DC700DA7C62 /* ASLayoutSpecSnapshotTestsHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutSpecSnapshotTestsHelper.h; sourceTree = "<group>"; };
|
||||||
ACF6ED581B178DC700DA7C62 /* ASLayoutNodeSnapshotTestsHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ASLayoutNodeSnapshotTestsHelper.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
|
ACF6ED581B178DC700DA7C62 /* ASLayoutSpecSnapshotTestsHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ASLayoutSpecSnapshotTestsHelper.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
|
||||||
ACF6ED591B178DC700DA7C62 /* ASOverlayLayoutNodeSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASOverlayLayoutNodeSnapshotTests.mm; sourceTree = "<group>"; };
|
ACF6ED591B178DC700DA7C62 /* ASOverlayLayoutSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASOverlayLayoutSpecSnapshotTests.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED5A1B178DC700DA7C62 /* ASRatioLayoutNodeSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASRatioLayoutNodeSnapshotTests.mm; sourceTree = "<group>"; };
|
ACF6ED5A1B178DC700DA7C62 /* ASRatioLayoutSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASRatioLayoutSpecSnapshotTests.mm; sourceTree = "<group>"; };
|
||||||
ACF6ED5B1B178DC700DA7C62 /* ASStackLayoutNodeSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASStackLayoutNodeSnapshotTests.mm; sourceTree = "<group>"; };
|
ACF6ED5B1B178DC700DA7C62 /* ASStackLayoutSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASStackLayoutSpecSnapshotTests.mm; sourceTree = "<group>"; };
|
||||||
B35061DA1B010EDF0018CF92 /* AsyncDisplayKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AsyncDisplayKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
B35061DA1B010EDF0018CF92 /* AsyncDisplayKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AsyncDisplayKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
B35061DD1B010EDF0018CF92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
B35061DD1B010EDF0018CF92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
B35061DE1B010EDF0018CF92 /* AsyncDisplayKit-iOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AsyncDisplayKit-iOS.h"; sourceTree = "<group>"; };
|
B35061DE1B010EDF0018CF92 /* AsyncDisplayKit-iOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AsyncDisplayKit-iOS.h"; sourceTree = "<group>"; };
|
||||||
@ -730,13 +730,13 @@
|
|||||||
056D21501ABCEDA1001107EF /* ASSnapshotTestCase.h */,
|
056D21501ABCEDA1001107EF /* ASSnapshotTestCase.h */,
|
||||||
05EA6FE61AC0966E00E35788 /* ASSnapshotTestCase.mm */,
|
05EA6FE61AC0966E00E35788 /* ASSnapshotTestCase.mm */,
|
||||||
056D21541ABCEF50001107EF /* ASImageNodeSnapshotTests.m */,
|
056D21541ABCEF50001107EF /* ASImageNodeSnapshotTests.m */,
|
||||||
ACF6ED531B178DC700DA7C62 /* ASCenterLayoutNodeSnapshotTests.mm */,
|
ACF6ED531B178DC700DA7C62 /* ASCenterLayoutSpecSnapshotTests.mm */,
|
||||||
ACF6ED551B178DC700DA7C62 /* ASInsetLayoutNodeSnapshotTests.mm */,
|
ACF6ED551B178DC700DA7C62 /* ASInsetLayoutSpecSnapshotTests.mm */,
|
||||||
ACF6ED591B178DC700DA7C62 /* ASOverlayLayoutNodeSnapshotTests.mm */,
|
ACF6ED591B178DC700DA7C62 /* ASOverlayLayoutSpecSnapshotTests.mm */,
|
||||||
ACF6ED5A1B178DC700DA7C62 /* ASRatioLayoutNodeSnapshotTests.mm */,
|
ACF6ED5A1B178DC700DA7C62 /* ASRatioLayoutSpecSnapshotTests.mm */,
|
||||||
ACF6ED5B1B178DC700DA7C62 /* ASStackLayoutNodeSnapshotTests.mm */,
|
ACF6ED5B1B178DC700DA7C62 /* ASStackLayoutSpecSnapshotTests.mm */,
|
||||||
ACF6ED571B178DC700DA7C62 /* ASLayoutNodeSnapshotTestsHelper.h */,
|
ACF6ED571B178DC700DA7C62 /* ASLayoutSpecSnapshotTestsHelper.h */,
|
||||||
ACF6ED581B178DC700DA7C62 /* ASLayoutNodeSnapshotTestsHelper.m */,
|
ACF6ED581B178DC700DA7C62 /* ASLayoutSpecSnapshotTestsHelper.m */,
|
||||||
242995D21B29743C00090100 /* ASBasicImageDownloaderTests.m */,
|
242995D21B29743C00090100 /* ASBasicImageDownloaderTests.m */,
|
||||||
29CDC2E11AAE70D000833CA4 /* ASBasicImageDownloaderContextTests.m */,
|
29CDC2E11AAE70D000833CA4 /* ASBasicImageDownloaderContextTests.m */,
|
||||||
296A0A341A951ABF005ACEAA /* ASBatchFetchingTests.m */,
|
296A0A341A951ABF005ACEAA /* ASBatchFetchingTests.m */,
|
||||||
@ -871,8 +871,8 @@
|
|||||||
058D0A11195D050800B7D73C /* ASSentinel.m */,
|
058D0A11195D050800B7D73C /* ASSentinel.m */,
|
||||||
ACF6ED431B17847A00DA7C62 /* ASInternalHelpers.h */,
|
ACF6ED431B17847A00DA7C62 /* ASInternalHelpers.h */,
|
||||||
ACF6ED441B17847A00DA7C62 /* ASInternalHelpers.mm */,
|
ACF6ED441B17847A00DA7C62 /* ASInternalHelpers.mm */,
|
||||||
ACF6ED451B17847A00DA7C62 /* ASLayoutNodeUtilities.h */,
|
ACF6ED451B17847A00DA7C62 /* ASLayoutSpecUtilities.h */,
|
||||||
ACF6ED461B17847A00DA7C62 /* ASStackLayoutNodeUtilities.h */,
|
ACF6ED461B17847A00DA7C62 /* ASStackLayoutSpecUtilities.h */,
|
||||||
ACF6ED471B17847A00DA7C62 /* ASStackPositionedLayout.h */,
|
ACF6ED471B17847A00DA7C62 /* ASStackPositionedLayout.h */,
|
||||||
ACF6ED481B17847A00DA7C62 /* ASStackPositionedLayout.mm */,
|
ACF6ED481B17847A00DA7C62 /* ASStackPositionedLayout.mm */,
|
||||||
ACF6ED491B17847A00DA7C62 /* ASStackUnpositionedLayout.h */,
|
ACF6ED491B17847A00DA7C62 /* ASStackUnpositionedLayout.h */,
|
||||||
@ -897,30 +897,30 @@
|
|||||||
AC6456051B0A333200CF11B8 /* Layout */ = {
|
AC6456051B0A333200CF11B8 /* Layout */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
ACF6ED011B17843500DA7C62 /* ASBackgroundLayoutNode.h */,
|
ACF6ED011B17843500DA7C62 /* ASBackgroundLayoutSpec.h */,
|
||||||
ACF6ED021B17843500DA7C62 /* ASBackgroundLayoutNode.mm */,
|
ACF6ED021B17843500DA7C62 /* ASBackgroundLayoutSpec.mm */,
|
||||||
ACF6ED031B17843500DA7C62 /* ASCenterLayoutNode.h */,
|
ACF6ED031B17843500DA7C62 /* ASCenterLayoutSpec.h */,
|
||||||
ACF6ED041B17843500DA7C62 /* ASCenterLayoutNode.mm */,
|
ACF6ED041B17843500DA7C62 /* ASCenterLayoutSpec.mm */,
|
||||||
ACF6ED071B17843500DA7C62 /* ASDimension.h */,
|
ACF6ED071B17843500DA7C62 /* ASDimension.h */,
|
||||||
ACF6ED081B17843500DA7C62 /* ASDimension.mm */,
|
ACF6ED081B17843500DA7C62 /* ASDimension.mm */,
|
||||||
ACF6ED091B17843500DA7C62 /* ASInsetLayoutNode.h */,
|
ACF6ED091B17843500DA7C62 /* ASInsetLayoutSpec.h */,
|
||||||
ACF6ED0A1B17843500DA7C62 /* ASInsetLayoutNode.mm */,
|
ACF6ED0A1B17843500DA7C62 /* ASInsetLayoutSpec.mm */,
|
||||||
ACF6ED0B1B17843500DA7C62 /* ASLayout.h */,
|
ACF6ED0B1B17843500DA7C62 /* ASLayout.h */,
|
||||||
ACF6ED0C1B17843500DA7C62 /* ASLayout.mm */,
|
ACF6ED0C1B17843500DA7C62 /* ASLayout.mm */,
|
||||||
ACF6ED111B17843500DA7C62 /* ASLayoutable.h */,
|
ACF6ED111B17843500DA7C62 /* ASLayoutable.h */,
|
||||||
ACF6ED0D1B17843500DA7C62 /* ASLayoutNode.h */,
|
ACF6ED0D1B17843500DA7C62 /* ASLayoutSpec.h */,
|
||||||
ACF6ED0E1B17843500DA7C62 /* ASLayoutNode.mm */,
|
ACF6ED0E1B17843500DA7C62 /* ASLayoutSpec.mm */,
|
||||||
ACF6ED121B17843500DA7C62 /* ASOverlayLayoutNode.h */,
|
ACF6ED121B17843500DA7C62 /* ASOverlayLayoutSpec.h */,
|
||||||
ACF6ED131B17843500DA7C62 /* ASOverlayLayoutNode.mm */,
|
ACF6ED131B17843500DA7C62 /* ASOverlayLayoutSpec.mm */,
|
||||||
ACF6ED141B17843500DA7C62 /* ASRatioLayoutNode.h */,
|
ACF6ED141B17843500DA7C62 /* ASRatioLayoutSpec.h */,
|
||||||
ACF6ED151B17843500DA7C62 /* ASRatioLayoutNode.mm */,
|
ACF6ED151B17843500DA7C62 /* ASRatioLayoutSpec.mm */,
|
||||||
AC21EC0F1B3D0BF600C8B19A /* ASStackLayoutChild.h */,
|
AC21EC0F1B3D0BF600C8B19A /* ASStackLayoutChild.h */,
|
||||||
ACF6ED161B17843500DA7C62 /* ASStackLayoutNode.h */,
|
ACF6ED161B17843500DA7C62 /* ASStackLayoutSpec.h */,
|
||||||
ACF6ED171B17843500DA7C62 /* ASStackLayoutNode.mm */,
|
ACF6ED171B17843500DA7C62 /* ASStackLayoutSpec.mm */,
|
||||||
ACF6ED181B17843500DA7C62 /* ASStaticLayoutNode.h */,
|
ACF6ED181B17843500DA7C62 /* ASStaticLayoutSpec.h */,
|
||||||
ACF6ED191B17843500DA7C62 /* ASStaticLayoutNode.mm */,
|
ACF6ED191B17843500DA7C62 /* ASStaticLayoutSpec.mm */,
|
||||||
AC47D9431B3BB41900AAEE9D /* ASStaticLayoutNodeDimension.h */,
|
AC47D9431B3BB41900AAEE9D /* ASStaticLayoutSpecDimension.h */,
|
||||||
AC47D9441B3BB41900AAEE9D /* ASStaticLayoutNodeDimension.mm */,
|
AC47D9441B3BB41900AAEE9D /* ASStaticLayoutSpecDimension.mm */,
|
||||||
);
|
);
|
||||||
name = Layout;
|
name = Layout;
|
||||||
path = ..;
|
path = ..;
|
||||||
@ -961,19 +961,19 @@
|
|||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
AC21EC101B3D0BF600C8B19A /* ASStackLayoutChild.h in Headers */,
|
AC21EC101B3D0BF600C8B19A /* ASStackLayoutChild.h in Headers */,
|
||||||
AC47D9451B3BB41900AAEE9D /* ASStaticLayoutNodeDimension.h in Headers */,
|
AC47D9451B3BB41900AAEE9D /* ASStaticLayoutSpecDimension.h in Headers */,
|
||||||
ACF6ED511B17847A00DA7C62 /* ASStackUnpositionedLayout.h in Headers */,
|
ACF6ED511B17847A00DA7C62 /* ASStackUnpositionedLayout.h in Headers */,
|
||||||
ACF6ED2D1B17843500DA7C62 /* ASRatioLayoutNode.h in Headers */,
|
ACF6ED2D1B17843500DA7C62 /* ASRatioLayoutSpec.h in Headers */,
|
||||||
ACF6ED261B17843500DA7C62 /* ASLayoutNode.h in Headers */,
|
ACF6ED261B17843500DA7C62 /* ASLayoutSpec.h in Headers */,
|
||||||
ACF6ED221B17843500DA7C62 /* ASInsetLayoutNode.h in Headers */,
|
ACF6ED221B17843500DA7C62 /* ASInsetLayoutSpec.h in Headers */,
|
||||||
ACF6ED201B17843500DA7C62 /* ASDimension.h in Headers */,
|
ACF6ED201B17843500DA7C62 /* ASDimension.h in Headers */,
|
||||||
ACF6ED2B1B17843500DA7C62 /* ASOverlayLayoutNode.h in Headers */,
|
ACF6ED2B1B17843500DA7C62 /* ASOverlayLayoutSpec.h in Headers */,
|
||||||
ACF6ED1C1B17843500DA7C62 /* ASCenterLayoutNode.h in Headers */,
|
ACF6ED1C1B17843500DA7C62 /* ASCenterLayoutSpec.h in Headers */,
|
||||||
ACF6ED2A1B17843500DA7C62 /* ASLayoutable.h in Headers */,
|
ACF6ED2A1B17843500DA7C62 /* ASLayoutable.h in Headers */,
|
||||||
ACF6ED311B17843500DA7C62 /* ASStaticLayoutNode.h in Headers */,
|
ACF6ED311B17843500DA7C62 /* ASStaticLayoutSpec.h in Headers */,
|
||||||
ACF6ED241B17843500DA7C62 /* ASLayout.h in Headers */,
|
ACF6ED241B17843500DA7C62 /* ASLayout.h in Headers */,
|
||||||
ACF6ED2F1B17843500DA7C62 /* ASStackLayoutNode.h in Headers */,
|
ACF6ED2F1B17843500DA7C62 /* ASStackLayoutSpec.h in Headers */,
|
||||||
ACF6ED1A1B17843500DA7C62 /* ASBackgroundLayoutNode.h in Headers */,
|
ACF6ED1A1B17843500DA7C62 /* ASBackgroundLayoutSpec.h in Headers */,
|
||||||
291B63FB1AA53A7A000A71B3 /* ASScrollDirection.h in Headers */,
|
291B63FB1AA53A7A000A71B3 /* ASScrollDirection.h in Headers */,
|
||||||
464052221A3F83C40061C0BA /* ASFlowLayoutController.h in Headers */,
|
464052221A3F83C40061C0BA /* ASFlowLayoutController.h in Headers */,
|
||||||
464052241A3F83C40061C0BA /* ASLayoutController.h in Headers */,
|
464052241A3F83C40061C0BA /* ASLayoutController.h in Headers */,
|
||||||
@ -1045,8 +1045,8 @@
|
|||||||
AC3C4A511A1139C100143C57 /* ASCollectionView.h in Headers */,
|
AC3C4A511A1139C100143C57 /* ASCollectionView.h in Headers */,
|
||||||
292C59A01A956527007E5DD6 /* ASRangeHandlerPreload.h in Headers */,
|
292C59A01A956527007E5DD6 /* ASRangeHandlerPreload.h in Headers */,
|
||||||
055B9FA81A1C154B00035D6D /* ASNetworkImageNode.h in Headers */,
|
055B9FA81A1C154B00035D6D /* ASNetworkImageNode.h in Headers */,
|
||||||
ACF6ED4E1B17847A00DA7C62 /* ASStackLayoutNodeUtilities.h in Headers */,
|
ACF6ED4E1B17847A00DA7C62 /* ASStackLayoutSpecUtilities.h in Headers */,
|
||||||
ACF6ED4D1B17847A00DA7C62 /* ASLayoutNodeUtilities.h in Headers */,
|
ACF6ED4D1B17847A00DA7C62 /* ASLayoutSpecUtilities.h in Headers */,
|
||||||
ACF6ED4F1B17847A00DA7C62 /* ASStackPositionedLayout.h in Headers */,
|
ACF6ED4F1B17847A00DA7C62 /* ASStackPositionedLayout.h in Headers */,
|
||||||
054963491A1EA066000F8E56 /* ASBasicImageDownloader.h in Headers */,
|
054963491A1EA066000F8E56 /* ASBasicImageDownloader.h in Headers */,
|
||||||
AC3C4A541A113EEC00143C57 /* ASCollectionViewProtocols.h in Headers */,
|
AC3C4A541A113EEC00143C57 /* ASCollectionViewProtocols.h in Headers */,
|
||||||
@ -1345,10 +1345,10 @@
|
|||||||
058D0A26195D050800B7D73C /* _ASCoreAnimationExtras.mm in Sources */,
|
058D0A26195D050800B7D73C /* _ASCoreAnimationExtras.mm in Sources */,
|
||||||
058D0A23195D050800B7D73C /* _ASAsyncTransactionContainer.m in Sources */,
|
058D0A23195D050800B7D73C /* _ASAsyncTransactionContainer.m in Sources */,
|
||||||
058D0A1E195D050800B7D73C /* ASTextNodeShadower.m in Sources */,
|
058D0A1E195D050800B7D73C /* ASTextNodeShadower.m in Sources */,
|
||||||
ACF6ED2E1B17843500DA7C62 /* ASRatioLayoutNode.mm in Sources */,
|
ACF6ED2E1B17843500DA7C62 /* ASRatioLayoutSpec.mm in Sources */,
|
||||||
058D0A18195D050800B7D73C /* _ASDisplayLayer.mm in Sources */,
|
058D0A18195D050800B7D73C /* _ASDisplayLayer.mm in Sources */,
|
||||||
ACF6ED321B17843500DA7C62 /* ASStaticLayoutNode.mm in Sources */,
|
ACF6ED321B17843500DA7C62 /* ASStaticLayoutSpec.mm in Sources */,
|
||||||
ACF6ED2C1B17843500DA7C62 /* ASOverlayLayoutNode.mm in Sources */,
|
ACF6ED2C1B17843500DA7C62 /* ASOverlayLayoutSpec.mm in Sources */,
|
||||||
058D0A2C195D050800B7D73C /* ASSentinel.m in Sources */,
|
058D0A2C195D050800B7D73C /* ASSentinel.m in Sources */,
|
||||||
205F0E221B376416007741D0 /* CGRect+ASConvenience.m in Sources */,
|
205F0E221B376416007741D0 /* CGRect+ASConvenience.m in Sources */,
|
||||||
205F0E1A1B37339C007741D0 /* ASAbstractLayoutController.mm in Sources */,
|
205F0E1A1B37339C007741D0 /* ASAbstractLayoutController.mm in Sources */,
|
||||||
@ -1357,16 +1357,16 @@
|
|||||||
058D0A15195D050800B7D73C /* ASDisplayNodeExtras.mm in Sources */,
|
058D0A15195D050800B7D73C /* ASDisplayNodeExtras.mm in Sources */,
|
||||||
ACF6ED501B17847A00DA7C62 /* ASStackPositionedLayout.mm in Sources */,
|
ACF6ED501B17847A00DA7C62 /* ASStackPositionedLayout.mm in Sources */,
|
||||||
058D0A1F195D050800B7D73C /* ASTextNodeTextKitHelpers.mm in Sources */,
|
058D0A1F195D050800B7D73C /* ASTextNodeTextKitHelpers.mm in Sources */,
|
||||||
ACF6ED1B1B17843500DA7C62 /* ASBackgroundLayoutNode.mm in Sources */,
|
ACF6ED1B1B17843500DA7C62 /* ASBackgroundLayoutSpec.mm in Sources */,
|
||||||
055F1A3519ABD3E3004DAFF1 /* ASTableView.mm in Sources */,
|
055F1A3519ABD3E3004DAFF1 /* ASTableView.mm in Sources */,
|
||||||
205F0E121B371BD7007741D0 /* ASScrollDirection.m in Sources */,
|
205F0E121B371BD7007741D0 /* ASScrollDirection.m in Sources */,
|
||||||
AC47D9461B3BB41900AAEE9D /* ASStaticLayoutNodeDimension.mm in Sources */,
|
AC47D9461B3BB41900AAEE9D /* ASStaticLayoutSpecDimension.mm in Sources */,
|
||||||
ACF6ED271B17843500DA7C62 /* ASLayoutNode.mm in Sources */,
|
ACF6ED271B17843500DA7C62 /* ASLayoutSpec.mm in Sources */,
|
||||||
ACF6ED211B17843500DA7C62 /* ASDimension.mm in Sources */,
|
ACF6ED211B17843500DA7C62 /* ASDimension.mm in Sources */,
|
||||||
464052261A3F83C40061C0BA /* ASMultidimensionalArrayUtils.mm in Sources */,
|
464052261A3F83C40061C0BA /* ASMultidimensionalArrayUtils.mm in Sources */,
|
||||||
055B9FA91A1C154B00035D6D /* ASNetworkImageNode.mm in Sources */,
|
055B9FA91A1C154B00035D6D /* ASNetworkImageNode.mm in Sources */,
|
||||||
ACF6ED521B17847A00DA7C62 /* ASStackUnpositionedLayout.mm in Sources */,
|
ACF6ED521B17847A00DA7C62 /* ASStackUnpositionedLayout.mm in Sources */,
|
||||||
ACF6ED1D1B17843500DA7C62 /* ASCenterLayoutNode.mm in Sources */,
|
ACF6ED1D1B17843500DA7C62 /* ASCenterLayoutSpec.mm in Sources */,
|
||||||
058D0A1D195D050800B7D73C /* ASTextNodeRenderer.mm in Sources */,
|
058D0A1D195D050800B7D73C /* ASTextNodeRenderer.mm in Sources */,
|
||||||
292C59A41A956527007E5DD6 /* ASRangeHandlerRender.mm in Sources */,
|
292C59A41A956527007E5DD6 /* ASRangeHandlerRender.mm in Sources */,
|
||||||
058D0A2A195D050800B7D73C /* ASDisplayNode+UIViewBridge.mm in Sources */,
|
058D0A2A195D050800B7D73C /* ASDisplayNode+UIViewBridge.mm in Sources */,
|
||||||
@ -1393,14 +1393,14 @@
|
|||||||
05A6D05B19D0EB64002DD95E /* ASDealloc2MainObject.m in Sources */,
|
05A6D05B19D0EB64002DD95E /* ASDealloc2MainObject.m in Sources */,
|
||||||
058D0A17195D050800B7D73C /* ASTextNode.mm in Sources */,
|
058D0A17195D050800B7D73C /* ASTextNode.mm in Sources */,
|
||||||
AC6456091B0A335000CF11B8 /* ASCellNode.m in Sources */,
|
AC6456091B0A335000CF11B8 /* ASCellNode.m in Sources */,
|
||||||
ACF6ED231B17843500DA7C62 /* ASInsetLayoutNode.mm in Sources */,
|
ACF6ED231B17843500DA7C62 /* ASInsetLayoutSpec.mm in Sources */,
|
||||||
058D0A27195D050800B7D73C /* _ASPendingState.m in Sources */,
|
058D0A27195D050800B7D73C /* _ASPendingState.m in Sources */,
|
||||||
0516FA411A1563D200B4EBED /* ASMultiplexImageNode.mm in Sources */,
|
0516FA411A1563D200B4EBED /* ASMultiplexImageNode.mm in Sources */,
|
||||||
058D0A16195D050800B7D73C /* ASImageNode.mm in Sources */,
|
058D0A16195D050800B7D73C /* ASImageNode.mm in Sources */,
|
||||||
058D0A29195D050800B7D73C /* ASDisplayNode+DebugTiming.mm in Sources */,
|
058D0A29195D050800B7D73C /* ASDisplayNode+DebugTiming.mm in Sources */,
|
||||||
205F0E1E1B373A2C007741D0 /* ASCollectionViewLayoutController.mm in Sources */,
|
205F0E1E1B373A2C007741D0 /* ASCollectionViewLayoutController.mm in Sources */,
|
||||||
058D0A22195D050800B7D73C /* _ASAsyncTransaction.m in Sources */,
|
058D0A22195D050800B7D73C /* _ASAsyncTransaction.m in Sources */,
|
||||||
ACF6ED301B17843500DA7C62 /* ASStackLayoutNode.mm in Sources */,
|
ACF6ED301B17843500DA7C62 /* ASStackLayoutSpec.mm in Sources */,
|
||||||
055F1A3919ABD413004DAFF1 /* ASRangeController.mm in Sources */,
|
055F1A3919ABD413004DAFF1 /* ASRangeController.mm in Sources */,
|
||||||
296A0A2F1A9516B2005ACEAA /* ASBatchFetching.m in Sources */,
|
296A0A2F1A9516B2005ACEAA /* ASBatchFetching.m in Sources */,
|
||||||
D785F6631A74327E00291744 /* ASScrollNode.m in Sources */,
|
D785F6631A74327E00291744 /* ASScrollNode.m in Sources */,
|
||||||
@ -1411,8 +1411,8 @@
|
|||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
ACF6ED611B178DC700DA7C62 /* ASOverlayLayoutNodeSnapshotTests.mm in Sources */,
|
ACF6ED611B178DC700DA7C62 /* ASOverlayLayoutSpecSnapshotTests.mm in Sources */,
|
||||||
ACF6ED621B178DC700DA7C62 /* ASRatioLayoutNodeSnapshotTests.mm in Sources */,
|
ACF6ED621B178DC700DA7C62 /* ASRatioLayoutSpecSnapshotTests.mm in Sources */,
|
||||||
2911485C1A77147A005D0878 /* ASControlNodeTests.m in Sources */,
|
2911485C1A77147A005D0878 /* ASControlNodeTests.m in Sources */,
|
||||||
296A0A351A951ABF005ACEAA /* ASBatchFetchingTests.m in Sources */,
|
296A0A351A951ABF005ACEAA /* ASBatchFetchingTests.m in Sources */,
|
||||||
058D0A3E195D057000B7D73C /* ASTextNodeRendererTests.m in Sources */,
|
058D0A3E195D057000B7D73C /* ASTextNodeRendererTests.m in Sources */,
|
||||||
@ -1420,19 +1420,19 @@
|
|||||||
058D0A3C195D057000B7D73C /* ASMutableAttributedStringBuilderTests.m in Sources */,
|
058D0A3C195D057000B7D73C /* ASMutableAttributedStringBuilderTests.m in Sources */,
|
||||||
242995D31B29743C00090100 /* ASBasicImageDownloaderTests.m in Sources */,
|
242995D31B29743C00090100 /* ASBasicImageDownloaderTests.m in Sources */,
|
||||||
058D0A3F195D057000B7D73C /* ASTextNodeShadowerTests.m in Sources */,
|
058D0A3F195D057000B7D73C /* ASTextNodeShadowerTests.m in Sources */,
|
||||||
ACF6ED631B178DC700DA7C62 /* ASStackLayoutNodeSnapshotTests.mm in Sources */,
|
ACF6ED631B178DC700DA7C62 /* ASStackLayoutSpecSnapshotTests.mm in Sources */,
|
||||||
29CDC2E21AAE70D000833CA4 /* ASBasicImageDownloaderContextTests.m in Sources */,
|
29CDC2E21AAE70D000833CA4 /* ASBasicImageDownloaderContextTests.m in Sources */,
|
||||||
056D21551ABCEF50001107EF /* ASImageNodeSnapshotTests.m in Sources */,
|
056D21551ABCEF50001107EF /* ASImageNodeSnapshotTests.m in Sources */,
|
||||||
05EA6FE71AC0966E00E35788 /* ASSnapshotTestCase.mm in Sources */,
|
05EA6FE71AC0966E00E35788 /* ASSnapshotTestCase.mm in Sources */,
|
||||||
ACF6ED5E1B178DC700DA7C62 /* ASInsetLayoutNodeSnapshotTests.mm in Sources */,
|
ACF6ED5E1B178DC700DA7C62 /* ASInsetLayoutSpecSnapshotTests.mm in Sources */,
|
||||||
058D0A3B195D057000B7D73C /* ASDisplayNodeTestsHelper.m in Sources */,
|
058D0A3B195D057000B7D73C /* ASDisplayNodeTestsHelper.m in Sources */,
|
||||||
058D0A3A195D057000B7D73C /* ASDisplayNodeTests.m in Sources */,
|
058D0A3A195D057000B7D73C /* ASDisplayNodeTests.m in Sources */,
|
||||||
ACF6ED601B178DC700DA7C62 /* ASLayoutNodeSnapshotTestsHelper.m in Sources */,
|
ACF6ED601B178DC700DA7C62 /* ASLayoutSpecSnapshotTestsHelper.m in Sources */,
|
||||||
052EE0661A159FEF002C6279 /* ASMultiplexImageNodeTests.m in Sources */,
|
052EE0661A159FEF002C6279 /* ASMultiplexImageNodeTests.m in Sources */,
|
||||||
ACF6ED5D1B178DC700DA7C62 /* ASDimensionTests.mm in Sources */,
|
ACF6ED5D1B178DC700DA7C62 /* ASDimensionTests.mm in Sources */,
|
||||||
058D0A39195D057000B7D73C /* ASDisplayNodeAppearanceTests.m in Sources */,
|
058D0A39195D057000B7D73C /* ASDisplayNodeAppearanceTests.m in Sources */,
|
||||||
058D0A41195D057000B7D73C /* ASTextNodeWordKernerTests.mm in Sources */,
|
058D0A41195D057000B7D73C /* ASTextNodeWordKernerTests.mm in Sources */,
|
||||||
ACF6ED5C1B178DC700DA7C62 /* ASCenterLayoutNodeSnapshotTests.mm in Sources */,
|
ACF6ED5C1B178DC700DA7C62 /* ASCenterLayoutSpecSnapshotTests.mm in Sources */,
|
||||||
058D0A40195D057000B7D73C /* ASTextNodeTests.m in Sources */,
|
058D0A40195D057000B7D73C /* ASTextNodeTests.m in Sources */,
|
||||||
3C9C128519E616EF00E942A0 /* ASTableViewTests.m in Sources */,
|
3C9C128519E616EF00E942A0 /* ASTableViewTests.m in Sources */,
|
||||||
058D0A38195D057000B7D73C /* ASDisplayLayerTests.m in Sources */,
|
058D0A38195D057000B7D73C /* ASDisplayLayerTests.m in Sources */,
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
|
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
|
||||||
#import <AsyncDisplayKit/ASTextNode.h>
|
#import <AsyncDisplayKit/ASTextNode.h>
|
||||||
|
|
||||||
#import "ASInsetLayoutNode.h"
|
#import "ASInsetLayoutSpec.h"
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark ASCellNode
|
#pragma mark ASCellNode
|
||||||
@ -110,7 +110,7 @@ static const CGFloat kFontSize = 18.0f;
|
|||||||
static const CGFloat kHorizontalPadding = 15.0f;
|
static const CGFloat kHorizontalPadding = 15.0f;
|
||||||
static const CGFloat kVerticalPadding = 11.0f;
|
static const CGFloat kVerticalPadding = 11.0f;
|
||||||
UIEdgeInsets insets = UIEdgeInsetsMake(kVerticalPadding, kHorizontalPadding, kVerticalPadding, kHorizontalPadding);
|
UIEdgeInsets insets = UIEdgeInsetsMake(kVerticalPadding, kHorizontalPadding, kVerticalPadding, kHorizontalPadding);
|
||||||
return [ASInsetLayoutNode newWithInsets:insets child:_textNode];
|
return [ASInsetLayoutSpec newWithInsets:insets child:_textNode];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setText:(NSString *)text
|
- (void)setText:(NSString *)text
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#import "ASTextNodeWordKerner.h"
|
#import "ASTextNodeWordKerner.h"
|
||||||
#import "ASThread.h"
|
#import "ASThread.h"
|
||||||
|
|
||||||
#import "ASLayoutNode.h"
|
#import "ASLayoutSpec.h"
|
||||||
|
|
||||||
//! @abstract This subclass exists solely to ensure the text view's panGestureRecognizer never begins, because it's sporadically enabled by UITextView. It will be removed pending rdar://14729288.
|
//! @abstract This subclass exists solely to ensure the text view's panGestureRecognizer never begins, because it's sporadically enabled by UITextView. It will be removed pending rdar://14729288.
|
||||||
@interface _ASDisabledPanUITextView : UITextView
|
@interface _ASDisabledPanUITextView : UITextView
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#import "ASTextNodeRenderer.h"
|
#import "ASTextNodeRenderer.h"
|
||||||
#import "ASTextNodeShadower.h"
|
#import "ASTextNodeShadower.h"
|
||||||
|
|
||||||
#import "ASLayoutNode.h"
|
#import "ASLayoutSpec.h"
|
||||||
|
|
||||||
static const NSTimeInterval ASTextNodeHighlightFadeOutDuration = 0.15;
|
static const NSTimeInterval ASTextNodeHighlightFadeOutDuration = 0.15;
|
||||||
static const NSTimeInterval ASTextNodeHighlightFadeInDuration = 0.1;
|
static const NSTimeInterval ASTextNodeHighlightFadeInDuration = 0.1;
|
||||||
|
@ -28,12 +28,12 @@
|
|||||||
#import <AsyncDisplayKit/ASLayout.h>
|
#import <AsyncDisplayKit/ASLayout.h>
|
||||||
#import <AsyncDisplayKit/ASDimension.h>
|
#import <AsyncDisplayKit/ASDimension.h>
|
||||||
#import <AsyncDisplayKit/ASLayoutable.h>
|
#import <AsyncDisplayKit/ASLayoutable.h>
|
||||||
#import <AsyncDisplayKit/ASLayoutNode.h>
|
#import <AsyncDisplayKit/ASLayoutSpec.h>
|
||||||
#import <AsyncDisplayKit/ASBackgroundLayoutNode.h>
|
#import <AsyncDisplayKit/ASBackgroundLayoutSpec.h>
|
||||||
#import <AsyncDisplayKit/ASCenterLayoutNode.h>
|
#import <AsyncDisplayKit/ASCenterLayoutSpec.h>
|
||||||
#import <AsyncDisplayKit/ASInsetLayoutNode.h>
|
#import <AsyncDisplayKit/ASInsetLayoutSpec.h>
|
||||||
#import <AsyncDisplayKit/ASOverlayLayoutNode.h>
|
#import <AsyncDisplayKit/ASOverlayLayoutSpec.h>
|
||||||
#import <AsyncDisplayKit/ASRatioLayoutNode.h>
|
#import <AsyncDisplayKit/ASRatioLayoutSpec.h>
|
||||||
#import <AsyncDisplayKit/ASStaticLayoutNode.h>
|
#import <AsyncDisplayKit/ASStaticLayoutSpec.h>
|
||||||
#import <AsyncDisplayKit/ASStackLayoutChild.h>
|
#import <AsyncDisplayKit/ASStackLayoutChild.h>
|
||||||
#import <AsyncDisplayKit/ASStackLayoutNode.h>
|
#import <AsyncDisplayKit/ASStackLayoutSpec.h>
|
||||||
|
@ -8,15 +8,15 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <AsyncDisplayKit/ASLayoutNode.h>
|
#import <AsyncDisplayKit/ASLayoutSpec.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Lays out a single child node, then lays out a background node behind it stretched to its size.
|
Lays out a single layoutable child, then lays out a background layoutable instance behind it stretched to its size.
|
||||||
*/
|
*/
|
||||||
@interface ASBackgroundLayoutNode : ASLayoutNode
|
@interface ASBackgroundLayoutSpec : ASLayoutSpec
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@param child A child that is laid out to determine the size of this node. If this is nil, then this method
|
@param child A child that is laid out to determine the size of this spec. If this is nil, then this method
|
||||||
returns nil.
|
returns nil.
|
||||||
@param background A layoutable object that is laid out behind the child. May be nil, in which case the background is omitted.
|
@param background A layoutable object that is laid out behind the child. May be nil, in which case the background is omitted.
|
||||||
*/
|
*/
|
@ -8,29 +8,29 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASBackgroundLayoutNode.h"
|
#import "ASBackgroundLayoutSpec.h"
|
||||||
|
|
||||||
#import "ASAssert.h"
|
#import "ASAssert.h"
|
||||||
#import "ASBaseDefines.h"
|
#import "ASBaseDefines.h"
|
||||||
|
|
||||||
@interface ASBackgroundLayoutNode ()
|
@interface ASBackgroundLayoutSpec ()
|
||||||
{
|
{
|
||||||
id<ASLayoutable> _child;
|
id<ASLayoutable> _child;
|
||||||
id<ASLayoutable> _background;
|
id<ASLayoutable> _background;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation ASBackgroundLayoutNode
|
@implementation ASBackgroundLayoutSpec
|
||||||
|
|
||||||
+ (instancetype)newWithChild:(id<ASLayoutable>)child background:(id<ASLayoutable>)background
|
+ (instancetype)newWithChild:(id<ASLayoutable>)child background:(id<ASLayoutable>)background
|
||||||
{
|
{
|
||||||
if (child == nil) {
|
if (child == nil) {
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
ASBackgroundLayoutNode *n = [super new];
|
ASBackgroundLayoutSpec *spec = [super new];
|
||||||
n->_child = child;
|
spec->_child = child;
|
||||||
n->_background = background;
|
spec->_background = background;
|
||||||
return n;
|
return spec;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)new
|
+ (instancetype)new
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the BSD-style license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#import <AsyncDisplayKit/ASLayoutNode.h>
|
|
||||||
|
|
||||||
typedef NS_OPTIONS(NSUInteger, ASCenterLayoutNodeCenteringOptions) {
|
|
||||||
/** The child is positioned in {0,0} relatively to the layout bounds */
|
|
||||||
ASCenterLayoutNodeCenteringNone = 0,
|
|
||||||
/** The child is centered along the X axis */
|
|
||||||
ASCenterLayoutNodeCenteringX = 1 << 0,
|
|
||||||
/** The child is centered along the Y axis */
|
|
||||||
ASCenterLayoutNodeCenteringY = 1 << 1,
|
|
||||||
/** Convenience option to center both along the X and Y axis */
|
|
||||||
ASCenterLayoutNodeCenteringXY = ASCenterLayoutNodeCenteringX | ASCenterLayoutNodeCenteringY
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef NS_OPTIONS(NSUInteger, ASCenterLayoutNodeSizingOptions) {
|
|
||||||
/** The node will take up the maximum size possible */
|
|
||||||
ASCenterLayoutNodeSizingOptionDefault,
|
|
||||||
/** The node will take up the minimum size possible along the X axis */
|
|
||||||
ASCenterLayoutNodeSizingOptionMinimumX = 1 << 0,
|
|
||||||
/** The node will take up the minimum size possible along the Y axis */
|
|
||||||
ASCenterLayoutNodeSizingOptionMinimumY = 1 << 1,
|
|
||||||
/** Convenience option to take up the minimum size along both the X and Y axis */
|
|
||||||
ASCenterLayoutNodeSizingOptionMinimumXY = ASCenterLayoutNodeSizingOptionMinimumX | ASCenterLayoutNodeSizingOptionMinimumY,
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Lays out a single child layout node and position it so that it is centered into the layout bounds. */
|
|
||||||
@interface ASCenterLayoutNode : ASLayoutNode
|
|
||||||
|
|
||||||
/**
|
|
||||||
@param centeringOptions, see ASCenterLayoutNodeCenteringOptions.
|
|
||||||
@param child The child to center.
|
|
||||||
*/
|
|
||||||
+ (instancetype)newWithCenteringOptions:(ASCenterLayoutNodeCenteringOptions)centeringOptions
|
|
||||||
sizingOptions:(ASCenterLayoutNodeSizingOptions)sizingOptions
|
|
||||||
child:(id<ASLayoutable>)child;
|
|
||||||
|
|
||||||
@end
|
|
46
AsyncDisplayKit/Layout/ASCenterLayoutSpec.h
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the BSD-style license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <AsyncDisplayKit/ASLayoutSpec.h>
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, ASCenterLayoutSpecCenteringOptions) {
|
||||||
|
/** The child is positioned in {0,0} relatively to the layout bounds */
|
||||||
|
ASCenterLayoutSpecCenteringNone = 0,
|
||||||
|
/** The child is centered along the X axis */
|
||||||
|
ASCenterLayoutSpecCenteringX = 1 << 0,
|
||||||
|
/** The child is centered along the Y axis */
|
||||||
|
ASCenterLayoutSpecCenteringY = 1 << 1,
|
||||||
|
/** Convenience option to center both along the X and Y axis */
|
||||||
|
ASCenterLayoutSpecCenteringXY = ASCenterLayoutSpecCenteringX | ASCenterLayoutSpecCenteringY
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef NS_OPTIONS(NSUInteger, ASCenterLayoutSpecSizingOptions) {
|
||||||
|
/** The spec will take up the maximum size possible */
|
||||||
|
ASCenterLayoutSpecSizingOptionDefault,
|
||||||
|
/** The spec will take up the minimum size possible along the X axis */
|
||||||
|
ASCenterLayoutSpecSizingOptionMinimumX = 1 << 0,
|
||||||
|
/** The spec will take up the minimum size possible along the Y axis */
|
||||||
|
ASCenterLayoutSpecSizingOptionMinimumY = 1 << 1,
|
||||||
|
/** Convenience option to take up the minimum size along both the X and Y axis */
|
||||||
|
ASCenterLayoutSpecSizingOptionMinimumXY = ASCenterLayoutSpecSizingOptionMinimumX | ASCenterLayoutSpecSizingOptionMinimumY,
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Lays out a single layoutable child and position it so that it is centered into the layout bounds. */
|
||||||
|
@interface ASCenterLayoutSpec : ASLayoutSpec
|
||||||
|
|
||||||
|
/**
|
||||||
|
@param centeringOptions, see ASCenterLayoutSpecCenteringOptions.
|
||||||
|
@param child The child to center.
|
||||||
|
*/
|
||||||
|
+ (instancetype)newWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions
|
||||||
|
sizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions
|
||||||
|
child:(id<ASLayoutable>)child;
|
||||||
|
|
||||||
|
@end
|
@ -8,28 +8,28 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASCenterLayoutNode.h"
|
#import "ASCenterLayoutSpec.h"
|
||||||
|
|
||||||
#import "ASInternalHelpers.h"
|
#import "ASInternalHelpers.h"
|
||||||
|
|
||||||
@implementation ASCenterLayoutNode
|
@implementation ASCenterLayoutSpec
|
||||||
{
|
{
|
||||||
ASCenterLayoutNodeCenteringOptions _centeringOptions;
|
ASCenterLayoutSpecCenteringOptions _centeringOptions;
|
||||||
ASCenterLayoutNodeSizingOptions _sizingOptions;
|
ASCenterLayoutSpecSizingOptions _sizingOptions;
|
||||||
id<ASLayoutable> _child;
|
id<ASLayoutable> _child;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)newWithCenteringOptions:(ASCenterLayoutNodeCenteringOptions)centeringOptions
|
+ (instancetype)newWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions
|
||||||
sizingOptions:(ASCenterLayoutNodeSizingOptions)sizingOptions
|
sizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions
|
||||||
child:(id<ASLayoutable>)child
|
child:(id<ASLayoutable>)child
|
||||||
{
|
{
|
||||||
ASCenterLayoutNode *n = [super new];
|
ASCenterLayoutSpec *spec = [super new];
|
||||||
if (n) {
|
if (spec) {
|
||||||
n->_centeringOptions = centeringOptions;
|
spec->_centeringOptions = centeringOptions;
|
||||||
n->_sizingOptions = sizingOptions;
|
spec->_sizingOptions = sizingOptions;
|
||||||
n->_child = child;
|
spec->_child = child;
|
||||||
}
|
}
|
||||||
return n;
|
return spec;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)new
|
+ (instancetype)new
|
||||||
@ -46,8 +46,8 @@
|
|||||||
|
|
||||||
// Layout the child
|
// Layout the child
|
||||||
const CGSize minChildSize = {
|
const CGSize minChildSize = {
|
||||||
(_centeringOptions & ASCenterLayoutNodeCenteringX) != 0 ? 0 : constrainedSize.min.width,
|
(_centeringOptions & ASCenterLayoutSpecCenteringX) != 0 ? 0 : constrainedSize.min.width,
|
||||||
(_centeringOptions & ASCenterLayoutNodeCenteringY) != 0 ? 0 : constrainedSize.min.height,
|
(_centeringOptions & ASCenterLayoutSpecCenteringY) != 0 ? 0 : constrainedSize.min.height,
|
||||||
};
|
};
|
||||||
ASLayout *childLayout = [_child calculateLayoutThatFits:ASSizeRangeMake(minChildSize, constrainedSize.max)];
|
ASLayout *childLayout = [_child calculateLayoutThatFits:ASSizeRangeMake(minChildSize, constrainedSize.max)];
|
||||||
|
|
||||||
@ -60,13 +60,13 @@
|
|||||||
|
|
||||||
// If minimum size options are set, attempt to shrink the size to the size of the child
|
// If minimum size options are set, attempt to shrink the size to the size of the child
|
||||||
size = ASSizeRangeClamp(constrainedSize, {
|
size = ASSizeRangeClamp(constrainedSize, {
|
||||||
MIN(size.width, (_sizingOptions & ASCenterLayoutNodeSizingOptionMinimumX) != 0 ? childLayout.size.width : size.width),
|
MIN(size.width, (_sizingOptions & ASCenterLayoutSpecSizingOptionMinimumX) != 0 ? childLayout.size.width : size.width),
|
||||||
MIN(size.height, (_sizingOptions & ASCenterLayoutNodeSizingOptionMinimumY) != 0 ? childLayout.size.height : size.height)
|
MIN(size.height, (_sizingOptions & ASCenterLayoutSpecSizingOptionMinimumY) != 0 ? childLayout.size.height : size.height)
|
||||||
});
|
});
|
||||||
|
|
||||||
// Compute the centered postion for the child
|
// Compute the centered postion for the child
|
||||||
BOOL shouldCenterAlongX = (_centeringOptions & ASCenterLayoutNodeCenteringX);
|
BOOL shouldCenterAlongX = (_centeringOptions & ASCenterLayoutSpecCenteringX);
|
||||||
BOOL shouldCenterAlongY = (_centeringOptions & ASCenterLayoutNodeCenteringY);
|
BOOL shouldCenterAlongY = (_centeringOptions & ASCenterLayoutSpecCenteringY);
|
||||||
childLayout.position = {
|
childLayout.position = {
|
||||||
ASRoundPixelValue(shouldCenterAlongX ? (size.width - childLayout.size.width) * 0.5f : 0),
|
ASRoundPixelValue(shouldCenterAlongX ? (size.width - childLayout.size.width) * 0.5f : 0),
|
||||||
ASRoundPixelValue(shouldCenterAlongY ? (size.height - childLayout.size.height) * 0.5f : 0)
|
ASRoundPixelValue(shouldCenterAlongY ? (size.height - childLayout.size.height) * 0.5f : 0)
|
@ -71,6 +71,6 @@ extern ASSizeRange ASSizeRangeIntersect(ASSizeRange sizeRange, ASSizeRange other
|
|||||||
|
|
||||||
extern BOOL ASSizeRangeEqualToSizeRange(ASSizeRange lhs, ASSizeRange rhs);
|
extern BOOL ASSizeRangeEqualToSizeRange(ASSizeRange lhs, ASSizeRange rhs);
|
||||||
|
|
||||||
extern NSString * NSStringFromASSizeRange(ASSizeRange sizeRange);
|
extern NSString *NSStringFromASSizeRange(ASSizeRange sizeRange);
|
||||||
|
|
||||||
ASDISPLAYNODE_EXTERN_C_END
|
ASDISPLAYNODE_EXTERN_C_END
|
||||||
|
@ -8,26 +8,26 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <AsyncDisplayKit/ASLayoutNode.h>
|
#import <AsyncDisplayKit/ASLayoutSpec.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A layout node that wraps another node, applying insets around it.
|
A layout spec that wraps another layoutable child, applying insets around it.
|
||||||
|
|
||||||
If the child node has a size specified as a percentage, the percentage is resolved against this node's parent
|
If the child has a size specified as a percentage, the percentage is resolved against this spec's parent
|
||||||
size **after** applying insets.
|
size **after** applying insets.
|
||||||
|
|
||||||
@example ASOuterLayoutNode contains an ASInsetLayoutNode with an ASInnerLayoutNode. Suppose that:
|
@example ASOuterLayoutSpec contains an ASInsetLayoutSpec with an ASInnerLayoutSpec. Suppose that:
|
||||||
- ASOuterLayoutNode is 200pt wide.
|
- ASOuterLayoutSpec is 200pt wide.
|
||||||
- ASInnerLayoutNode specifies its width as 100%.
|
- ASInnerLayoutSpec specifies its width as 100%.
|
||||||
- The ASInsetLayoutNode has insets of 10pt on every side.
|
- The ASInsetLayoutSpec has insets of 10pt on every side.
|
||||||
ASInnerLayoutNode will have size 180pt, not 200pt, because it receives a parent size that has been adjusted for insets.
|
ASInnerLayoutSpec will have size 180pt, not 200pt, because it receives a parent size that has been adjusted for insets.
|
||||||
|
|
||||||
If you're familiar with CSS: ASInsetLayoutNode's child behaves similarly to "box-sizing: border-box".
|
If you're familiar with CSS: ASInsetLayoutSpec's child behaves similarly to "box-sizing: border-box".
|
||||||
|
|
||||||
An infinite inset is resolved as an inset equal to all remaining space after applying the other insets and child size.
|
An infinite inset is resolved as an inset equal to all remaining space after applying the other insets and child size.
|
||||||
@example An ASInsetLayoutNode with an infinite left inset and 10px for all other edges will position it's child 10px from the right edge.
|
@example An ASInsetLayoutSpec with an infinite left inset and 10px for all other edges will position it's child 10px from the right edge.
|
||||||
*/
|
*/
|
||||||
@interface ASInsetLayoutNode : ASLayoutNode
|
@interface ASInsetLayoutSpec : ASLayoutSpec
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@param insets The amount of space to inset on each side.
|
@param insets The amount of space to inset on each side.
|
@ -8,14 +8,14 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASInsetLayoutNode.h"
|
#import "ASInsetLayoutSpec.h"
|
||||||
|
|
||||||
#import "ASAssert.h"
|
#import "ASAssert.h"
|
||||||
#import "ASBaseDefines.h"
|
#import "ASBaseDefines.h"
|
||||||
|
|
||||||
#import "ASInternalHelpers.h"
|
#import "ASInternalHelpers.h"
|
||||||
|
|
||||||
@interface ASInsetLayoutNode ()
|
@interface ASInsetLayoutSpec ()
|
||||||
{
|
{
|
||||||
UIEdgeInsets _insets;
|
UIEdgeInsets _insets;
|
||||||
id<ASLayoutable> _child;
|
id<ASLayoutable> _child;
|
||||||
@ -40,19 +40,19 @@ static CGFloat centerInset(CGFloat outer, CGFloat inner)
|
|||||||
return ASRoundPixelValue((outer - inner) / 2);
|
return ASRoundPixelValue((outer - inner) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation ASInsetLayoutNode
|
@implementation ASInsetLayoutSpec
|
||||||
|
|
||||||
+ (instancetype)newWithInsets:(UIEdgeInsets)insets child:(id<ASLayoutable>)child
|
+ (instancetype)newWithInsets:(UIEdgeInsets)insets child:(id<ASLayoutable>)child
|
||||||
{
|
{
|
||||||
if (child == nil) {
|
if (child == nil) {
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
ASInsetLayoutNode *n = [super new];
|
ASInsetLayoutSpec *spec = [super new];
|
||||||
if (n) {
|
if (spec) {
|
||||||
n->_insets = insets;
|
spec->_insets = insets;
|
||||||
n->_child = child;
|
spec->_child = child;
|
||||||
}
|
}
|
||||||
return n;
|
return spec;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)new
|
+ (instancetype)new
|
@ -22,7 +22,7 @@ extern BOOL CGPointIsNull(CGPoint point);
|
|||||||
@property (nonatomic, readonly) id<ASLayoutable> layoutableObject;
|
@property (nonatomic, readonly) id<ASLayoutable> layoutableObject;
|
||||||
@property (nonatomic, readonly) CGSize size;
|
@property (nonatomic, readonly) CGSize size;
|
||||||
/**
|
/**
|
||||||
* Position parent (if any). Default to CGPointNull.
|
* Position in parent. Default to CGPointNull.
|
||||||
*
|
*
|
||||||
* @discussion Before being used as a child layout, this property must be set and no longer equal CGPointNull.
|
* @discussion Before being used as a child layout, this property must be set and no longer equal CGPointNull.
|
||||||
*
|
*
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#import "ASLayout.h"
|
#import "ASLayout.h"
|
||||||
#import "ASAssert.h"
|
#import "ASAssert.h"
|
||||||
#import "ASLayoutNodeUtilities.h"
|
#import "ASLayoutSpecUtilities.h"
|
||||||
#import <stack>
|
#import <stack>
|
||||||
|
|
||||||
CGPoint const CGPointNull = {NAN, NAN};
|
CGPoint const CGPointNull = {NAN, NAN};
|
||||||
@ -71,7 +71,7 @@ extern BOOL CGPointIsNull(CGPoint point)
|
|||||||
BOOL visited;
|
BOOL visited;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Stack of Contexts, used to keep track of sub layouts while traversing the calculated layout in a DFS fashion.
|
// Stack of Contexts, used to keep track of sublayouts while traversing this layout in a DFS fashion.
|
||||||
std::stack<Context> stack;
|
std::stack<Context> stack;
|
||||||
stack.push({self, CGPointMake(0, 0), NO});
|
stack.push({self, CGPointMake(0, 0), NO});
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#import <AsyncDisplayKit/ASLayoutable.h>
|
#import <AsyncDisplayKit/ASLayoutable.h>
|
||||||
#import <AsyncDisplayKit/ASLayout.h>
|
#import <AsyncDisplayKit/ASLayout.h>
|
||||||
|
|
||||||
/** A layout node is an immutable object that describes a layout, loosely inspired by React. */
|
/** A layout spec is an immutable object that describes a layout, loosely inspired by React. */
|
||||||
@interface ASLayoutNode : NSObject <ASLayoutable>
|
@interface ASLayoutSpec : NSObject <ASLayoutable>
|
||||||
|
|
||||||
@end
|
@end
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASLayoutNode.h"
|
#import "ASLayoutSpec.h"
|
||||||
|
|
||||||
#import "ASAssert.h"
|
#import "ASAssert.h"
|
||||||
#import "ASBaseDefines.h"
|
#import "ASBaseDefines.h"
|
||||||
@ -16,7 +16,7 @@
|
|||||||
#import "ASInternalHelpers.h"
|
#import "ASInternalHelpers.h"
|
||||||
#import "ASLayout.h"
|
#import "ASLayout.h"
|
||||||
|
|
||||||
@implementation ASLayoutNode
|
@implementation ASLayoutSpec
|
||||||
|
|
||||||
@synthesize spacingBefore = _spacingBefore;
|
@synthesize spacingBefore = _spacingBefore;
|
||||||
@synthesize spacingAfter = _spacingAfter;
|
@synthesize spacingAfter = _spacingAfter;
|
||||||
@ -27,11 +27,11 @@
|
|||||||
|
|
||||||
+ (instancetype)new
|
+ (instancetype)new
|
||||||
{
|
{
|
||||||
ASLayoutNode *n = [super new];
|
ASLayoutSpec *spec = [super new];
|
||||||
if (n) {
|
if (spec) {
|
||||||
n->_flexBasis = ASRelativeDimensionUnconstrained;
|
spec->_flexBasis = ASRelativeDimensionUnconstrained;
|
||||||
}
|
}
|
||||||
return n;
|
return spec;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Layout
|
#pragma mark - Layout
|
@ -8,12 +8,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <AsyncDisplayKit/ASLayoutNode.h>
|
#import <AsyncDisplayKit/ASLayoutSpec.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This node lays out a single layoutable child and then overlays a layoutable object on top of it streched to its size
|
This layout spec lays out a single layoutable child and then overlays a layoutable object on top of it streched to its size
|
||||||
*/
|
*/
|
||||||
@interface ASOverlayLayoutNode : ASLayoutNode
|
@interface ASOverlayLayoutSpec : ASLayoutSpec
|
||||||
|
|
||||||
+ (instancetype)newWithChild:(id<ASLayoutable>)child overlay:(id<ASLayoutable>)overlay;
|
+ (instancetype)newWithChild:(id<ASLayoutable>)child overlay:(id<ASLayoutable>)overlay;
|
||||||
|
|
@ -8,12 +8,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASOverlayLayoutNode.h"
|
#import "ASOverlayLayoutSpec.h"
|
||||||
|
|
||||||
#import "ASAssert.h"
|
#import "ASAssert.h"
|
||||||
#import "ASBaseDefines.h"
|
#import "ASBaseDefines.h"
|
||||||
|
|
||||||
@implementation ASOverlayLayoutNode
|
@implementation ASOverlayLayoutSpec
|
||||||
{
|
{
|
||||||
id<ASLayoutable> _overlay;
|
id<ASLayoutable> _overlay;
|
||||||
id<ASLayoutable> _child;
|
id<ASLayoutable> _child;
|
||||||
@ -21,13 +21,13 @@
|
|||||||
|
|
||||||
+ (instancetype)newWithChild:(id<ASLayoutable>)child overlay:(id<ASLayoutable>)overlay
|
+ (instancetype)newWithChild:(id<ASLayoutable>)child overlay:(id<ASLayoutable>)overlay
|
||||||
{
|
{
|
||||||
ASOverlayLayoutNode *n = [super new];
|
ASOverlayLayoutSpec *spec = [super new];
|
||||||
if (n) {
|
if (spec) {
|
||||||
ASDisplayNodeAssertNotNil(child, @"Child that will be overlayed on shouldn't be nil");
|
ASDisplayNodeAssertNotNil(child, @"Child that will be overlayed on shouldn't be nil");
|
||||||
n->_overlay = overlay;
|
spec->_overlay = overlay;
|
||||||
n->_child = child;
|
spec->_child = child;
|
||||||
}
|
}
|
||||||
return n;
|
return spec;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)new
|
+ (instancetype)new
|
@ -8,20 +8,20 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <AsyncDisplayKit/ASLayoutNode.h>
|
#import <AsyncDisplayKit/ASLayoutSpec.h>
|
||||||
#import <AsyncDisplayKit/ASLayoutable.h>
|
#import <AsyncDisplayKit/ASLayoutable.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Ratio layout node
|
Ratio layout spec
|
||||||
For when the content should respect a certain inherent ratio but can be scaled (think photos or videos)
|
For when the content should respect a certain inherent ratio but can be scaled (think photos or videos)
|
||||||
The ratio passed is the ratio of height / width you expect
|
The ratio passed is the ratio of height / width you expect
|
||||||
|
|
||||||
For a ratio 0.5, the node will have a flat rectangle shape
|
For a ratio 0.5, the spec will have a flat rectangle shape
|
||||||
_ _ _ _
|
_ _ _ _
|
||||||
| |
|
| |
|
||||||
|_ _ _ _|
|
|_ _ _ _|
|
||||||
|
|
||||||
For a ratio 2.0, the node will be twice as tall as it is wide
|
For a ratio 2.0, the spec will be twice as tall as it is wide
|
||||||
_ _
|
_ _
|
||||||
| |
|
| |
|
||||||
| |
|
| |
|
||||||
@ -29,7 +29,7 @@
|
|||||||
|_ _|
|
|_ _|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
@interface ASRatioLayoutNode : ASLayoutNode
|
@interface ASRatioLayoutSpec : ASLayoutSpec
|
||||||
|
|
||||||
+ (instancetype)newWithRatio:(CGFloat)ratio child:(id<ASLayoutable>)child;
|
+ (instancetype)newWithRatio:(CGFloat)ratio child:(id<ASLayoutable>)child;
|
||||||
|
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASRatioLayoutNode.h"
|
#import "ASRatioLayoutSpec.h"
|
||||||
|
|
||||||
#import <algorithm>
|
#import <algorithm>
|
||||||
#import <vector>
|
#import <vector>
|
||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#import "ASInternalHelpers.h"
|
#import "ASInternalHelpers.h"
|
||||||
|
|
||||||
@implementation ASRatioLayoutNode
|
@implementation ASRatioLayoutSpec
|
||||||
{
|
{
|
||||||
CGFloat _ratio;
|
CGFloat _ratio;
|
||||||
id<ASLayoutable> _child;
|
id<ASLayoutable> _child;
|
||||||
@ -31,12 +31,12 @@
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASRatioLayoutNode *n = [super new];
|
ASRatioLayoutSpec *spec = [super new];
|
||||||
if (n) {
|
if (spec) {
|
||||||
n->_ratio = ratio;
|
spec->_ratio = ratio;
|
||||||
n->_child = child;
|
spec->_child = child;
|
||||||
}
|
}
|
||||||
return n;
|
return spec;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)new
|
+ (instancetype)new
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Each child may override their parent stack's cross axis alignment.
|
Each child may override their parent stack's cross axis alignment.
|
||||||
@see ASStackLayoutNodeAlignItems
|
@see ASStackLayoutAlignItems
|
||||||
*/
|
*/
|
||||||
typedef NS_ENUM(NSUInteger, ASStackLayoutAlignSelf) {
|
typedef NS_ENUM(NSUInteger, ASStackLayoutAlignSelf) {
|
||||||
/** Inherit alignment value from containing stack. */
|
/** Inherit alignment value from containing stack. */
|
||||||
|
@ -8,28 +8,28 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <AsyncDisplayKit/ASLayoutNode.h>
|
#import <AsyncDisplayKit/ASLayoutSpec.h>
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, ASStackLayoutDirection) {
|
typedef NS_ENUM(NSUInteger, ASStackLayoutDirection) {
|
||||||
ASStackLayoutDirectionVertical,
|
ASStackLayoutDirectionVertical,
|
||||||
ASStackLayoutDirectionHorizontal,
|
ASStackLayoutDirectionHorizontal,
|
||||||
};
|
};
|
||||||
|
|
||||||
/** If no children are flexible, how should this node justify its children in the available space? */
|
/** If no children are flexible, how should this spec justify its children in the available space? */
|
||||||
typedef NS_ENUM(NSUInteger, ASStackLayoutJustifyContent) {
|
typedef NS_ENUM(NSUInteger, ASStackLayoutJustifyContent) {
|
||||||
/**
|
/**
|
||||||
On overflow, children overflow out of this node's bounds on the right/bottom side.
|
On overflow, children overflow out of this spec's bounds on the right/bottom side.
|
||||||
On underflow, children are left/top-aligned within this node's bounds.
|
On underflow, children are left/top-aligned within this spec's bounds.
|
||||||
*/
|
*/
|
||||||
ASStackLayoutJustifyContentStart,
|
ASStackLayoutJustifyContentStart,
|
||||||
/**
|
/**
|
||||||
On overflow, children are centered and overflow on both sides.
|
On overflow, children are centered and overflow on both sides.
|
||||||
On underflow, children are centered within this node's bounds in the stacking direction.
|
On underflow, children are centered within this spec's bounds in the stacking direction.
|
||||||
*/
|
*/
|
||||||
ASStackLayoutJustifyContentCenter,
|
ASStackLayoutJustifyContentCenter,
|
||||||
/**
|
/**
|
||||||
On overflow, children overflow out of this node's bounds on the left/top side.
|
On overflow, children overflow out of this spec's bounds on the left/top side.
|
||||||
On underflow, children are right/bottom-aligned within this node's bounds.
|
On underflow, children are right/bottom-aligned within this spec's bounds.
|
||||||
*/
|
*/
|
||||||
ASStackLayoutJustifyContentEnd,
|
ASStackLayoutJustifyContentEnd,
|
||||||
};
|
};
|
||||||
@ -54,34 +54,34 @@ typedef struct {
|
|||||||
ASStackLayoutJustifyContent justifyContent;
|
ASStackLayoutJustifyContent justifyContent;
|
||||||
/** Orientation of children along cross axis */
|
/** Orientation of children along cross axis */
|
||||||
ASStackLayoutAlignItems alignItems;
|
ASStackLayoutAlignItems alignItems;
|
||||||
} ASStackLayoutNodeStyle;
|
} ASStackLayoutSpecStyle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A simple layout node that stacks a list of children vertically or horizontally.
|
A simple layout spec that stacks a list of children vertically or horizontally.
|
||||||
|
|
||||||
- All children are initially laid out with the an infinite available size in the stacking direction.
|
- All children are initially laid out with the an infinite available size in the stacking direction.
|
||||||
- In the other direction, this node's constraint is passed.
|
- In the other direction, this spec's constraint is passed.
|
||||||
- The children's sizes are summed in the stacking direction.
|
- The children's sizes are summed in the stacking direction.
|
||||||
- If this sum is less than this node's minimum size in stacking direction, children with flexGrow are flexed.
|
- If this sum is less than this spec's minimum size in stacking direction, children with flexGrow are flexed.
|
||||||
- If it is greater than this node's maximum size in the stacking direction, children with flexShrink are flexed.
|
- If it is greater than this spec's maximum size in the stacking direction, children with flexShrink are flexed.
|
||||||
- If, even after flexing, the sum is still greater than this node's maximum size in the stacking direction,
|
- If, even after flexing, the sum is still greater than this spec's maximum size in the stacking direction,
|
||||||
justifyContent determines how children are laid out.
|
justifyContent determines how children are laid out.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
- Suppose stacking direction is Vertical, min-width=100, max-width=300, min-height=200, max-height=500.
|
- Suppose stacking direction is Vertical, min-width=100, max-width=300, min-height=200, max-height=500.
|
||||||
- All children are laid out with min-width=100, max-width=300, min-height=0, max-height=INFINITY.
|
- All children are laid out with min-width=100, max-width=300, min-height=0, max-height=INFINITY.
|
||||||
- If the sum of the childrens' heights is less than 200, nodes with flexGrow are flexed larger.
|
- If the sum of the childrens' heights is less than 200, children with flexGrow are flexed larger.
|
||||||
- If the sum of the childrens' heights is greater than 500, nodes with flexShrink are flexed smaller.
|
- If the sum of the childrens' heights is greater than 500, children with flexShrink are flexed smaller.
|
||||||
Each node is shrunk by `((sum of heights) - 500)/(number of nodes)`.
|
Each child is shrunk by `((sum of heights) - 500)/(number of flexShrink-able children)`.
|
||||||
- If the sum of the childrens' heights is greater than 500 even after flexShrink-able nodes are flexed,
|
- If the sum of the childrens' heights is greater than 500 even after flexShrink-able children are flexed,
|
||||||
justifyContent determines how children are laid out.
|
justifyContent determines how children are laid out.
|
||||||
*/
|
*/
|
||||||
@interface ASStackLayoutNode : ASLayoutNode
|
@interface ASStackLayoutSpec : ASLayoutSpec
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@param style Specifies how children are laid out.
|
@param style Specifies how children are laid out.
|
||||||
@param children Children to be positioned, each is an object conforms to ASLayoutable protocol.
|
@param children ASLayoutable children to be positioned.
|
||||||
*/
|
*/
|
||||||
+ (instancetype)newWithStyle:(ASStackLayoutNodeStyle)style children:(NSArray *)children;
|
+ (instancetype)newWithStyle:(ASStackLayoutSpecStyle)style children:(NSArray *)children;
|
||||||
|
|
||||||
@end
|
@end
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASStackLayoutNode.h"
|
#import "ASStackLayoutSpec.h"
|
||||||
|
|
||||||
#import <numeric>
|
#import <numeric>
|
||||||
#import <vector>
|
#import <vector>
|
||||||
@ -16,28 +16,28 @@
|
|||||||
#import "ASBaseDefines.h"
|
#import "ASBaseDefines.h"
|
||||||
#import "ASInternalHelpers.h"
|
#import "ASInternalHelpers.h"
|
||||||
|
|
||||||
#import "ASLayoutNodeUtilities.h"
|
#import "ASLayoutSpecUtilities.h"
|
||||||
#import "ASStackLayoutNodeUtilities.h"
|
#import "ASStackLayoutSpecUtilities.h"
|
||||||
#import "ASStackPositionedLayout.h"
|
#import "ASStackPositionedLayout.h"
|
||||||
#import "ASStackUnpositionedLayout.h"
|
#import "ASStackUnpositionedLayout.h"
|
||||||
|
|
||||||
@implementation ASStackLayoutNode
|
@implementation ASStackLayoutSpec
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle _style;
|
ASStackLayoutSpecStyle _style;
|
||||||
std::vector<id<ASLayoutable>> _children;
|
std::vector<id<ASLayoutable>> _children;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)newWithStyle:(ASStackLayoutNodeStyle)style children:(NSArray *)children
|
+ (instancetype)newWithStyle:(ASStackLayoutSpecStyle)style children:(NSArray *)children
|
||||||
{
|
{
|
||||||
ASStackLayoutNode *n = [super new];
|
ASStackLayoutSpec *spec = [super new];
|
||||||
if (n) {
|
if (spec) {
|
||||||
n->_style = style;
|
spec->_style = style;
|
||||||
n->_children = std::vector<id<ASLayoutable>>();
|
spec->_children = std::vector<id<ASLayoutable>>();
|
||||||
for (id<ASLayoutable> child in children) {
|
for (id<ASLayoutable> child in children) {
|
||||||
n->_children.push_back(child);
|
spec->_children.push_back(child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return n;
|
return spec;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)new
|
+ (instancetype)new
|
@ -8,39 +8,38 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <AsyncDisplayKit/ASLayoutNode.h>
|
#import <AsyncDisplayKit/ASLayoutSpec.h>
|
||||||
#import <AsyncDisplayKit/ASStaticLayoutNodeDimension.h>
|
#import <AsyncDisplayKit/ASStaticLayoutSpecDimension.h>
|
||||||
|
|
||||||
@interface ASStaticLayoutNodeChild : NSObject
|
@interface ASStaticLayoutSpecChild : NSObject
|
||||||
|
|
||||||
@property (nonatomic, readonly) CGPoint position;
|
@property (nonatomic, readonly) CGPoint position;
|
||||||
@property (nonatomic, readonly) ASLayoutNode *node;
|
@property (nonatomic, readonly) id<ASLayoutable> layoutableObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
If specified, the node's size is restricted according to this size. Percentages are resolved relative to the
|
If specified, the child's size is restricted according to this size. Percentages are resolved relative to the static layout spec.
|
||||||
static layout node.
|
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readonly) ASRelativeSizeRange size;
|
@property (nonatomic, readonly) ASRelativeSizeRange size;
|
||||||
|
|
||||||
+ (instancetype)newWithPosition:(CGPoint)position node:(ASLayoutNode *)node size:(ASRelativeSizeRange)size;
|
+ (instancetype)newWithPosition:(CGPoint)position layoutableObject:(id<ASLayoutable>)layoutableObject size:(ASRelativeSizeRange)size;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Convenience with default size is Unconstrained in both dimensions, which sets the child's min size to zero
|
Convenience with default size is Unconstrained in both dimensions, which sets the child's min size to zero
|
||||||
and max size to the maximum available space it can consume without overflowing the node's bounds.
|
and max size to the maximum available space it can consume without overflowing the spec's bounds.
|
||||||
*/
|
*/
|
||||||
+ (instancetype)newWithPosition:(CGPoint)position node:(ASLayoutNode *)node;
|
+ (instancetype)newWithPosition:(CGPoint)position layoutableObject:(id<ASLayoutable>)layoutableObject;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A layout node that positions children at fixed positions.
|
A layout spec that positions children at fixed positions.
|
||||||
|
|
||||||
Computes a size that is the union of all childrens' frames.
|
Computes a size that is the union of all childrens' frames.
|
||||||
*/
|
*/
|
||||||
@interface ASStaticLayoutNode : ASLayoutNode
|
@interface ASStaticLayoutSpec : ASLayoutSpec
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@param children Children to be positioned at fixed positions, each is of type ASStaticLayoutNodeChild.
|
@param children Children to be positioned at fixed positions, each is of type ASStaticLayoutSpecChild.
|
||||||
*/
|
*/
|
||||||
+ (instancetype)newWithChildren:(NSArray *)children;
|
+ (instancetype)newWithChildren:(NSArray *)children;
|
||||||
|
|
@ -8,43 +8,43 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASStaticLayoutNode.h"
|
#import "ASStaticLayoutSpec.h"
|
||||||
|
|
||||||
#import "ASLayoutNodeUtilities.h"
|
#import "ASLayoutSpecUtilities.h"
|
||||||
#import "ASInternalHelpers.h"
|
#import "ASInternalHelpers.h"
|
||||||
|
|
||||||
@implementation ASStaticLayoutNodeChild
|
@implementation ASStaticLayoutSpecChild
|
||||||
|
|
||||||
+ (instancetype)newWithPosition:(CGPoint)position node:(ASLayoutNode *)node size:(ASRelativeSizeRange)size
|
+ (instancetype)newWithPosition:(CGPoint)position layoutableObject:(id<ASLayoutable>)layoutableObject size:(ASRelativeSizeRange)size
|
||||||
{
|
{
|
||||||
ASStaticLayoutNodeChild *c = [super new];
|
ASStaticLayoutSpecChild *c = [super new];
|
||||||
if (c) {
|
if (c) {
|
||||||
c->_position = position;
|
c->_position = position;
|
||||||
c->_node = node;
|
c->_layoutableObject = layoutableObject;
|
||||||
c->_size = size;
|
c->_size = size;
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)newWithPosition:(CGPoint)position node:(ASLayoutNode *)node
|
+ (instancetype)newWithPosition:(CGPoint)position layoutableObject:(id<ASLayoutable>)layoutableObject
|
||||||
{
|
{
|
||||||
return [self newWithPosition:position node:node size:ASRelativeSizeRangeUnconstrained];
|
return [self newWithPosition:position layoutableObject:layoutableObject size:ASRelativeSizeRangeUnconstrained];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation ASStaticLayoutNode
|
@implementation ASStaticLayoutSpec
|
||||||
{
|
{
|
||||||
NSArray *_children;
|
NSArray *_children;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)newWithChildren:(NSArray *)children
|
+ (instancetype)newWithChildren:(NSArray *)children
|
||||||
{
|
{
|
||||||
ASStaticLayoutNode *n = [super new];
|
ASStaticLayoutSpec *spec = [super new];
|
||||||
if (n) {
|
if (spec) {
|
||||||
n->_children = children;
|
spec->_children = children;
|
||||||
}
|
}
|
||||||
return n;
|
return spec;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (instancetype)new
|
+ (instancetype)new
|
||||||
@ -60,7 +60,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
NSMutableArray *layoutChildren = [NSMutableArray arrayWithCapacity:_children.count];
|
NSMutableArray *layoutChildren = [NSMutableArray arrayWithCapacity:_children.count];
|
||||||
for (ASStaticLayoutNodeChild *child in _children) {
|
for (ASStaticLayoutSpecChild *child in _children) {
|
||||||
CGSize autoMaxSize = {
|
CGSize autoMaxSize = {
|
||||||
constrainedSize.max.width - child.position.x,
|
constrainedSize.max.width - child.position.x,
|
||||||
constrainedSize.max.height - child.position.y
|
constrainedSize.max.height - child.position.y
|
||||||
@ -68,7 +68,7 @@
|
|||||||
ASSizeRange childConstraint = ASRelativeSizeRangeEqualToRelativeSizeRange(ASRelativeSizeRangeUnconstrained, child.size)
|
ASSizeRange childConstraint = ASRelativeSizeRangeEqualToRelativeSizeRange(ASRelativeSizeRangeUnconstrained, child.size)
|
||||||
? ASSizeRangeMake({0, 0}, autoMaxSize)
|
? ASSizeRangeMake({0, 0}, autoMaxSize)
|
||||||
: ASRelativeSizeRangeResolve(child.size, size);
|
: ASRelativeSizeRangeResolve(child.size, size);
|
||||||
ASLayout *childLayout = [child.node calculateLayoutThatFits:childConstraint];
|
ASLayout *childLayout = [child.layoutableObject calculateLayoutThatFits:childConstraint];
|
||||||
childLayout.position = child.position;
|
childLayout.position = child.position;
|
||||||
[layoutChildren addObject:childLayout];
|
[layoutChildren addObject:childLayout];
|
||||||
}
|
}
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Expresses a size with relative dimensions.
|
Expresses a size with relative dimensions.
|
||||||
Used by ASStaticLayoutNode.
|
Used by ASStaticLayoutSpec.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ASRelativeDimension width;
|
ASRelativeDimension width;
|
||||||
@ -23,7 +23,7 @@ typedef struct {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Expresses an inclusive range of relative sizes. Used to provide additional constraint to layout.
|
Expresses an inclusive range of relative sizes. Used to provide additional constraint to layout.
|
||||||
Used by ASStaticLayoutNode.
|
Used by ASStaticLayoutSpec.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ASRelativeSize min;
|
ASRelativeSize min;
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASStaticLayoutNodeDimension.h"
|
#import "ASStaticLayoutSpecDimension.h"
|
||||||
#import "ASAssert.h"
|
#import "ASAssert.h"
|
||||||
|
|
||||||
ASRelativeSizeRange const ASRelativeSizeRangeUnconstrained = {};
|
ASRelativeSizeRange const ASRelativeSizeRangeUnconstrained = {};
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASStackLayoutNode.h"
|
#import "ASStackLayoutSpec.h"
|
||||||
|
|
||||||
inline CGFloat stackDimension(const ASStackLayoutDirection direction, const CGSize size)
|
inline CGFloat stackDimension(const ASStackLayoutDirection direction, const CGSize size)
|
||||||
{
|
{
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#import "ASLayout.h"
|
#import "ASLayout.h"
|
||||||
#import "ASDimension.h"
|
#import "ASDimension.h"
|
||||||
#import "ASStackLayoutNode.h"
|
#import "ASStackLayoutSpec.h"
|
||||||
#import "ASStackUnpositionedLayout.h"
|
#import "ASStackUnpositionedLayout.h"
|
||||||
|
|
||||||
/** Represents a set of laid out and positioned stack layout children. */
|
/** Represents a set of laid out and positioned stack layout children. */
|
||||||
@ -20,6 +20,6 @@ struct ASStackPositionedLayout {
|
|||||||
|
|
||||||
/** Given an unpositioned layout, computes the positions each child should be placed at. */
|
/** Given an unpositioned layout, computes the positions each child should be placed at. */
|
||||||
static ASStackPositionedLayout compute(const ASStackUnpositionedLayout &unpositionedLayout,
|
static ASStackPositionedLayout compute(const ASStackUnpositionedLayout &unpositionedLayout,
|
||||||
const ASStackLayoutNodeStyle &style,
|
const ASStackLayoutSpecStyle &style,
|
||||||
const ASSizeRange &constrainedSize);
|
const ASSizeRange &constrainedSize);
|
||||||
};
|
};
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
#import "ASStackPositionedLayout.h"
|
#import "ASStackPositionedLayout.h"
|
||||||
|
|
||||||
#import "ASInternalHelpers.h"
|
#import "ASInternalHelpers.h"
|
||||||
#import "ASLayoutNodeUtilities.h"
|
#import "ASLayoutSpecUtilities.h"
|
||||||
#import "ASStackLayoutNodeUtilities.h"
|
#import "ASStackLayoutSpecUtilities.h"
|
||||||
#import "ASLayoutable.h"
|
#import "ASLayoutable.h"
|
||||||
|
|
||||||
static CGFloat crossOffset(const ASStackLayoutNodeStyle &style,
|
static CGFloat crossOffset(const ASStackLayoutSpecStyle &style,
|
||||||
const ASStackUnpositionedItem &l,
|
const ASStackUnpositionedItem &l,
|
||||||
const CGFloat crossSize)
|
const CGFloat crossSize)
|
||||||
{
|
{
|
||||||
@ -30,7 +30,7 @@ static CGFloat crossOffset(const ASStackLayoutNodeStyle &style,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static ASStackPositionedLayout stackedLayout(const ASStackLayoutNodeStyle &style,
|
static ASStackPositionedLayout stackedLayout(const ASStackLayoutSpecStyle &style,
|
||||||
const CGFloat offset,
|
const CGFloat offset,
|
||||||
const ASStackUnpositionedLayout &unpositionedLayout,
|
const ASStackUnpositionedLayout &unpositionedLayout,
|
||||||
const ASSizeRange &constrainedSize)
|
const ASSizeRange &constrainedSize)
|
||||||
@ -61,7 +61,7 @@ static ASStackPositionedLayout stackedLayout(const ASStackLayoutNodeStyle &style
|
|||||||
}
|
}
|
||||||
|
|
||||||
ASStackPositionedLayout ASStackPositionedLayout::compute(const ASStackUnpositionedLayout &unpositionedLayout,
|
ASStackPositionedLayout ASStackPositionedLayout::compute(const ASStackUnpositionedLayout &unpositionedLayout,
|
||||||
const ASStackLayoutNodeStyle &style,
|
const ASStackLayoutSpecStyle &style,
|
||||||
const ASSizeRange &constrainedSize)
|
const ASSizeRange &constrainedSize)
|
||||||
{
|
{
|
||||||
switch (style.justifyContent) {
|
switch (style.justifyContent) {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#import <vector>
|
#import <vector>
|
||||||
|
|
||||||
#import "ASLayout.h"
|
#import "ASLayout.h"
|
||||||
#import "ASStackLayoutNode.h"
|
#import "ASStackLayoutSpec.h"
|
||||||
|
|
||||||
struct ASStackUnpositionedItem {
|
struct ASStackUnpositionedItem {
|
||||||
/** The original source child. */
|
/** The original source child. */
|
||||||
@ -31,6 +31,6 @@ struct ASStackUnpositionedLayout {
|
|||||||
|
|
||||||
/** Given a set of children, computes the unpositioned layouts for those children. */
|
/** Given a set of children, computes the unpositioned layouts for those children. */
|
||||||
static ASStackUnpositionedLayout compute(const std::vector<id<ASLayoutable>> &children,
|
static ASStackUnpositionedLayout compute(const std::vector<id<ASLayoutable>> &children,
|
||||||
const ASStackLayoutNodeStyle &style,
|
const ASStackLayoutSpecStyle &style,
|
||||||
const ASSizeRange &sizeRange);
|
const ASSizeRange &sizeRange);
|
||||||
};
|
};
|
||||||
|
@ -12,14 +12,14 @@
|
|||||||
|
|
||||||
#import <numeric>
|
#import <numeric>
|
||||||
|
|
||||||
#import "ASLayoutNodeUtilities.h"
|
#import "ASLayoutSpecUtilities.h"
|
||||||
#import "ASStackLayoutNodeUtilities.h"
|
#import "ASStackLayoutSpecUtilities.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sizes the child given the parameters specified, and returns the computed layout.
|
Sizes the child given the parameters specified, and returns the computed layout.
|
||||||
*/
|
*/
|
||||||
static ASLayout *crossChildLayout(const id<ASLayoutable> child,
|
static ASLayout *crossChildLayout(const id<ASLayoutable> child,
|
||||||
const ASStackLayoutNodeStyle style,
|
const ASStackLayoutSpecStyle style,
|
||||||
const CGFloat stackMin,
|
const CGFloat stackMin,
|
||||||
const CGFloat stackMax,
|
const CGFloat stackMax,
|
||||||
const CGFloat crossMin,
|
const CGFloat crossMin,
|
||||||
@ -65,7 +65,7 @@ static ASLayout *crossChildLayout(const id<ASLayoutable> child,
|
|||||||
@param style the layout style of the overall stack layout
|
@param style the layout style of the overall stack layout
|
||||||
*/
|
*/
|
||||||
static void stretchChildrenAlongCrossDimension(std::vector<ASStackUnpositionedItem> &layouts,
|
static void stretchChildrenAlongCrossDimension(std::vector<ASStackUnpositionedItem> &layouts,
|
||||||
const ASStackLayoutNodeStyle &style)
|
const ASStackLayoutSpecStyle &style)
|
||||||
{
|
{
|
||||||
// Find the maximum cross dimension size among child layouts
|
// Find the maximum cross dimension size among child layouts
|
||||||
const auto it = std::max_element(layouts.begin(), layouts.end(),
|
const auto it = std::max_element(layouts.begin(), layouts.end(),
|
||||||
@ -82,7 +82,7 @@ static void stretchChildrenAlongCrossDimension(std::vector<ASStackUnpositionedIt
|
|||||||
|
|
||||||
// restretch all stretchable children along the cross axis using the new min. set their max size to childCrossMax,
|
// restretch all stretchable children along the cross axis using the new min. set their max size to childCrossMax,
|
||||||
// not crossMax, so that if any of them would choose a larger size just because the min size increased (weird!)
|
// not crossMax, so that if any of them would choose a larger size just because the min size increased (weird!)
|
||||||
// they are forced to choose the same width as all the other nodes.
|
// they are forced to choose the same width as all the other children.
|
||||||
if (alignItems == ASStackLayoutAlignItemsStretch && fabs(cross - childCrossMax) > 0.01) {
|
if (alignItems == ASStackLayoutAlignItemsStretch && fabs(cross - childCrossMax) > 0.01) {
|
||||||
l.layout = crossChildLayout(l.child, style, stack, stack, childCrossMax, childCrossMax);
|
l.layout = crossChildLayout(l.child, style, stack, stack, childCrossMax, childCrossMax);
|
||||||
}
|
}
|
||||||
@ -100,11 +100,11 @@ static void stretchChildrenAlongCrossDimension(std::vector<ASStackUnpositionedIt
|
|||||||
+-----+ | | +---+
|
+-----+ | | +---+
|
||||||
+-------+
|
+-------+
|
||||||
|
|
||||||
@param children unpositioned layouts for the child nodes of the stack node
|
@param children unpositioned layouts for the children of the stack spec
|
||||||
@param style the layout style of the overall stack layout
|
@param style the layout style of the overall stack layout
|
||||||
*/
|
*/
|
||||||
static CGFloat computeStackDimensionSum(const std::vector<ASStackUnpositionedItem> &children,
|
static CGFloat computeStackDimensionSum(const std::vector<ASStackUnpositionedItem> &children,
|
||||||
const ASStackLayoutNodeStyle &style)
|
const ASStackLayoutSpecStyle &style)
|
||||||
{
|
{
|
||||||
// Sum up the childrens' spacing
|
// Sum up the childrens' spacing
|
||||||
const CGFloat childSpacingSum = std::accumulate(children.begin(), children.end(),
|
const CGFloat childSpacingSum = std::accumulate(children.begin(), children.end(),
|
||||||
@ -125,7 +125,7 @@ static CGFloat computeStackDimensionSum(const std::vector<ASStackUnpositionedIte
|
|||||||
/**
|
/**
|
||||||
Computes the violation by comparing a stack dimension sum with the overall allowable size range for the stack.
|
Computes the violation by comparing a stack dimension sum with the overall allowable size range for the stack.
|
||||||
|
|
||||||
Violation is the distance you would have to add to the unbounded stack-direction length of the stack node's
|
Violation is the distance you would have to add to the unbounded stack-direction length of the stack spec's
|
||||||
children in order to bring the stack within its allowed sizeRange. The diagram below shows 3 horizontal stacks with
|
children in order to bring the stack within its allowed sizeRange. The diagram below shows 3 horizontal stacks with
|
||||||
the different types of violation.
|
the different types of violation.
|
||||||
|
|
||||||
@ -151,10 +151,10 @@ static CGFloat computeStackDimensionSum(const std::vector<ASStackUnpositionedIte
|
|||||||
|
|
||||||
@param stackDimensionSum the consumed length of the children in the stack along the stack dimension
|
@param stackDimensionSum the consumed length of the children in the stack along the stack dimension
|
||||||
@param style layout style to be applied to all children
|
@param style layout style to be applied to all children
|
||||||
@param sizeRange the range of allowable sizes for the stack layout node
|
@param sizeRange the range of allowable sizes for the stack layout spec
|
||||||
*/
|
*/
|
||||||
static CGFloat computeViolation(const CGFloat stackDimensionSum,
|
static CGFloat computeViolation(const CGFloat stackDimensionSum,
|
||||||
const ASStackLayoutNodeStyle &style,
|
const ASStackLayoutSpecStyle &style,
|
||||||
const ASSizeRange &sizeRange)
|
const ASSizeRange &sizeRange)
|
||||||
{
|
{
|
||||||
const CGFloat minStackDimension = stackDimension(style.direction, sizeRange.min);
|
const CGFloat minStackDimension = stackDimension(style.direction, sizeRange.min);
|
||||||
@ -196,7 +196,7 @@ ASDISPLAYNODE_INLINE BOOL isFlexibleInBothDirections(id<ASLayoutable> child)
|
|||||||
number then we may avoid the first "intrinsic" size calculation.
|
number then we may avoid the first "intrinsic" size calculation.
|
||||||
*/
|
*/
|
||||||
ASDISPLAYNODE_INLINE BOOL useOptimizedFlexing(const std::vector<id<ASLayoutable>> &children,
|
ASDISPLAYNODE_INLINE BOOL useOptimizedFlexing(const std::vector<id<ASLayoutable>> &children,
|
||||||
const ASStackLayoutNodeStyle &style,
|
const ASStackLayoutSpecStyle &style,
|
||||||
const ASSizeRange &sizeRange)
|
const ASSizeRange &sizeRange)
|
||||||
{
|
{
|
||||||
const NSUInteger flexibleChildren = std::count_if(children.begin(), children.end(), isFlexibleInBothDirections);
|
const NSUInteger flexibleChildren = std::count_if(children.begin(), children.end(), isFlexibleInBothDirections);
|
||||||
@ -210,7 +210,7 @@ ASDISPLAYNODE_INLINE BOOL useOptimizedFlexing(const std::vector<id<ASLayoutable>
|
|||||||
these children at zero size so that the children layouts are at least present.
|
these children at zero size so that the children layouts are at least present.
|
||||||
*/
|
*/
|
||||||
static void layoutFlexibleChildrenAtZeroSize(std::vector<ASStackUnpositionedItem> &items,
|
static void layoutFlexibleChildrenAtZeroSize(std::vector<ASStackUnpositionedItem> &items,
|
||||||
const ASStackLayoutNodeStyle &style,
|
const ASStackLayoutSpecStyle &style,
|
||||||
const ASSizeRange &sizeRange)
|
const ASSizeRange &sizeRange)
|
||||||
{
|
{
|
||||||
for (ASStackUnpositionedItem &item : items) {
|
for (ASStackUnpositionedItem &item : items) {
|
||||||
@ -235,10 +235,10 @@ static void layoutFlexibleChildrenAtZeroSize(std::vector<ASStackUnpositionedItem
|
|||||||
|
|
||||||
@param items Reference to unpositioned items from the original, unconstrained layout pass; modified in-place
|
@param items Reference to unpositioned items from the original, unconstrained layout pass; modified in-place
|
||||||
@param style layout style to be applied to all children
|
@param style layout style to be applied to all children
|
||||||
@param sizeRange the range of allowable sizes for the stack layout node
|
@param sizeRange the range of allowable sizes for the stack layout spec
|
||||||
*/
|
*/
|
||||||
static void flexChildrenAlongStackDimension(std::vector<ASStackUnpositionedItem> &items,
|
static void flexChildrenAlongStackDimension(std::vector<ASStackUnpositionedItem> &items,
|
||||||
const ASStackLayoutNodeStyle &style,
|
const ASStackLayoutSpecStyle &style,
|
||||||
const ASSizeRange &sizeRange,
|
const ASSizeRange &sizeRange,
|
||||||
const BOOL useOptimizedFlexing)
|
const BOOL useOptimizedFlexing)
|
||||||
{
|
{
|
||||||
@ -284,7 +284,7 @@ static void flexChildrenAlongStackDimension(std::vector<ASStackUnpositionedItem>
|
|||||||
stretched.
|
stretched.
|
||||||
*/
|
*/
|
||||||
static std::vector<ASStackUnpositionedItem> layoutChildrenAlongUnconstrainedStackDimension(const std::vector<id<ASLayoutable>> &children,
|
static std::vector<ASStackUnpositionedItem> layoutChildrenAlongUnconstrainedStackDimension(const std::vector<id<ASLayoutable>> &children,
|
||||||
const ASStackLayoutNodeStyle &style,
|
const ASStackLayoutSpecStyle &style,
|
||||||
const ASSizeRange &sizeRange,
|
const ASSizeRange &sizeRange,
|
||||||
const CGSize size,
|
const CGSize size,
|
||||||
const BOOL useOptimizedFlexing)
|
const BOOL useOptimizedFlexing)
|
||||||
@ -313,7 +313,7 @@ static std::vector<ASStackUnpositionedItem> layoutChildrenAlongUnconstrainedStac
|
|||||||
}
|
}
|
||||||
|
|
||||||
ASStackUnpositionedLayout ASStackUnpositionedLayout::compute(const std::vector<id<ASLayoutable>> &children,
|
ASStackUnpositionedLayout ASStackUnpositionedLayout::compute(const std::vector<id<ASLayoutable>> &children,
|
||||||
const ASStackLayoutNodeStyle &style,
|
const ASStackLayoutSpecStyle &style,
|
||||||
const ASSizeRange &sizeRange)
|
const ASSizeRange &sizeRange)
|
||||||
{
|
{
|
||||||
const CGSize size = {
|
const CGSize size = {
|
||||||
|
@ -8,18 +8,18 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASLayoutNodeSnapshotTestsHelper.h"
|
#import "ASLayoutSpecSnapshotTestsHelper.h"
|
||||||
|
|
||||||
#import "ASBackgroundLayoutNode.h"
|
#import "ASBackgroundLayoutSpec.h"
|
||||||
#import "ASCenterLayoutNode.h"
|
#import "ASCenterLayoutSpec.h"
|
||||||
#import "ASStackLayoutNode.h"
|
#import "ASStackLayoutSpec.h"
|
||||||
|
|
||||||
static const ASSizeRange kSize = {{100, 120}, {320, 160}};
|
static const ASSizeRange kSize = {{100, 120}, {320, 160}};
|
||||||
|
|
||||||
@interface ASCenterLayoutNodeSnapshotTests : ASLayoutNodeSnapshotTestCase
|
@interface ASCenterLayoutSpecSnapshotTests : ASLayoutSpecSnapshotTestCase
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation ASCenterLayoutNodeSnapshotTests
|
@implementation ASCenterLayoutSpecSnapshotTests
|
||||||
|
|
||||||
- (void)setUp
|
- (void)setUp
|
||||||
{
|
{
|
||||||
@ -29,61 +29,60 @@ static const ASSizeRange kSize = {{100, 120}, {320, 160}};
|
|||||||
|
|
||||||
- (void)testWithOptions
|
- (void)testWithOptions
|
||||||
{
|
{
|
||||||
[self testWithCenteringOptions:ASCenterLayoutNodeCenteringNone sizingOptions:{}];
|
[self testWithCenteringOptions:ASCenterLayoutSpecCenteringNone sizingOptions:{}];
|
||||||
[self testWithCenteringOptions:ASCenterLayoutNodeCenteringXY sizingOptions:{}];
|
[self testWithCenteringOptions:ASCenterLayoutSpecCenteringXY sizingOptions:{}];
|
||||||
[self testWithCenteringOptions:ASCenterLayoutNodeCenteringX sizingOptions:{}];
|
[self testWithCenteringOptions:ASCenterLayoutSpecCenteringX sizingOptions:{}];
|
||||||
[self testWithCenteringOptions:ASCenterLayoutNodeCenteringY sizingOptions:{}];
|
[self testWithCenteringOptions:ASCenterLayoutSpecCenteringY sizingOptions:{}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testWithSizingOptions
|
- (void)testWithSizingOptions
|
||||||
{
|
{
|
||||||
[self testWithCenteringOptions:ASCenterLayoutNodeCenteringNone sizingOptions:ASCenterLayoutNodeSizingOptionDefault];
|
[self testWithCenteringOptions:ASCenterLayoutSpecCenteringNone sizingOptions:ASCenterLayoutSpecSizingOptionDefault];
|
||||||
[self testWithCenteringOptions:ASCenterLayoutNodeCenteringNone sizingOptions:ASCenterLayoutNodeSizingOptionMinimumX];
|
[self testWithCenteringOptions:ASCenterLayoutSpecCenteringNone sizingOptions:ASCenterLayoutSpecSizingOptionMinimumX];
|
||||||
[self testWithCenteringOptions:ASCenterLayoutNodeCenteringNone sizingOptions:ASCenterLayoutNodeSizingOptionMinimumY];
|
[self testWithCenteringOptions:ASCenterLayoutSpecCenteringNone sizingOptions:ASCenterLayoutSpecSizingOptionMinimumY];
|
||||||
[self testWithCenteringOptions:ASCenterLayoutNodeCenteringNone sizingOptions:ASCenterLayoutNodeSizingOptionMinimumXY];
|
[self testWithCenteringOptions:ASCenterLayoutSpecCenteringNone sizingOptions:ASCenterLayoutSpecSizingOptionMinimumXY];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testWithCenteringOptions:(ASCenterLayoutNodeCenteringOptions)options
|
- (void)testWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)options
|
||||||
sizingOptions:(ASCenterLayoutNodeSizingOptions)sizingOptions
|
sizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions
|
||||||
{
|
{
|
||||||
ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor redColor]);
|
ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor redColor]);
|
||||||
ASStaticSizeDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]);
|
ASStaticSizeDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]);
|
||||||
foregroundNode.staticSize = {70, 100};
|
foregroundNode.staticSize = {70, 100};
|
||||||
|
|
||||||
|
ASLayoutSpec *layoutSpec =
|
||||||
ASLayoutNode *layoutNode =
|
[ASBackgroundLayoutSpec
|
||||||
[ASBackgroundLayoutNode
|
|
||||||
newWithChild:
|
newWithChild:
|
||||||
[ASCenterLayoutNode
|
[ASCenterLayoutSpec
|
||||||
newWithCenteringOptions:options
|
newWithCenteringOptions:options
|
||||||
sizingOptions:sizingOptions
|
sizingOptions:sizingOptions
|
||||||
child:foregroundNode]
|
child:foregroundNode]
|
||||||
background:backgroundNode];
|
background:backgroundNode];
|
||||||
|
|
||||||
[self testLayoutNode:layoutNode
|
[self testLayoutSpec:layoutSpec
|
||||||
sizeRange:kSize
|
sizeRange:kSize
|
||||||
subnodes:@[backgroundNode, foregroundNode]
|
subnodes:@[backgroundNode, foregroundNode]
|
||||||
identifier:suffixForCenteringOptions(options, sizingOptions)];
|
identifier:suffixForCenteringOptions(options, sizingOptions)];
|
||||||
}
|
}
|
||||||
|
|
||||||
static NSString *suffixForCenteringOptions(ASCenterLayoutNodeCenteringOptions centeringOptions,
|
static NSString *suffixForCenteringOptions(ASCenterLayoutSpecCenteringOptions centeringOptions,
|
||||||
ASCenterLayoutNodeSizingOptions sizingOptinos)
|
ASCenterLayoutSpecSizingOptions sizingOptinos)
|
||||||
{
|
{
|
||||||
NSMutableString *suffix = [NSMutableString string];
|
NSMutableString *suffix = [NSMutableString string];
|
||||||
|
|
||||||
if ((centeringOptions & ASCenterLayoutNodeCenteringX) != 0) {
|
if ((centeringOptions & ASCenterLayoutSpecCenteringX) != 0) {
|
||||||
[suffix appendString:@"CenteringX"];
|
[suffix appendString:@"CenteringX"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((centeringOptions & ASCenterLayoutNodeCenteringY) != 0) {
|
if ((centeringOptions & ASCenterLayoutSpecCenteringY) != 0) {
|
||||||
[suffix appendString:@"CenteringY"];
|
[suffix appendString:@"CenteringY"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sizingOptinos & ASCenterLayoutNodeSizingOptionMinimumX) != 0) {
|
if ((sizingOptinos & ASCenterLayoutSpecSizingOptionMinimumX) != 0) {
|
||||||
[suffix appendString:@"SizingMinimumX"];
|
[suffix appendString:@"SizingMinimumX"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sizingOptinos & ASCenterLayoutNodeSizingOptionMinimumY) != 0) {
|
if ((sizingOptinos & ASCenterLayoutSpecSizingOptionMinimumY) != 0) {
|
||||||
[suffix appendString:@"SizingMinimumY"];
|
[suffix appendString:@"SizingMinimumY"];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,16 +96,16 @@ static NSString *suffixForCenteringOptions(ASCenterLayoutNodeCenteringOptions ce
|
|||||||
foregroundNode.staticSize = {10, 10};
|
foregroundNode.staticSize = {10, 10};
|
||||||
foregroundNode.flexGrow = YES;
|
foregroundNode.flexGrow = YES;
|
||||||
|
|
||||||
ASCenterLayoutNode *layoutNode =
|
ASCenterLayoutSpec *layoutSpec =
|
||||||
[ASCenterLayoutNode
|
[ASCenterLayoutSpec
|
||||||
newWithCenteringOptions:ASCenterLayoutNodeCenteringNone
|
newWithCenteringOptions:ASCenterLayoutSpecCenteringNone
|
||||||
sizingOptions:{}
|
sizingOptions:{}
|
||||||
child:
|
child:
|
||||||
[ASBackgroundLayoutNode
|
[ASBackgroundLayoutSpec
|
||||||
newWithChild:[ASStackLayoutNode newWithStyle:{} children:@[foregroundNode]]
|
newWithChild:[ASStackLayoutSpec newWithStyle:{} children:@[foregroundNode]]
|
||||||
background:backgroundNode]];
|
background:backgroundNode]];
|
||||||
|
|
||||||
[self testLayoutNode:layoutNode sizeRange:kSize subnodes:@[backgroundNode, foregroundNode] identifier:nil];
|
[self testLayoutSpec:layoutSpec sizeRange:kSize subnodes:@[backgroundNode, foregroundNode] identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
@ -8,21 +8,21 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASLayoutNodeSnapshotTestsHelper.h"
|
#import "ASLayoutSpecSnapshotTestsHelper.h"
|
||||||
|
|
||||||
#import "ASBackgroundLayoutNode.h"
|
#import "ASBackgroundLayoutSpec.h"
|
||||||
#import "ASInsetLayoutNode.h"
|
#import "ASInsetLayoutSpec.h"
|
||||||
#import "ASStaticLayoutNode.h"
|
#import "ASStaticLayoutSpec.h"
|
||||||
|
|
||||||
|
|
||||||
typedef NS_OPTIONS(NSUInteger, ASInsetLayoutNodeTestEdge) {
|
typedef NS_OPTIONS(NSUInteger, ASInsetLayoutSpecTestEdge) {
|
||||||
ASInsetLayoutNodeTestEdgeTop = 1 << 0,
|
ASInsetLayoutSpecTestEdgeTop = 1 << 0,
|
||||||
ASInsetLayoutNodeTestEdgeLeft = 1 << 1,
|
ASInsetLayoutSpecTestEdgeLeft = 1 << 1,
|
||||||
ASInsetLayoutNodeTestEdgeBottom = 1 << 2,
|
ASInsetLayoutSpecTestEdgeBottom = 1 << 2,
|
||||||
ASInsetLayoutNodeTestEdgeRight = 1 << 3,
|
ASInsetLayoutSpecTestEdgeRight = 1 << 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
static CGFloat insetForEdge(NSUInteger combination, ASInsetLayoutNodeTestEdge edge, CGFloat insetValue)
|
static CGFloat insetForEdge(NSUInteger combination, ASInsetLayoutSpecTestEdge edge, CGFloat insetValue)
|
||||||
{
|
{
|
||||||
return combination & edge ? INFINITY : insetValue;
|
return combination & edge ? INFINITY : insetValue;
|
||||||
}
|
}
|
||||||
@ -30,10 +30,10 @@ static CGFloat insetForEdge(NSUInteger combination, ASInsetLayoutNodeTestEdge ed
|
|||||||
static UIEdgeInsets insetsForCombination(NSUInteger combination, CGFloat insetValue)
|
static UIEdgeInsets insetsForCombination(NSUInteger combination, CGFloat insetValue)
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
.top = insetForEdge(combination, ASInsetLayoutNodeTestEdgeTop, insetValue),
|
.top = insetForEdge(combination, ASInsetLayoutSpecTestEdgeTop, insetValue),
|
||||||
.left = insetForEdge(combination, ASInsetLayoutNodeTestEdgeLeft, insetValue),
|
.left = insetForEdge(combination, ASInsetLayoutSpecTestEdgeLeft, insetValue),
|
||||||
.bottom = insetForEdge(combination, ASInsetLayoutNodeTestEdgeBottom, insetValue),
|
.bottom = insetForEdge(combination, ASInsetLayoutSpecTestEdgeBottom, insetValue),
|
||||||
.right = insetForEdge(combination, ASInsetLayoutNodeTestEdgeRight, insetValue),
|
.right = insetForEdge(combination, ASInsetLayoutSpecTestEdgeRight, insetValue),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,10 +42,10 @@ static NSString *nameForInsets(UIEdgeInsets insets)
|
|||||||
return [NSString stringWithFormat:@"%.f-%.f-%.f-%.f", insets.top, insets.left, insets.bottom, insets.right];
|
return [NSString stringWithFormat:@"%.f-%.f-%.f-%.f", insets.top, insets.left, insets.bottom, insets.right];
|
||||||
}
|
}
|
||||||
|
|
||||||
@interface ASInsetLayoutNodeSnapshotTests : ASLayoutNodeSnapshotTestCase
|
@interface ASInsetLayoutSpecSnapshotTests : ASLayoutSpecSnapshotTestCase
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation ASInsetLayoutNodeSnapshotTests
|
@implementation ASInsetLayoutSpecSnapshotTests
|
||||||
|
|
||||||
- (void)setUp
|
- (void)setUp
|
||||||
{
|
{
|
||||||
@ -61,13 +61,13 @@ static NSString *nameForInsets(UIEdgeInsets insets)
|
|||||||
ASStaticSizeDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]);
|
ASStaticSizeDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]);
|
||||||
foregroundNode.staticSize = {10, 10};
|
foregroundNode.staticSize = {10, 10};
|
||||||
|
|
||||||
ASLayoutNode *layoutNode =
|
ASLayoutSpec *layoutSpec =
|
||||||
[ASBackgroundLayoutNode
|
[ASBackgroundLayoutSpec
|
||||||
newWithChild:[ASInsetLayoutNode newWithInsets:insets child:foregroundNode]
|
newWithChild:[ASInsetLayoutSpec newWithInsets:insets child:foregroundNode]
|
||||||
background:backgroundNode];
|
background:backgroundNode];
|
||||||
|
|
||||||
static ASSizeRange kVariableSize = {{0, 0}, {300, 300}};
|
static ASSizeRange kVariableSize = {{0, 0}, {300, 300}};
|
||||||
[self testLayoutNode:layoutNode
|
[self testLayoutSpec:layoutSpec
|
||||||
sizeRange:kVariableSize
|
sizeRange:kVariableSize
|
||||||
subnodes:@[backgroundNode, foregroundNode]
|
subnodes:@[backgroundNode, foregroundNode]
|
||||||
identifier:nameForInsets(insets)];
|
identifier:nameForInsets(insets)];
|
||||||
@ -82,13 +82,13 @@ static NSString *nameForInsets(UIEdgeInsets insets)
|
|||||||
ASStaticSizeDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]);
|
ASStaticSizeDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]);
|
||||||
foregroundNode.staticSize = {10, 10};
|
foregroundNode.staticSize = {10, 10};
|
||||||
|
|
||||||
ASLayoutNode *layoutNode =
|
ASLayoutSpec *layoutSpec =
|
||||||
[ASBackgroundLayoutNode
|
[ASBackgroundLayoutSpec
|
||||||
newWithChild:[ASInsetLayoutNode newWithInsets:insets child:foregroundNode]
|
newWithChild:[ASInsetLayoutSpec newWithInsets:insets child:foregroundNode]
|
||||||
background:backgroundNode];
|
background:backgroundNode];
|
||||||
|
|
||||||
static ASSizeRange kFixedSize = {{300, 300}, {300, 300}};
|
static ASSizeRange kFixedSize = {{300, 300}, {300, 300}};
|
||||||
[self testLayoutNode:layoutNode
|
[self testLayoutSpec:layoutSpec
|
||||||
sizeRange:kFixedSize
|
sizeRange:kFixedSize
|
||||||
subnodes:@[backgroundNode, foregroundNode]
|
subnodes:@[backgroundNode, foregroundNode]
|
||||||
identifier:nameForInsets(insets)];
|
identifier:nameForInsets(insets)];
|
||||||
@ -104,13 +104,13 @@ static NSString *nameForInsets(UIEdgeInsets insets)
|
|||||||
ASStaticSizeDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]);
|
ASStaticSizeDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]);
|
||||||
foregroundNode.staticSize = {10, 10};
|
foregroundNode.staticSize = {10, 10};
|
||||||
|
|
||||||
ASLayoutNode *layoutNode =
|
ASLayoutSpec *layoutSpec =
|
||||||
[ASBackgroundLayoutNode
|
[ASBackgroundLayoutSpec
|
||||||
newWithChild:[ASInsetLayoutNode newWithInsets:insets child:foregroundNode]
|
newWithChild:[ASInsetLayoutSpec newWithInsets:insets child:foregroundNode]
|
||||||
background:backgroundNode];
|
background:backgroundNode];
|
||||||
|
|
||||||
static ASSizeRange kFixedSize = {{300, 300}, {300, 300}};
|
static ASSizeRange kFixedSize = {{300, 300}, {300, 300}};
|
||||||
[self testLayoutNode:layoutNode
|
[self testLayoutSpec:layoutSpec
|
||||||
sizeRange:kFixedSize
|
sizeRange:kFixedSize
|
||||||
subnodes:@[backgroundNode, foregroundNode]
|
subnodes:@[backgroundNode, foregroundNode]
|
||||||
identifier:nameForInsets(insets)];
|
identifier:nameForInsets(insets)];
|
@ -1,29 +1,31 @@
|
|||||||
//
|
/*
|
||||||
// ASLayoutNodeTestsHelper.h
|
* Copyright (c) 2015-present, Facebook, Inc.
|
||||||
// AsyncDisplayKit
|
* All rights reserved.
|
||||||
//
|
*
|
||||||
// Created by Huy Nguyen on 28/05/15.
|
* This source code is licensed under the BSD-style license found in the
|
||||||
// Copyright (c) 2015 Facebook. All rights reserved.
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
//
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#import "ASSnapshotTestCase.h"
|
#import "ASSnapshotTestCase.h"
|
||||||
#import "ASDisplayNode+Subclasses.h"
|
#import "ASDisplayNode+Subclasses.h"
|
||||||
|
|
||||||
@class ASLayoutNode;
|
@class ASLayoutSpec;
|
||||||
|
|
||||||
@interface ASLayoutNodeSnapshotTestCase: ASSnapshotTestCase
|
@interface ASLayoutSpecSnapshotTestCase: ASSnapshotTestCase
|
||||||
/**
|
/**
|
||||||
Test the layout node or records a snapshot if recordMode is YES.
|
Test the layout spec or records a snapshot if recordMode is YES.
|
||||||
@param layoutNode The layout node under test or to snapshot
|
@param layoutSpec The layout spec under test or to snapshot
|
||||||
@param sizeRange The size range used to calculate layout of the given layout node.
|
@param sizeRange The size range used to calculate layout of the given layout spec.
|
||||||
@param subnodes An array of ASDisplayNodes used within the layout node.
|
@param subnodes An array of ASDisplayNodes used within the layout spec.
|
||||||
@param identifier An optional identifier, used to identify this snapshot test.
|
@param identifier An optional identifier, used to identify this snapshot test.
|
||||||
|
|
||||||
@discussion In order to make the layout node visible, it is embeded to a ASDisplayNode host.
|
@discussion In order to make the layout spec visible, it is embeded to a ASDisplayNode host.
|
||||||
Any display nodes used within the layout must be provided.
|
Any subnodes used within the layout spec must be provided.
|
||||||
They will be added to the host in the same order as the subnodes array.
|
They will be added to the host in the same order as the array.
|
||||||
*/
|
*/
|
||||||
- (void)testLayoutNode:(ASLayoutNode *)layoutNode
|
- (void)testLayoutSpec:(ASLayoutSpec *)layoutSpec
|
||||||
sizeRange:(ASSizeRange)sizeRange
|
sizeRange:(ASSizeRange)sizeRange
|
||||||
subnodes:(NSArray *)subnodes
|
subnodes:(NSArray *)subnodes
|
||||||
identifier:(NSString *)identifier;
|
identifier:(NSString *)identifier;
|
@ -1,23 +1,25 @@
|
|||||||
//
|
/*
|
||||||
// ASLayoutNodeTestsHelper.m
|
* Copyright (c) 2015-present, Facebook, Inc.
|
||||||
// AsyncDisplayKit
|
* All rights reserved.
|
||||||
//
|
*
|
||||||
// Created by Huy Nguyen on 28/05/15.
|
* This source code is licensed under the BSD-style license found in the
|
||||||
// Copyright (c) 2015 Facebook. All rights reserved.
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
//
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#import "ASLayoutNodeSnapshotTestsHelper.h"
|
#import "ASLayoutSpecSnapshotTestsHelper.h"
|
||||||
|
|
||||||
#import "ASDisplayNode.h"
|
#import "ASDisplayNode.h"
|
||||||
#import "ASLayoutNode.h"
|
#import "ASLayoutSpec.h"
|
||||||
|
|
||||||
@interface ASTestNode : ASDisplayNode
|
@interface ASTestNode : ASDisplayNode
|
||||||
- (void)setLayoutNodeUnderTest:(ASLayoutNode *)layoutNodeUnderTest sizeRange:(ASSizeRange)sizeRange;
|
- (void)setLayoutSpecUnderTest:(ASLayoutSpec *)layoutSpecUnderTest sizeRange:(ASSizeRange)sizeRange;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation ASLayoutNodeSnapshotTestCase
|
@implementation ASLayoutSpecSnapshotTestCase
|
||||||
|
|
||||||
- (void)testLayoutNode:(ASLayoutNode *)layoutNode
|
- (void)testLayoutSpec:(ASLayoutSpec *)layoutSpec
|
||||||
sizeRange:(ASSizeRange)sizeRange
|
sizeRange:(ASSizeRange)sizeRange
|
||||||
subnodes:(NSArray *)subnodes
|
subnodes:(NSArray *)subnodes
|
||||||
identifier:(NSString *)identifier
|
identifier:(NSString *)identifier
|
||||||
@ -28,7 +30,7 @@
|
|||||||
[node addSubnode:subnode];
|
[node addSubnode:subnode];
|
||||||
}
|
}
|
||||||
|
|
||||||
[node setLayoutNodeUnderTest:layoutNode sizeRange:sizeRange];
|
[node setLayoutSpecUnderTest:layoutSpec sizeRange:sizeRange];
|
||||||
|
|
||||||
ASSnapshotVerifyNode(node, identifier);
|
ASSnapshotVerifyNode(node, identifier);
|
||||||
}
|
}
|
||||||
@ -48,9 +50,9 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setLayoutNodeUnderTest:(ASLayoutNode *)layoutNodeUnderTest sizeRange:(ASSizeRange)sizeRange
|
- (void)setLayoutSpecUnderTest:(ASLayoutSpec *)layoutSpecUnderTest sizeRange:(ASSizeRange)sizeRange
|
||||||
{
|
{
|
||||||
_layoutUnderTest = [[layoutNodeUnderTest calculateLayoutThatFits:sizeRange] flattenedLayoutUsingPredicateBlock:^BOOL(ASLayout *evaluatedLayout) {
|
_layoutUnderTest = [[layoutSpecUnderTest calculateLayoutThatFits:sizeRange] flattenedLayoutUsingPredicateBlock:^BOOL(ASLayout *evaluatedLayout) {
|
||||||
return [self.subnodes containsObject:evaluatedLayout.layoutableObject];
|
return [self.subnodes containsObject:evaluatedLayout.layoutableObject];
|
||||||
}];
|
}];
|
||||||
self.frame = CGRectMake(0, 0, _layoutUnderTest.size.width, _layoutUnderTest.size.height);
|
self.frame = CGRectMake(0, 0, _layoutUnderTest.size.width, _layoutUnderTest.size.height);
|
@ -8,17 +8,17 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASLayoutNodeSnapshotTestsHelper.h"
|
#import "ASLayoutSpecSnapshotTestsHelper.h"
|
||||||
|
|
||||||
#import "ASOverlayLayoutNode.h"
|
#import "ASOverlayLayoutSpec.h"
|
||||||
#import "ASCenterLayoutNode.h"
|
#import "ASCenterLayoutSpec.h"
|
||||||
|
|
||||||
static const ASSizeRange kSize = {{320, 320}, {320, 320}};
|
static const ASSizeRange kSize = {{320, 320}, {320, 320}};
|
||||||
|
|
||||||
@interface ASOverlayLayoutNodeSnapshotTests : ASLayoutNodeSnapshotTestCase
|
@interface ASOverlayLayoutSpecSnapshotTests : ASLayoutSpecSnapshotTestCase
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation ASOverlayLayoutNodeSnapshotTests
|
@implementation ASOverlayLayoutSpecSnapshotTests
|
||||||
|
|
||||||
- (void)setUp
|
- (void)setUp
|
||||||
{
|
{
|
||||||
@ -32,16 +32,16 @@ static const ASSizeRange kSize = {{320, 320}, {320, 320}};
|
|||||||
ASStaticSizeDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor blackColor]);
|
ASStaticSizeDisplayNode *foregroundNode = ASDisplayNodeWithBackgroundColor([UIColor blackColor]);
|
||||||
foregroundNode.staticSize = {20, 20};
|
foregroundNode.staticSize = {20, 20};
|
||||||
|
|
||||||
ASLayoutNode *layoutNode =
|
ASLayoutSpec *layoutSpec =
|
||||||
[ASOverlayLayoutNode
|
[ASOverlayLayoutSpec
|
||||||
newWithChild:backgroundNode
|
newWithChild:backgroundNode
|
||||||
overlay:
|
overlay:
|
||||||
[ASCenterLayoutNode
|
[ASCenterLayoutSpec
|
||||||
newWithCenteringOptions:ASCenterLayoutNodeCenteringXY
|
newWithCenteringOptions:ASCenterLayoutSpecCenteringXY
|
||||||
sizingOptions:{}
|
sizingOptions:{}
|
||||||
child:foregroundNode]];
|
child:foregroundNode]];
|
||||||
|
|
||||||
[self testLayoutNode:layoutNode sizeRange:kSize subnodes:@[backgroundNode, foregroundNode] identifier: nil];
|
[self testLayoutSpec:layoutSpec sizeRange:kSize subnodes:@[backgroundNode, foregroundNode] identifier: nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the BSD-style license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#import "ASLayoutNodeSnapshotTestsHelper.h"
|
|
||||||
|
|
||||||
#import "ASRatioLayoutNode.h"
|
|
||||||
|
|
||||||
static const ASSizeRange kFixedSize = {{0, 0}, {100, 100}};
|
|
||||||
|
|
||||||
@interface ASRatioLayoutNodeSnapshotTests : ASLayoutNodeSnapshotTestCase
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation ASRatioLayoutNodeSnapshotTests
|
|
||||||
|
|
||||||
- (void)setUp
|
|
||||||
{
|
|
||||||
[super setUp];
|
|
||||||
self.recordMode = NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testRatioLayoutNodeWithRatio:(CGFloat)ratio childNodeSize:(CGSize)childNodeSize identifier:(NSString *)identifier
|
|
||||||
{
|
|
||||||
ASStaticSizeDisplayNode *subnode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]);
|
|
||||||
subnode.staticSize = childNodeSize;
|
|
||||||
|
|
||||||
ASLayoutNode *layoutNode = [ASRatioLayoutNode newWithRatio:ratio child:subnode];
|
|
||||||
|
|
||||||
[self testLayoutNode:layoutNode sizeRange:kFixedSize subnodes:@[subnode] identifier:identifier];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)testRatioLayout
|
|
||||||
{
|
|
||||||
[self testRatioLayoutNodeWithRatio:0.5 childNodeSize:CGSizeMake(100, 100) identifier:@"HalfRatio"];
|
|
||||||
[self testRatioLayoutNodeWithRatio:2.0 childNodeSize:CGSizeMake(100, 100) identifier:@"DoubleRatio"];
|
|
||||||
[self testRatioLayoutNodeWithRatio:7.0 childNodeSize:CGSizeMake(100, 100) identifier:@"SevenTimesRatio"];
|
|
||||||
[self testRatioLayoutNodeWithRatio:10.0 childNodeSize:CGSizeMake(20, 200) identifier:@"TenTimesRatioWithItemTooBig"];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
46
AsyncDisplayKitTests/ASRatioLayoutSpecSnapshotTests.mm
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the BSD-style license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "ASLayoutSpecSnapshotTestsHelper.h"
|
||||||
|
|
||||||
|
#import "ASRatioLayoutSpec.h"
|
||||||
|
|
||||||
|
static const ASSizeRange kFixedSize = {{0, 0}, {100, 100}};
|
||||||
|
|
||||||
|
@interface ASRatioLayoutSpecSnapshotTests : ASLayoutSpecSnapshotTestCase
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation ASRatioLayoutSpecSnapshotTests
|
||||||
|
|
||||||
|
- (void)setUp
|
||||||
|
{
|
||||||
|
[super setUp];
|
||||||
|
self.recordMode = NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testRatioLayoutSpecWithRatio:(CGFloat)ratio childSize:(CGSize)childSize identifier:(NSString *)identifier
|
||||||
|
{
|
||||||
|
ASStaticSizeDisplayNode *subnode = ASDisplayNodeWithBackgroundColor([UIColor greenColor]);
|
||||||
|
subnode.staticSize = childSize;
|
||||||
|
|
||||||
|
ASLayoutSpec *layoutSpec = [ASRatioLayoutSpec newWithRatio:ratio child:subnode];
|
||||||
|
|
||||||
|
[self testLayoutSpec:layoutSpec sizeRange:kFixedSize subnodes:@[subnode] identifier:identifier];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testRatioLayout
|
||||||
|
{
|
||||||
|
[self testRatioLayoutSpecWithRatio:0.5 childSize:CGSizeMake(100, 100) identifier:@"HalfRatio"];
|
||||||
|
[self testRatioLayoutSpecWithRatio:2.0 childSize:CGSizeMake(100, 100) identifier:@"DoubleRatio"];
|
||||||
|
[self testRatioLayoutSpecWithRatio:7.0 childSize:CGSizeMake(100, 100) identifier:@"SevenTimesRatio"];
|
||||||
|
[self testRatioLayoutSpecWithRatio:10.0 childSize:CGSizeMake(20, 200) identifier:@"TenTimesRatioWithItemTooBig"];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
@ -8,17 +8,17 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "ASLayoutNodeSnapshotTestsHelper.h"
|
#import "ASLayoutSpecSnapshotTestsHelper.h"
|
||||||
|
|
||||||
#import "ASStackLayoutNode.h"
|
#import "ASStackLayoutSpec.h"
|
||||||
#import "ASBackgroundLayoutNode.h"
|
#import "ASBackgroundLayoutSpec.h"
|
||||||
#import "ASRatioLayoutNode.h"
|
#import "ASRatioLayoutSpec.h"
|
||||||
#import "ASInsetLayoutNode.h"
|
#import "ASInsetLayoutSpec.h"
|
||||||
|
|
||||||
@interface ASStackLayoutNodeSnapshotTests : ASLayoutNodeSnapshotTestCase
|
@interface ASStackLayoutSpecSnapshotTests : ASLayoutSpecSnapshotTestCase
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation ASStackLayoutNodeSnapshotTests
|
@implementation ASStackLayoutSpecSnapshotTests
|
||||||
|
|
||||||
- (void)setUp
|
- (void)setUp
|
||||||
{
|
{
|
||||||
@ -46,30 +46,30 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
return subnodes;
|
return subnodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testStackLayoutNodeWithJustify:(ASStackLayoutJustifyContent)justify
|
- (void)testStackLayoutSpecWithJustify:(ASStackLayoutJustifyContent)justify
|
||||||
flex:(BOOL)flex
|
flex:(BOOL)flex
|
||||||
sizeRange:(ASSizeRange)sizeRange
|
sizeRange:(ASSizeRange)sizeRange
|
||||||
identifier:(NSString *)identifier
|
identifier:(NSString *)identifier
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {
|
ASStackLayoutSpecStyle style = {
|
||||||
.direction = ASStackLayoutDirectionHorizontal,
|
.direction = ASStackLayoutDirectionHorizontal,
|
||||||
.justifyContent = justify
|
.justifyContent = justify
|
||||||
};
|
};
|
||||||
|
|
||||||
NSArray *subnodes = defaultSubnodesWithSameSize({50, 50}, flex);
|
NSArray *subnodes = defaultSubnodesWithSameSize({50, 50}, flex);
|
||||||
|
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:sizeRange subnodes:subnodes identifier:identifier];
|
[self testStackLayoutSpecWithStyle:style sizeRange:sizeRange subnodes:subnodes identifier:identifier];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testStackLayoutNodeWithStyle:(ASStackLayoutNodeStyle)style
|
- (void)testStackLayoutSpecWithStyle:(ASStackLayoutSpecStyle)style
|
||||||
sizeRange:(ASSizeRange)sizeRange
|
sizeRange:(ASSizeRange)sizeRange
|
||||||
subnodes:(NSArray *)subnodes
|
subnodes:(NSArray *)subnodes
|
||||||
identifier:(NSString *)identifier
|
identifier:(NSString *)identifier
|
||||||
{
|
{
|
||||||
[self testStackLayoutNodeWithStyle:style children:subnodes sizeRange:sizeRange subnodes:subnodes identifier:identifier];
|
[self testStackLayoutSpecWithStyle:style children:subnodes sizeRange:sizeRange subnodes:subnodes identifier:identifier];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testStackLayoutNodeWithStyle:(ASStackLayoutNodeStyle)style
|
- (void)testStackLayoutSpecWithStyle:(ASStackLayoutSpecStyle)style
|
||||||
children:(NSArray *)children
|
children:(NSArray *)children
|
||||||
sizeRange:(ASSizeRange)sizeRange
|
sizeRange:(ASSizeRange)sizeRange
|
||||||
subnodes:(NSArray *)subnodes
|
subnodes:(NSArray *)subnodes
|
||||||
@ -77,68 +77,68 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
{
|
{
|
||||||
ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor whiteColor]);
|
ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor whiteColor]);
|
||||||
|
|
||||||
ASLayoutNode *layoutNode =
|
ASLayoutSpec *layoutSpec =
|
||||||
[ASBackgroundLayoutNode
|
[ASBackgroundLayoutSpec
|
||||||
newWithChild:[ASStackLayoutNode newWithStyle:style children:children]
|
newWithChild:[ASStackLayoutSpec newWithStyle:style children:children]
|
||||||
background:backgroundNode];
|
background:backgroundNode];
|
||||||
|
|
||||||
NSMutableArray *newSubnodes = [NSMutableArray arrayWithObject:backgroundNode];
|
NSMutableArray *newSubnodes = [NSMutableArray arrayWithObject:backgroundNode];
|
||||||
[newSubnodes addObjectsFromArray:subnodes];
|
[newSubnodes addObjectsFromArray:subnodes];
|
||||||
|
|
||||||
[self testLayoutNode:layoutNode sizeRange:sizeRange subnodes:newSubnodes identifier:identifier];
|
[self testLayoutSpec:layoutSpec sizeRange:sizeRange subnodes:newSubnodes identifier:identifier];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testUnderflowBehaviors
|
- (void)testUnderflowBehaviors
|
||||||
{
|
{
|
||||||
// width 300px; height 0-300px
|
// width 300px; height 0-300px
|
||||||
static ASSizeRange kSize = {{300, 0}, {300, 300}};
|
static ASSizeRange kSize = {{300, 0}, {300, 300}};
|
||||||
[self testStackLayoutNodeWithJustify:ASStackLayoutJustifyContentStart flex:NO sizeRange:kSize identifier:@"justifyStart"];
|
[self testStackLayoutSpecWithJustify:ASStackLayoutJustifyContentStart flex:NO sizeRange:kSize identifier:@"justifyStart"];
|
||||||
[self testStackLayoutNodeWithJustify:ASStackLayoutJustifyContentCenter flex:NO sizeRange:kSize identifier:@"justifyCenter"];
|
[self testStackLayoutSpecWithJustify:ASStackLayoutJustifyContentCenter flex:NO sizeRange:kSize identifier:@"justifyCenter"];
|
||||||
[self testStackLayoutNodeWithJustify:ASStackLayoutJustifyContentEnd flex:NO sizeRange:kSize identifier:@"justifyEnd"];
|
[self testStackLayoutSpecWithJustify:ASStackLayoutJustifyContentEnd flex:NO sizeRange:kSize identifier:@"justifyEnd"];
|
||||||
[self testStackLayoutNodeWithJustify:ASStackLayoutJustifyContentStart flex:YES sizeRange:kSize identifier:@"flex"];
|
[self testStackLayoutSpecWithJustify:ASStackLayoutJustifyContentStart flex:YES sizeRange:kSize identifier:@"flex"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testOverflowBehaviors
|
- (void)testOverflowBehaviors
|
||||||
{
|
{
|
||||||
// width 110px; height 0-300px
|
// width 110px; height 0-300px
|
||||||
static ASSizeRange kSize = {{110, 0}, {110, 300}};
|
static ASSizeRange kSize = {{110, 0}, {110, 300}};
|
||||||
[self testStackLayoutNodeWithJustify:ASStackLayoutJustifyContentStart flex:NO sizeRange:kSize identifier:@"justifyStart"];
|
[self testStackLayoutSpecWithJustify:ASStackLayoutJustifyContentStart flex:NO sizeRange:kSize identifier:@"justifyStart"];
|
||||||
[self testStackLayoutNodeWithJustify:ASStackLayoutJustifyContentCenter flex:NO sizeRange:kSize identifier:@"justifyCenter"];
|
[self testStackLayoutSpecWithJustify:ASStackLayoutJustifyContentCenter flex:NO sizeRange:kSize identifier:@"justifyCenter"];
|
||||||
[self testStackLayoutNodeWithJustify:ASStackLayoutJustifyContentEnd flex:NO sizeRange:kSize identifier:@"justifyEnd"];
|
[self testStackLayoutSpecWithJustify:ASStackLayoutJustifyContentEnd flex:NO sizeRange:kSize identifier:@"justifyEnd"];
|
||||||
[self testStackLayoutNodeWithJustify:ASStackLayoutJustifyContentStart flex:YES sizeRange:kSize identifier:@"flex"];
|
[self testStackLayoutSpecWithJustify:ASStackLayoutJustifyContentStart flex:YES sizeRange:kSize identifier:@"flex"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testOverflowBehaviorsWhenAllFlexShrinkNodesHaveBeenClampedToZeroButViolationStillExists
|
- (void)testOverflowBehaviorsWhenAllFlexShrinkChildrenHaveBeenClampedToZeroButViolationStillExists
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
ASStackLayoutSpecStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
||||||
|
|
||||||
NSArray *subnodes = defaultSubnodesWithSameSize({50, 50}, NO);
|
NSArray *subnodes = defaultSubnodesWithSameSize({50, 50}, NO);
|
||||||
((ASDisplayNode *)subnodes[1]).flexShrink = YES;
|
((ASDisplayNode *)subnodes[1]).flexShrink = YES;
|
||||||
|
|
||||||
// Width is 75px--that's less than the sum of the widths of the child nodes, which is 100px.
|
// Width is 75px--that's less than the sum of the widths of the children, which is 100px.
|
||||||
static ASSizeRange kSize = {{75, 0}, {75, 150}};
|
static ASSizeRange kSize = {{75, 0}, {75, 150}};
|
||||||
[self testStackLayoutNodeWithStyle: style sizeRange:kSize subnodes:subnodes identifier:nil];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kSize subnodes:subnodes identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testFlexWithUnequalIntrinsicSizes
|
- (void)testFlexWithUnequalIntrinsicSizes
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
ASStackLayoutSpecStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
||||||
|
|
||||||
NSArray *subnodes = defaultSubnodesWithSameSize({50, 50}, YES);
|
NSArray *subnodes = defaultSubnodesWithSameSize({50, 50}, YES);
|
||||||
((ASStaticSizeDisplayNode *)subnodes[1]).staticSize = {150, 150};
|
((ASStaticSizeDisplayNode *)subnodes[1]).staticSize = {150, 150};
|
||||||
|
|
||||||
// width 300px; height 0-150px.
|
// width 300px; height 0-150px.
|
||||||
static ASSizeRange kUnderflowSize = {{300, 0}, {300, 150}};
|
static ASSizeRange kUnderflowSize = {{300, 0}, {300, 150}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kUnderflowSize subnodes:subnodes identifier:@"underflow"];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kUnderflowSize subnodes:subnodes identifier:@"underflow"];
|
||||||
|
|
||||||
// width 200px; height 0-150px.
|
// width 200px; height 0-150px.
|
||||||
static ASSizeRange kOverflowSize = {{200, 0}, {200, 150}};
|
static ASSizeRange kOverflowSize = {{200, 0}, {200, 150}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kOverflowSize subnodes:subnodes identifier:@"overflow"];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kOverflowSize subnodes:subnodes identifier:@"overflow"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testCrossAxisSizeBehaviors
|
- (void)testCrossAxisSizeBehaviors
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {.direction = ASStackLayoutDirectionVertical};
|
ASStackLayoutSpecStyle style = {.direction = ASStackLayoutDirectionVertical};
|
||||||
|
|
||||||
NSArray *subnodes = defaultSubnodes();
|
NSArray *subnodes = defaultSubnodes();
|
||||||
((ASStaticSizeDisplayNode *)subnodes[0]).staticSize = {50, 50};
|
((ASStaticSizeDisplayNode *)subnodes[0]).staticSize = {50, 50};
|
||||||
@ -147,16 +147,16 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
|
|
||||||
// width 0-300px; height 300px
|
// width 0-300px; height 300px
|
||||||
static ASSizeRange kVariableHeight = {{0, 300}, {300, 300}};
|
static ASSizeRange kVariableHeight = {{0, 300}, {300, 300}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kVariableHeight subnodes:subnodes identifier:@"variableHeight"];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kVariableHeight subnodes:subnodes identifier:@"variableHeight"];
|
||||||
|
|
||||||
// width 300px; height 300px
|
// width 300px; height 300px
|
||||||
static ASSizeRange kFixedHeight = {{300, 300}, {300, 300}};
|
static ASSizeRange kFixedHeight = {{300, 300}, {300, 300}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kFixedHeight subnodes:subnodes identifier:@"fixedHeight"];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kFixedHeight subnodes:subnodes identifier:@"fixedHeight"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testStackSpacing
|
- (void)testStackSpacing
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {
|
ASStackLayoutSpecStyle style = {
|
||||||
.direction = ASStackLayoutDirectionVertical,
|
.direction = ASStackLayoutDirectionVertical,
|
||||||
.spacing = 10
|
.spacing = 10
|
||||||
};
|
};
|
||||||
@ -168,22 +168,22 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
|
|
||||||
// width 0-300px; height 300px
|
// width 0-300px; height 300px
|
||||||
static ASSizeRange kVariableHeight = {{0, 300}, {300, 300}};
|
static ASSizeRange kVariableHeight = {{0, 300}, {300, 300}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kVariableHeight subnodes:subnodes identifier:@"variableHeight"];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kVariableHeight subnodes:subnodes identifier:@"variableHeight"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testStackSpacingWithChildrenHavingNilNodes
|
- (void)testStackSpacingWithChildrenHavingNilObjects
|
||||||
{
|
{
|
||||||
// This should take a zero height since all children have a nil node. If it takes a height > 0, a blue background
|
// This should take a zero height since all children have a nil node. If it takes a height > 0, a blue background
|
||||||
// will show up, hence failing the test.
|
// will show up, hence failing the test.
|
||||||
ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor blueColor]);
|
ASDisplayNode *backgroundNode = ASDisplayNodeWithBackgroundColor([UIColor blueColor]);
|
||||||
|
|
||||||
ASLayoutNode *layoutNode =
|
ASLayoutSpec *layoutSpec =
|
||||||
[ASInsetLayoutNode
|
[ASInsetLayoutSpec
|
||||||
newWithInsets:{10, 10, 10 ,10}
|
newWithInsets:{10, 10, 10 ,10}
|
||||||
child:
|
child:
|
||||||
[ASBackgroundLayoutNode
|
[ASBackgroundLayoutSpec
|
||||||
newWithChild:
|
newWithChild:
|
||||||
[ASStackLayoutNode
|
[ASStackLayoutSpec
|
||||||
newWithStyle:{
|
newWithStyle:{
|
||||||
.direction = ASStackLayoutDirectionVertical,
|
.direction = ASStackLayoutDirectionVertical,
|
||||||
.spacing = 10,
|
.spacing = 10,
|
||||||
@ -194,14 +194,14 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
|
|
||||||
// width 300px; height 0-300px
|
// width 300px; height 0-300px
|
||||||
static ASSizeRange kVariableHeight = {{300, 0}, {300, 300}};
|
static ASSizeRange kVariableHeight = {{300, 0}, {300, 300}};
|
||||||
[self testLayoutNode:layoutNode sizeRange:kVariableHeight subnodes:@[backgroundNode] identifier:@"variableHeight"];
|
[self testLayoutSpec:layoutSpec sizeRange:kVariableHeight subnodes:@[backgroundNode] identifier:@"variableHeight"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testNodeSpacing
|
- (void)testChildSpacing
|
||||||
{
|
{
|
||||||
// width 0-INF; height 0-INF
|
// width 0-INF; height 0-INF
|
||||||
static ASSizeRange kAnySize = {{0, 0}, {INFINITY, INFINITY}};
|
static ASSizeRange kAnySize = {{0, 0}, {INFINITY, INFINITY}};
|
||||||
ASStackLayoutNodeStyle style = {.direction = ASStackLayoutDirectionVertical};
|
ASStackLayoutSpecStyle style = {.direction = ASStackLayoutDirectionVertical};
|
||||||
|
|
||||||
NSArray *subnodes = defaultSubnodes();
|
NSArray *subnodes = defaultSubnodes();
|
||||||
((ASStaticSizeDisplayNode *)subnodes[0]).staticSize = {50, 50};
|
((ASStaticSizeDisplayNode *)subnodes[0]).staticSize = {50, 50};
|
||||||
@ -210,14 +210,14 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
|
|
||||||
((ASStaticSizeDisplayNode *)subnodes[1]).spacingBefore = 10;
|
((ASStaticSizeDisplayNode *)subnodes[1]).spacingBefore = 10;
|
||||||
((ASStaticSizeDisplayNode *)subnodes[2]).spacingBefore = 20;
|
((ASStaticSizeDisplayNode *)subnodes[2]).spacingBefore = 20;
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kAnySize subnodes:subnodes identifier:@"spacingBefore"];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kAnySize subnodes:subnodes identifier:@"spacingBefore"];
|
||||||
// Reset above spacing values
|
// Reset above spacing values
|
||||||
((ASStaticSizeDisplayNode *)subnodes[1]).spacingBefore = 0;
|
((ASStaticSizeDisplayNode *)subnodes[1]).spacingBefore = 0;
|
||||||
((ASStaticSizeDisplayNode *)subnodes[2]).spacingBefore = 0;
|
((ASStaticSizeDisplayNode *)subnodes[2]).spacingBefore = 0;
|
||||||
|
|
||||||
((ASStaticSizeDisplayNode *)subnodes[1]).spacingAfter = 10;
|
((ASStaticSizeDisplayNode *)subnodes[1]).spacingAfter = 10;
|
||||||
((ASStaticSizeDisplayNode *)subnodes[2]).spacingAfter = 20;
|
((ASStaticSizeDisplayNode *)subnodes[2]).spacingAfter = 20;
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kAnySize subnodes:subnodes identifier:@"spacingAfter"];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kAnySize subnodes:subnodes identifier:@"spacingAfter"];
|
||||||
// Reset above spacing values
|
// Reset above spacing values
|
||||||
((ASStaticSizeDisplayNode *)subnodes[1]).spacingAfter = 0;
|
((ASStaticSizeDisplayNode *)subnodes[1]).spacingAfter = 0;
|
||||||
((ASStaticSizeDisplayNode *)subnodes[2]).spacingAfter = 0;
|
((ASStaticSizeDisplayNode *)subnodes[2]).spacingAfter = 0;
|
||||||
@ -225,12 +225,12 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
style.spacing = 10;
|
style.spacing = 10;
|
||||||
((ASStaticSizeDisplayNode *)subnodes[1]).spacingBefore = -10;
|
((ASStaticSizeDisplayNode *)subnodes[1]).spacingBefore = -10;
|
||||||
((ASStaticSizeDisplayNode *)subnodes[1]).spacingAfter = -10;
|
((ASStaticSizeDisplayNode *)subnodes[1]).spacingAfter = -10;
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kAnySize subnodes:subnodes identifier:@"spacingBalancedOut"];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kAnySize subnodes:subnodes identifier:@"spacingBalancedOut"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testJustifiedCenterWithNodeSpacing
|
- (void)testJustifiedCenterWithChildSpacing
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {
|
ASStackLayoutSpecStyle style = {
|
||||||
.direction = ASStackLayoutDirectionVertical,
|
.direction = ASStackLayoutDirectionVertical,
|
||||||
.justifyContent = ASStackLayoutJustifyContentCenter
|
.justifyContent = ASStackLayoutJustifyContentCenter
|
||||||
};
|
};
|
||||||
@ -246,29 +246,29 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
|
|
||||||
// width 0-300px; height 300px
|
// width 0-300px; height 300px
|
||||||
static ASSizeRange kVariableHeight = {{0, 300}, {300, 300}};
|
static ASSizeRange kVariableHeight = {{0, 300}, {300, 300}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kVariableHeight subnodes:subnodes identifier:@"variableHeight"];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kVariableHeight subnodes:subnodes identifier:@"variableHeight"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testNodeThatChangesCrossSizeWhenMainSizeIsFlexed
|
- (void)testChildThatChangesCrossSizeWhenMainSizeIsFlexed
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
ASStackLayoutSpecStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
||||||
|
|
||||||
ASStaticSizeDisplayNode * subnode1 = ASDisplayNodeWithBackgroundColor([UIColor blueColor]);
|
ASStaticSizeDisplayNode * subnode1 = ASDisplayNodeWithBackgroundColor([UIColor blueColor]);
|
||||||
ASStaticSizeDisplayNode * subnode2 = ASDisplayNodeWithBackgroundColor([UIColor redColor]);
|
ASStaticSizeDisplayNode * subnode2 = ASDisplayNodeWithBackgroundColor([UIColor redColor]);
|
||||||
subnode2.staticSize = {50, 50};
|
subnode2.staticSize = {50, 50};
|
||||||
|
|
||||||
ASRatioLayoutNode *child1 = [ASRatioLayoutNode newWithRatio:1.5 child:subnode1];
|
ASRatioLayoutSpec *child1 = [ASRatioLayoutSpec newWithRatio:1.5 child:subnode1];
|
||||||
child1.flexBasis = ASRelativeDimensionMakeWithPercent(1);
|
child1.flexBasis = ASRelativeDimensionMakeWithPercent(1);
|
||||||
child1.flexGrow = YES;
|
child1.flexGrow = YES;
|
||||||
child1.flexShrink = YES;
|
child1.flexShrink = YES;
|
||||||
|
|
||||||
static ASSizeRange kFixedWidth = {{150, 0}, {150, INFINITY}};
|
static ASSizeRange kFixedWidth = {{150, 0}, {150, INFINITY}};
|
||||||
[self testStackLayoutNodeWithStyle:style children:@[child1, subnode2] sizeRange:kFixedWidth subnodes:@[subnode1, subnode2] identifier:nil];
|
[self testStackLayoutSpecWithStyle:style children:@[child1, subnode2] sizeRange:kFixedWidth subnodes:@[subnode1, subnode2] identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testAlignCenterWithFlexedMainDimension
|
- (void)testAlignCenterWithFlexedMainDimension
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {
|
ASStackLayoutSpecStyle style = {
|
||||||
.direction = ASStackLayoutDirectionVertical,
|
.direction = ASStackLayoutDirectionVertical,
|
||||||
.alignItems = ASStackLayoutAlignItemsCenter
|
.alignItems = ASStackLayoutAlignItemsCenter
|
||||||
};
|
};
|
||||||
@ -283,12 +283,12 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
|
|
||||||
NSArray *subnodes = @[subnode1, subnode2];
|
NSArray *subnodes = @[subnode1, subnode2];
|
||||||
static ASSizeRange kFixedWidth = {{150, 0}, {150, 100}};
|
static ASSizeRange kFixedWidth = {{150, 0}, {150, 100}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kFixedWidth subnodes:subnodes identifier:nil];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kFixedWidth subnodes:subnodes identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testAlignCenterWithIndefiniteCrossDimension
|
- (void)testAlignCenterWithIndefiniteCrossDimension
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
ASStackLayoutSpecStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
||||||
|
|
||||||
ASStaticSizeDisplayNode *subnode1 = ASDisplayNodeWithBackgroundColor([UIColor redColor]);
|
ASStaticSizeDisplayNode *subnode1 = ASDisplayNodeWithBackgroundColor([UIColor redColor]);
|
||||||
subnode1.staticSize = {100, 100};
|
subnode1.staticSize = {100, 100};
|
||||||
@ -299,12 +299,12 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
|
|
||||||
NSArray *subnodes = @[subnode1, subnode2];
|
NSArray *subnodes = @[subnode1, subnode2];
|
||||||
static ASSizeRange kFixedWidth = {{150, 0}, {150, INFINITY}};
|
static ASSizeRange kFixedWidth = {{150, 0}, {150, INFINITY}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kFixedWidth subnodes:subnodes identifier:nil];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kFixedWidth subnodes:subnodes identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testAlignedStart
|
- (void)testAlignedStart
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {
|
ASStackLayoutSpecStyle style = {
|
||||||
.direction = ASStackLayoutDirectionVertical,
|
.direction = ASStackLayoutDirectionVertical,
|
||||||
.justifyContent = ASStackLayoutJustifyContentCenter,
|
.justifyContent = ASStackLayoutJustifyContentCenter,
|
||||||
.alignItems = ASStackLayoutAlignItemsStart
|
.alignItems = ASStackLayoutAlignItemsStart
|
||||||
@ -320,12 +320,12 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
((ASStaticSizeDisplayNode *)subnodes[2]).spacingBefore = 30;
|
((ASStaticSizeDisplayNode *)subnodes[2]).spacingBefore = 30;
|
||||||
|
|
||||||
static ASSizeRange kExactSize = {{300, 300}, {300, 300}};
|
static ASSizeRange kExactSize = {{300, 300}, {300, 300}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kExactSize subnodes:subnodes identifier:nil];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kExactSize subnodes:subnodes identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testAlignedEnd
|
- (void)testAlignedEnd
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {
|
ASStackLayoutSpecStyle style = {
|
||||||
.direction = ASStackLayoutDirectionVertical,
|
.direction = ASStackLayoutDirectionVertical,
|
||||||
.justifyContent = ASStackLayoutJustifyContentCenter,
|
.justifyContent = ASStackLayoutJustifyContentCenter,
|
||||||
.alignItems = ASStackLayoutAlignItemsEnd
|
.alignItems = ASStackLayoutAlignItemsEnd
|
||||||
@ -341,12 +341,12 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
((ASStaticSizeDisplayNode *)subnodes[2]).spacingBefore = 30;
|
((ASStaticSizeDisplayNode *)subnodes[2]).spacingBefore = 30;
|
||||||
|
|
||||||
static ASSizeRange kExactSize = {{300, 300}, {300, 300}};
|
static ASSizeRange kExactSize = {{300, 300}, {300, 300}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kExactSize subnodes:subnodes identifier:nil];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kExactSize subnodes:subnodes identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testAlignedCenter
|
- (void)testAlignedCenter
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {
|
ASStackLayoutSpecStyle style = {
|
||||||
.direction = ASStackLayoutDirectionVertical,
|
.direction = ASStackLayoutDirectionVertical,
|
||||||
.justifyContent = ASStackLayoutJustifyContentCenter,
|
.justifyContent = ASStackLayoutJustifyContentCenter,
|
||||||
.alignItems = ASStackLayoutAlignItemsCenter
|
.alignItems = ASStackLayoutAlignItemsCenter
|
||||||
@ -362,12 +362,12 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
((ASStaticSizeDisplayNode *)subnodes[2]).spacingBefore = 30;
|
((ASStaticSizeDisplayNode *)subnodes[2]).spacingBefore = 30;
|
||||||
|
|
||||||
static ASSizeRange kExactSize = {{300, 300}, {300, 300}};
|
static ASSizeRange kExactSize = {{300, 300}, {300, 300}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kExactSize subnodes:subnodes identifier:nil];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kExactSize subnodes:subnodes identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testAlignedStretchNoChildExceedsMin
|
- (void)testAlignedStretchNoChildExceedsMin
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {
|
ASStackLayoutSpecStyle style = {
|
||||||
.direction = ASStackLayoutDirectionVertical,
|
.direction = ASStackLayoutDirectionVertical,
|
||||||
.justifyContent = ASStackLayoutJustifyContentCenter,
|
.justifyContent = ASStackLayoutJustifyContentCenter,
|
||||||
.alignItems = ASStackLayoutAlignItemsStretch
|
.alignItems = ASStackLayoutAlignItemsStretch
|
||||||
@ -384,12 +384,12 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
|
|
||||||
static ASSizeRange kVariableSize = {{200, 200}, {300, 300}};
|
static ASSizeRange kVariableSize = {{200, 200}, {300, 300}};
|
||||||
// all children should be 200px wide
|
// all children should be 200px wide
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kVariableSize subnodes:subnodes identifier:nil];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kVariableSize subnodes:subnodes identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testAlignedStretchOneChildExceedsMin
|
- (void)testAlignedStretchOneChildExceedsMin
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {
|
ASStackLayoutSpecStyle style = {
|
||||||
.direction = ASStackLayoutDirectionVertical,
|
.direction = ASStackLayoutDirectionVertical,
|
||||||
.justifyContent = ASStackLayoutJustifyContentCenter,
|
.justifyContent = ASStackLayoutJustifyContentCenter,
|
||||||
.alignItems = ASStackLayoutAlignItemsStretch
|
.alignItems = ASStackLayoutAlignItemsStretch
|
||||||
@ -406,18 +406,18 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
|
|
||||||
static ASSizeRange kVariableSize = {{50, 50}, {300, 300}};
|
static ASSizeRange kVariableSize = {{50, 50}, {300, 300}};
|
||||||
// all children should be 150px wide
|
// all children should be 150px wide
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kVariableSize subnodes:subnodes identifier:nil];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kVariableSize subnodes:subnodes identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testEmptyStack
|
- (void)testEmptyStack
|
||||||
{
|
{
|
||||||
static ASSizeRange kVariableSize = {{50, 50}, {300, 300}};
|
static ASSizeRange kVariableSize = {{50, 50}, {300, 300}};
|
||||||
[self testStackLayoutNodeWithStyle:{} sizeRange:kVariableSize subnodes:@[] identifier:nil];
|
[self testStackLayoutSpecWithStyle:{} sizeRange:kVariableSize subnodes:@[] identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testFixedFlexBasisAppliedWhenFlexingItems
|
- (void)testFixedFlexBasisAppliedWhenFlexingItems
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
ASStackLayoutSpecStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
||||||
|
|
||||||
NSArray *subnodes = defaultSubnodesWithSameSize({50, 50}, NO);
|
NSArray *subnodes = defaultSubnodesWithSameSize({50, 50}, NO);
|
||||||
((ASStaticSizeDisplayNode *)subnodes[1]).staticSize = {150, 150};
|
((ASStaticSizeDisplayNode *)subnodes[1]).staticSize = {150, 150};
|
||||||
@ -429,16 +429,16 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
|
|
||||||
// width 300px; height 0-150px.
|
// width 300px; height 0-150px.
|
||||||
static ASSizeRange kUnderflowSize = {{300, 0}, {300, 150}};
|
static ASSizeRange kUnderflowSize = {{300, 0}, {300, 150}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kUnderflowSize subnodes:subnodes identifier:@"underflow"];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kUnderflowSize subnodes:subnodes identifier:@"underflow"];
|
||||||
|
|
||||||
// width 200px; height 0-150px.
|
// width 200px; height 0-150px.
|
||||||
static ASSizeRange kOverflowSize = {{200, 0}, {200, 150}};
|
static ASSizeRange kOverflowSize = {{200, 0}, {200, 150}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kOverflowSize subnodes:subnodes identifier:@"overflow"];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kOverflowSize subnodes:subnodes identifier:@"overflow"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testPercentageFlexBasisResolvesAgainstParentSize
|
- (void)testPercentageFlexBasisResolvesAgainstParentSize
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
ASStackLayoutSpecStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
||||||
|
|
||||||
NSArray *subnodes = defaultSubnodesWithSameSize({50, 50}, NO);
|
NSArray *subnodes = defaultSubnodesWithSameSize({50, 50}, NO);
|
||||||
|
|
||||||
@ -451,12 +451,12 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
((ASStaticSizeDisplayNode *)subnodes[0]).flexBasis = ASRelativeDimensionMakeWithPercent(0.5);
|
((ASStaticSizeDisplayNode *)subnodes[0]).flexBasis = ASRelativeDimensionMakeWithPercent(0.5);
|
||||||
|
|
||||||
static ASSizeRange kSize = {{200, 0}, {200, INFINITY}};
|
static ASSizeRange kSize = {{200, 0}, {200, INFINITY}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kSize subnodes:subnodes identifier:nil];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kSize subnodes:subnodes identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testFixedFlexBasisOverridesIntrinsicSizeForNonFlexingChildren
|
- (void)testFixedFlexBasisOverridesIntrinsicSizeForNonFlexingChildren
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
ASStackLayoutSpecStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
||||||
|
|
||||||
NSArray *subnodes = defaultSubnodes();
|
NSArray *subnodes = defaultSubnodes();
|
||||||
((ASStaticSizeDisplayNode *)subnodes[0]).staticSize = {50, 50};
|
((ASStaticSizeDisplayNode *)subnodes[0]).staticSize = {50, 50};
|
||||||
@ -468,7 +468,7 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static ASSizeRange kSize = {{300, 0}, {300, 150}};
|
static ASSizeRange kSize = {{300, 0}, {300, 150}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kSize subnodes:subnodes identifier:nil];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kSize subnodes:subnodes identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testCrossAxisStretchingOccursAfterStackAxisFlexing
|
- (void)testCrossAxisStretchingOccursAfterStackAxisFlexing
|
||||||
@ -481,19 +481,19 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
((ASStaticSizeDisplayNode *)subnodes[1]).staticSize = {10, 0};
|
((ASStaticSizeDisplayNode *)subnodes[1]).staticSize = {10, 0};
|
||||||
((ASStaticSizeDisplayNode *)subnodes[2]).staticSize = {3000, 3000};
|
((ASStaticSizeDisplayNode *)subnodes[2]).staticSize = {3000, 3000};
|
||||||
|
|
||||||
ASRatioLayoutNode *child2 = [ASRatioLayoutNode newWithRatio:1.0 child:subnodes[2]];
|
ASRatioLayoutSpec *child2 = [ASRatioLayoutSpec newWithRatio:1.0 child:subnodes[2]];
|
||||||
child2.flexGrow = YES;
|
child2.flexGrow = YES;
|
||||||
child2.flexShrink = YES;
|
child2.flexShrink = YES;
|
||||||
|
|
||||||
// If cross axis stretching occurred *before* flexing, then the blue child would be stretched to 3000 points tall.
|
// If cross axis stretching occurred *before* flexing, then the blue child would be stretched to 3000 points tall.
|
||||||
// Instead it should be stretched to 300 points tall, matching the red child and not overlapping the green inset.
|
// Instead it should be stretched to 300 points tall, matching the red child and not overlapping the green inset.
|
||||||
ASLayoutNode *layoutNode =
|
ASLayoutSpec *layoutSpec =
|
||||||
[ASBackgroundLayoutNode
|
[ASBackgroundLayoutSpec
|
||||||
newWithChild:
|
newWithChild:
|
||||||
[ASInsetLayoutNode
|
[ASInsetLayoutSpec
|
||||||
newWithInsets:UIEdgeInsetsMake(10, 10, 10, 10)
|
newWithInsets:UIEdgeInsetsMake(10, 10, 10, 10)
|
||||||
child:
|
child:
|
||||||
[ASStackLayoutNode
|
[ASStackLayoutSpec
|
||||||
newWithStyle:{
|
newWithStyle:{
|
||||||
.direction = ASStackLayoutDirectionHorizontal,
|
.direction = ASStackLayoutDirectionHorizontal,
|
||||||
.alignItems = ASStackLayoutAlignItemsStretch,
|
.alignItems = ASStackLayoutAlignItemsStretch,
|
||||||
@ -502,12 +502,12 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
background:subnodes[0]];
|
background:subnodes[0]];
|
||||||
|
|
||||||
static ASSizeRange kSize = {{300, 0}, {300, INFINITY}};
|
static ASSizeRange kSize = {{300, 0}, {300, INFINITY}};
|
||||||
[self testLayoutNode:layoutNode sizeRange:kSize subnodes:subnodes identifier:nil];
|
[self testLayoutSpec:layoutSpec sizeRange:kSize subnodes:subnodes identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testViolationIsDistributedEquallyAmongFlexibleChildNodes
|
- (void)testViolationIsDistributedEquallyAmongFlexibleChildren
|
||||||
{
|
{
|
||||||
ASStackLayoutNodeStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
ASStackLayoutSpecStyle style = {.direction = ASStackLayoutDirectionHorizontal};
|
||||||
|
|
||||||
NSArray *subnodes = defaultSubnodes();
|
NSArray *subnodes = defaultSubnodes();
|
||||||
|
|
||||||
@ -520,13 +520,13 @@ static NSArray *defaultSubnodesWithSameSize(CGSize subnodeSize, BOOL flex)
|
|||||||
((ASStaticSizeDisplayNode *)subnodes[2]).staticSize = {200, 50};
|
((ASStaticSizeDisplayNode *)subnodes[2]).staticSize = {200, 50};
|
||||||
((ASStaticSizeDisplayNode *)subnodes[2]).flexShrink = YES;
|
((ASStaticSizeDisplayNode *)subnodes[2]).flexShrink = YES;
|
||||||
|
|
||||||
// A width of 400px results in a violation of 200px. This is distributed equally among each flexible node,
|
// A width of 400px results in a violation of 200px. This is distributed equally among each flexible child,
|
||||||
// causing both of them to be shrunk by 100px, resulting in widths of 300px, 100px, and 50px.
|
// causing both of them to be shrunk by 100px, resulting in widths of 300px, 100px, and 50px.
|
||||||
// In the W3 flexbox standard, flexible nodes are shrunk proportionate to their original sizes,
|
// In the W3 flexbox standard, flexible children are shrunk proportionate to their original sizes,
|
||||||
// resulting in widths of 180px, 100px, and 120px.
|
// resulting in widths of 180px, 100px, and 120px.
|
||||||
// This test verifies the current behavior--the snapshot contains widths 300px, 100px, and 50px.
|
// This test verifies the current behavior--the snapshot contains widths 300px, 100px, and 50px.
|
||||||
static ASSizeRange kSize = {{400, 0}, {400, 150}};
|
static ASSizeRange kSize = {{400, 0}, {400, 150}};
|
||||||
[self testStackLayoutNodeWithStyle:style sizeRange:kSize subnodes:subnodes identifier:nil];
|
[self testStackLayoutSpecWithStyle:style sizeRange:kSize subnodes:subnodes identifier:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 408 B After Width: | Height: | Size: 408 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |