Skip to content

Commit

Permalink
修改方法命名。
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsoft committed Aug 4, 2020
1 parent e98c483 commit af83fed
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 36 deletions.
10 changes: 5 additions & 5 deletions MyLayout/Lib/MyBaseLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,7 @@ - (CGFloat)myGetBoundLimitMeasure:(MyLayoutSize *)anchor subview:(UIView *)subvi
} else if (valType == MyLayoutValType_LayoutSize) {
if (anchor.anchorVal.view == self) {
if (anchor.anchorVal.anchorType == MyLayoutAnchorType_Width) {
value = selfLayoutSize.width - (self.myLayoutLeadingPadding + self.myLayoutTrailingPadding);
value = selfLayoutSize.width - (self.myLayoutPaddingLeading + self.myLayoutPaddingTrailing);
} else {
value = selfLayoutSize.height - (self.myLayoutPaddingTop + self.myLayoutPaddingBottom);
}
Expand Down Expand Up @@ -2433,11 +2433,11 @@ - (CGFloat)myLayoutPaddingLeft {
- (CGFloat)myLayoutPaddingRight {
return self.myCurrentSizeClass.myLayoutPaddingRight;
}
- (CGFloat)myLayoutLeadingPadding {
return self.myCurrentSizeClass.myLayoutLeadingPadding;
- (CGFloat)myLayoutPaddingLeading {
return self.myCurrentSizeClass.myLayoutPaddingLeading;
}
- (CGFloat)myLayoutTrailingPadding {
return self.myCurrentSizeClass.myLayoutTrailingPadding;
- (CGFloat)myLayoutPaddingTrailing {
return self.myCurrentSizeClass.myLayoutPaddingTrailing;
}

- (void)myLayout:(MyLayoutTraits *)layoutTraits adjustScrollViewContentWithSize:(CGSize)newSize {
Expand Down
6 changes: 3 additions & 3 deletions MyLayout/Lib/MyFloatLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ - (CGSize)calcLayoutSize:(CGSize)size subviewEngines:(NSMutableArray<MyLayoutEng
context->subviewEngines = [layoutTraits filterEngines:subviewEngines];
context->paddingTop = layoutTraits.myLayoutPaddingTop;
context->paddingBottom = layoutTraits.myLayoutPaddingBottom;
context->paddingLeading = layoutTraits.myLayoutLeadingPadding;
context->paddingTrailing = layoutTraits.myLayoutTrailingPadding;
context->paddingLeading = layoutTraits.myLayoutPaddingLeading;
context->paddingTrailing = layoutTraits.myLayoutPaddingTrailing;
context->vertGravity = MYVERTGRAVITY(layoutTraits.gravity);
context->horzGravity = [MyViewTraits convertLeadingTrailingGravityFromLeftRightGravity:MYHORZGRAVITY(layoutTraits.gravity)];
context->vertSpace = layoutTraits.subviewVSpace;
Expand Down Expand Up @@ -667,7 +667,7 @@ - (void)myDoVertOrientationLayoutWithContext:(MyLayoutContext *)context {
if (lineHasAlignment) {
CGFloat baselinePos = CGFLOAT_MAX;
for (NSInteger i = lineFirstIndex; i <= idx; i++) {
MyLayoutEngine *subviewEngine = context->subviewEngines[i];
MyLayoutEngine *subviewEngine = context->subviewEngines[i];
MyViewTraits *subviewTraits = subviewEngine.currentSizeClass;
MyGravity subviewVertAlignment = MYVERTGRAVITY(subviewTraits.alignment);
UIFont *subviewFont = nil;
Expand Down
4 changes: 2 additions & 2 deletions MyLayout/Lib/MyFlowLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ - (CGSize)calcLayoutSize:(CGSize)size subviewEngines:(NSMutableArray<MyLayoutEng
MyFlowLayoutTraits *layoutTraits = (MyFlowLayoutTraits *)context->layoutViewEngine.currentSizeClass;
context->paddingTop = layoutTraits.myLayoutPaddingTop;
context->paddingBottom = layoutTraits.myLayoutPaddingBottom;
context->paddingLeading = layoutTraits.myLayoutLeadingPadding;
context->paddingTrailing = layoutTraits.myLayoutTrailingPadding;
context->paddingLeading = layoutTraits.myLayoutPaddingLeading;
context->paddingTrailing = layoutTraits.myLayoutPaddingTrailing;
context->vertGravity = MYVERTGRAVITY(layoutTraits.gravity);
context->horzGravity = [MyViewTraits convertLeadingTrailingGravityFromLeftRightGravity:MYHORZGRAVITY(layoutTraits.gravity)];
context->vertSpace = layoutTraits.subviewVSpace;
Expand Down
4 changes: 2 additions & 2 deletions MyLayout/Lib/MyFrameLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ - (CGSize)calcLayoutSize:(CGSize)size subviewEngines:(NSMutableArray<MyLayoutEng
MyFrameLayoutTraits *layoutTraits = (MyFrameLayoutTraits *)context->layoutViewEngine.currentSizeClass;
context->paddingTop = layoutTraits.myLayoutPaddingTop;
context->paddingBottom = layoutTraits.myLayoutPaddingBottom;
context->paddingLeading = layoutTraits.myLayoutLeadingPadding;
context->paddingTrailing = layoutTraits.myLayoutTrailingPadding;
context->paddingLeading = layoutTraits.myLayoutPaddingLeading;
context->paddingTrailing = layoutTraits.myLayoutPaddingTrailing;
context->vertGravity = MYVERTGRAVITY(layoutTraits.gravity);
context->horzGravity = [MyViewTraits convertLeadingTrailingGravityFromLeftRightGravity:MYHORZGRAVITY(layoutTraits.gravity)];
if (context->subviewEngines == nil) {
Expand Down
12 changes: 6 additions & 6 deletions MyLayout/Lib/MyGridLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,8 @@ - (CGSize)calcLayoutSize:(CGSize)size subviewEngines:(NSMutableArray *)subviewEn

context->paddingTop = layoutTraits.myLayoutPaddingTop;
context->paddingBottom = layoutTraits.myLayoutPaddingBottom;
context->paddingLeading = layoutTraits.myLayoutLeadingPadding;
context->paddingTrailing = layoutTraits.myLayoutTrailingPadding;
context->paddingLeading = layoutTraits.myLayoutPaddingLeading;
context->paddingTrailing = layoutTraits.myLayoutPaddingTrailing;
context->vertGravity = MYVERTGRAVITY(layoutTraits.gravity);
context->horzGravity = [MyViewTraits convertLeadingTrailingGravityFromLeftRightGravity:MYHORZGRAVITY(layoutTraits.gravity)];
context->vertSpace = layoutTraits.subviewVSpace;
Expand Down Expand Up @@ -750,9 +750,9 @@ - (void)myTraversalGrid:(id<MyGridNode>)grid gridOrigin:(CGPoint)gridOrigin layo
CGFloat paddingTrailing;
if (grid == (id<MyGridNode>)layoutTraits) {
paddingTop = layoutTraits.myLayoutPaddingTop;
paddingLeading = layoutTraits.myLayoutLeadingPadding;
paddingLeading = layoutTraits.myLayoutPaddingLeading;
paddingBottom = layoutTraits.myLayoutPaddingBottom;
paddingTrailing = layoutTraits.myLayoutTrailingPadding;
paddingTrailing = layoutTraits.myLayoutPaddingTrailing;
} else {
UIEdgeInsets gridPadding = grid.padding;
paddingTop = gridPadding.top;
Expand Down Expand Up @@ -928,9 +928,9 @@ - (CGFloat)myTraversalGrid:(id<MyGridNode>)grid gridSize:(CGSize)gridSize lsc:(M
CGFloat paddingTrailing;
if (grid == (id<MyGridNode>)lsc) {
paddingTop = lsc.myLayoutPaddingTop;
paddingLeading = lsc.myLayoutLeadingPadding;
paddingLeading = lsc.myLayoutPaddingLeading;
paddingBottom = lsc.myLayoutPaddingBottom;
paddingTrailing = lsc.myLayoutTrailingPadding;
paddingTrailing = lsc.myLayoutPaddingTrailing;
} else {
UIEdgeInsets gridPadding = grid.padding;
paddingTop = gridPadding.top;
Expand Down
4 changes: 2 additions & 2 deletions MyLayout/Lib/MyLayoutInner.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ typedef struct _MyLayoutContext {
- (CGFloat)myLayoutPaddingBottom;
- (CGFloat)myLayoutPaddingLeft;
- (CGFloat)myLayoutPaddingRight;
- (CGFloat)myLayoutLeadingPadding;
- (CGFloat)myLayoutTrailingPadding;
- (CGFloat)myLayoutPaddingLeading;
- (CGFloat)myLayoutPaddingTrailing;

- (void)myAdjustSizeSettingOfSubviewEngine:(MyLayoutEngine *)subviewEngine withContext:(MyLayoutContext *)context;

Expand Down
4 changes: 2 additions & 2 deletions MyLayout/Lib/MyLayoutSizeClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@
- (CGFloat)myLayoutPaddingBottom;
- (CGFloat)myLayoutPaddingLeft;
- (CGFloat)myLayoutPaddingRight;
- (CGFloat)myLayoutLeadingPadding;
- (CGFloat)myLayoutTrailingPadding;
- (CGFloat)myLayoutPaddingLeading;
- (CGFloat)myLayoutPaddingTrailing;

@property (nonatomic, assign) UIRectEdge insetsPaddingFromSafeArea;

Expand Down
8 changes: 4 additions & 4 deletions MyLayout/Lib/MyLayoutSizeClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ - (CGFloat)myLayoutPaddingBottom {
return self.paddingBottom;
}

- (CGFloat)myLayoutLeadingPadding {
- (CGFloat)myLayoutPaddingLeading {
if (self.paddingLeading >= MyLayoutPos.safeAreaMargin - 2000 && self.paddingLeading <= MyLayoutPos.safeAreaMargin + 2000) {
CGFloat paddingLeadingAdd = 0;
#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
Expand Down Expand Up @@ -785,7 +785,7 @@ - (CGFloat)myLayoutLeadingPadding {
return self.paddingLeading + inset;
}

- (CGFloat)myLayoutTrailingPadding {
- (CGFloat)myLayoutPaddingTrailing {
if (self.paddingTrailing >= MyLayoutPos.safeAreaMargin - 2000 && self.paddingTrailing <= MyLayoutPos.safeAreaMargin + 2000) {
CGFloat paddingTrailingAdd = 0;
#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
Expand Down Expand Up @@ -820,10 +820,10 @@ - (CGFloat)myLayoutTrailingPadding {
}

- (CGFloat)myLayoutPaddingLeft {
return [MyViewTraits isRTL] ? [self myLayoutTrailingPadding] : [self myLayoutLeadingPadding];
return [MyViewTraits isRTL] ? [self myLayoutPaddingTrailing] : [self myLayoutPaddingLeading];
}
- (CGFloat)myLayoutPaddingRight {
return [MyViewTraits isRTL] ? [self myLayoutLeadingPadding] : [self myLayoutTrailingPadding];
return [MyViewTraits isRTL] ? [self myLayoutPaddingLeading] : [self myLayoutPaddingTrailing];
}

- (CGFloat)subviewSpace {
Expand Down
4 changes: 2 additions & 2 deletions MyLayout/Lib/MyLinearLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ - (CGSize)calcLayoutSize:(CGSize)size subviewEngines:(NSMutableArray<MyLayoutEng
MyLinearLayoutTraits *layoutTraits = (MyLinearLayoutTraits *)context->layoutViewEngine.currentSizeClass;
context->paddingTop = layoutTraits.myLayoutPaddingTop;
context->paddingBottom = layoutTraits.myLayoutPaddingBottom;
context->paddingLeading = layoutTraits.myLayoutLeadingPadding;
context->paddingTrailing = layoutTraits.myLayoutTrailingPadding;
context->paddingLeading = layoutTraits.myLayoutPaddingLeading;
context->paddingTrailing = layoutTraits.myLayoutPaddingTrailing;
context->vertGravity = MYVERTGRAVITY(layoutTraits.gravity);
context->horzGravity = [MyViewTraits convertLeadingTrailingGravityFromLeftRightGravity:MYHORZGRAVITY(layoutTraits.gravity)];
context->vertSpace = layoutTraits.subviewVSpace;
Expand Down
12 changes: 6 additions & 6 deletions MyLayout/Lib/MyPathLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ - (void)beginSubviewPathPoint:(BOOL)full {
context.selfSize = self.bounds.size;
context.paddingTop = layoutTraits.myLayoutPaddingTop;
context.paddingBottom = layoutTraits.myLayoutPaddingBottom;
context.paddingLeading = layoutTraits.myLayoutLeadingPadding;
context.paddingTrailing = layoutTraits.myLayoutTrailingPadding;
context.paddingLeading = layoutTraits.myLayoutPaddingLeading;
context.paddingTrailing = layoutTraits.myLayoutPaddingTrailing;

if (full) {
NSMutableArray *pointIndexs = [NSMutableArray new];
Expand Down Expand Up @@ -351,8 +351,8 @@ - (CGPathRef)createPath:(NSInteger)subviewCount {
context.selfSize = self.bounds.size;
context.paddingTop = layoutTraits.myLayoutPaddingTop;
context.paddingBottom = layoutTraits.myLayoutPaddingBottom;
context.paddingLeading = layoutTraits.myLayoutLeadingPadding;
context.paddingTrailing = layoutTraits.myLayoutTrailingPadding;
context.paddingLeading = layoutTraits.myLayoutPaddingLeading;
context.paddingTrailing = layoutTraits.myLayoutPaddingTrailing;

CGMutablePathRef retPath = CGPathCreateMutable();

Expand Down Expand Up @@ -476,8 +476,8 @@ - (CGSize)calcLayoutSize:(CGSize)size subviewEngines:(NSMutableArray<MyLayoutEng
MyPathLayoutTraits *layoutTraits = (MyPathLayoutTraits *)context->layoutViewEngine.currentSizeClass;
context->paddingTop = layoutTraits.myLayoutPaddingTop;
context->paddingBottom = layoutTraits.myLayoutPaddingBottom;
context->paddingLeading = layoutTraits.myLayoutLeadingPadding;
context->paddingTrailing = layoutTraits.myLayoutTrailingPadding;
context->paddingLeading = layoutTraits.myLayoutPaddingLeading;
context->paddingTrailing = layoutTraits.myLayoutPaddingTrailing;
if (context->subviewEngines == nil) {
context->subviewEngines = [layoutTraits filterEngines:subviewEngines];
}
Expand Down
4 changes: 2 additions & 2 deletions MyLayout/Lib/MyRelativeLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ - (CGSize)calcLayoutSize:(CGSize)size subviewEngines:(NSMutableArray<MyLayoutEng
MyRelativeLayoutTraits *layoutTraits = (MyRelativeLayoutTraits *)context->layoutViewEngine.currentSizeClass;
context->paddingTop = layoutTraits.myLayoutPaddingTop;
context->paddingBottom = layoutTraits.myLayoutPaddingBottom;
context->paddingLeading = layoutTraits.myLayoutLeadingPadding;
context->paddingTrailing = layoutTraits.myLayoutTrailingPadding;
context->paddingLeading = layoutTraits.myLayoutPaddingLeading;
context->paddingTrailing = layoutTraits.myLayoutPaddingTrailing;
context->subviewEngines = subviewEngines;

if (layoutTraits.widthSizeInner.wrapVal) {
Expand Down

0 comments on commit af83fed

Please sign in to comment.