Skip to content

Commit

Permalink
Implementing space-evenly
Browse files Browse the repository at this point in the history
Summary:
So in v0.52.0 space-evenly is introduced but not yet implemented (1050e0b by woehrl01). This pull request implements the space-evenly.

Manual Testing.
![notes marker](https://i.imgur.com/IXmezVY.png)

[IOS] [FEATURE] [Yoga] Adding space-evenly on justify-content in iOS
[ANDROID] [FEATURE] [Yoga] - Adding space-evenly on justify-content in Android
Closes #17805

Differential Revision: D6858294

Pulled By: shergin

fbshipit-source-id: 7a705ca05f58603ef4588e1bfd16c16a78f8a390
  • Loading branch information
gedeagas authored and facebook-github-bot committed Jan 31, 2018
1 parent 3fbf785 commit b1cdb7d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Libraries/StyleSheet/LayoutPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ var LayoutPropTypes = {
'flex-end',
'center',
'space-between',
'space-around'
'space-around',
'space-evenly'
]),

/** `alignItems` aligns children in the cross direction.
Expand Down
3 changes: 2 additions & 1 deletion Libraries/StyleSheet/StyleSheetTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export type LayoutStyle<+Dimension = DimensionValue> = {
| 'flex-end'
| 'center'
| 'space-between'
| 'space-around',
| 'space-around'
| 'space-evenly',
+alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline',
+alignSelf?:
| 'auto'
Expand Down
3 changes: 2 additions & 1 deletion React/Base/RCTConvert.m
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ + (NSPropertyList)NSPropertyList:(id)json
@"flex-end": @(YGJustifyFlexEnd),
@"center": @(YGJustifyCenter),
@"space-between": @(YGJustifySpaceBetween),
@"space-around": @(YGJustifySpaceAround)
@"space-around": @(YGJustifySpaceAround),
@"space-evenly": @(YGJustifySpaceEvenly)
}), YGJustifyFlexStart, intValue)

RCT_ENUM_CONVERTER(YGAlign, (@{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ public void setJustifyContent(@Nullable String justifyContent) {
setJustifyContent(YogaJustify.SPACE_AROUND);
break;
}
case "space-evenly": {
setJustifyContent(YogaJustify.SPACE_EVENLY);
break;
}
default: {
throw new JSApplicationIllegalArgumentException(
"invalid value for justifyContent: " + justifyContent);
Expand Down

0 comments on commit b1cdb7d

Please sign in to comment.