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 https://github.com/facebook/react-native/pull/17805

Differential Revision: D6858294

Pulled By: shergin

fbshipit-source-id: 7a705ca05f58603ef4588e1bfd16c16a78f8a390
This commit is contained in:
Agastya Darma 2018-01-31 10:03:26 -08:00 committed by Facebook Github Bot
parent 3fbf7856d9
commit b1cdb7d553
4 changed files with 10 additions and 3 deletions

View File

@ -449,7 +449,8 @@ var LayoutPropTypes = {
'flex-end',
'center',
'space-between',
'space-around'
'space-around',
'space-evenly'
]),
/** `alignItems` aligns children in the cross direction.

View File

@ -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'

View File

@ -659,7 +659,8 @@ RCT_ENUM_CONVERTER(YGJustify, (@{
@"flex-end": @(YGJustifyFlexEnd),
@"center": @(YGJustifyCenter),
@"space-between": @(YGJustifySpaceBetween),
@"space-around": @(YGJustifySpaceAround)
@"space-around": @(YGJustifySpaceAround),
@"space-evenly": @(YGJustifySpaceEvenly)
}), YGJustifyFlexStart, intValue)
RCT_ENUM_CONVERTER(YGAlign, (@{

View File

@ -486,6 +486,10 @@ public class LayoutShadowNode extends ReactShadowNodeImpl {
setJustifyContent(YogaJustify.SPACE_AROUND);
break;
}
case "space-evenly": {
setJustifyContent(YogaJustify.SPACE_EVENLY);
break;
}
default: {
throw new JSApplicationIllegalArgumentException(
"invalid value for justifyContent: " + justifyContent);