Skip to content

Commit 91d566d

Browse files
gedeagasaleclarson
authored andcommitted
Implementing space-evenly
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 react/react-native#17805 Differential Revision: D6858294 Pulled By: shergin fbshipit-source-id: 7a705ca05f58603ef4588e1bfd16c16a78f8a390
1 parent 0becf4f commit 91d566d

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

Libraries/StyleSheet/LayoutPropTypes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,8 @@ var LayoutPropTypes = {
449449
'flex-end',
450450
'center',
451451
'space-between',
452-
'space-around'
452+
'space-around',
453+
'space-evenly'
453454
]),
454455

455456
/** `alignItems` aligns children in the cross direction.

Libraries/StyleSheet/StyleSheetTypes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ export type LayoutStyle<+Dimension = DimensionValue> = {
5959
| 'flex-end'
6060
| 'center'
6161
| 'space-between'
62-
| 'space-around',
62+
| 'space-around'
63+
| 'space-evenly',
6364
+alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline',
6465
+alignSelf?:
6566
| 'auto'

React/Base/RCTConvert.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,8 @@ + (NSPropertyList)NSPropertyList:(id)json
593593
@"flex-end": @(YGJustifyFlexEnd),
594594
@"center": @(YGJustifyCenter),
595595
@"space-between": @(YGJustifySpaceBetween),
596-
@"space-around": @(YGJustifySpaceAround)
596+
@"space-around": @(YGJustifySpaceAround),
597+
@"space-evenly": @(YGJustifySpaceEvenly)
597598
}), YGJustifyFlexStart, intValue)
598599

599600
RCT_ENUM_CONVERTER(YGAlign, (@{

ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,10 @@ public void setJustifyContent(@Nullable String justifyContent) {
486486
setJustifyContent(YogaJustify.SPACE_AROUND);
487487
break;
488488
}
489+
case "space-evenly": {
490+
setJustifyContent(YogaJustify.SPACE_EVENLY);
491+
break;
492+
}
489493
default: {
490494
throw new JSApplicationIllegalArgumentException(
491495
"invalid value for justifyContent: " + justifyContent);

0 commit comments

Comments
 (0)