Skip to content

Commit 32ec5d5

Browse files
mateoguzmanameta-codesync[bot]
authored andcommitted
Migrate YogaProps to Kotlin (#1844)
Summary: X-link: facebook/react-native#55349 Migrate com.facebook.yoga.YogaProps to Kotlin. Pull Request resolved: #1844 Test Plan: RN ```sh yarn android yarn test-android ``` Yoga ```sh ./gradlew :yoga:assembleDebug ``` Reviewed By: rshest Differential Revision: D79897771 Pulled By: cortinico fbshipit-source-id: 65052bca9a26bbb1f0a56bcbcc75403fa2fdcd71
1 parent 526a220 commit 32ec5d5

3 files changed

Lines changed: 206 additions & 248 deletions

File tree

java/com/facebook/yoga/YogaNode.kt

Lines changed: 23 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -56,59 +56,37 @@ public abstract class YogaNode : YogaProps {
5656

5757
public abstract fun markLayoutSeen()
5858

59-
abstract override fun getStyleDirection(): YogaDirection
59+
abstract override val styleDirection: YogaDirection
6060

6161
abstract override fun setDirection(direction: YogaDirection)
6262

63-
abstract override fun getFlexDirection(): YogaFlexDirection
63+
abstract override var flexDirection: YogaFlexDirection
6464

65-
abstract override fun setFlexDirection(flexDirection: YogaFlexDirection)
65+
abstract override var justifyContent: YogaJustify
6666

67-
abstract override fun getJustifyContent(): YogaJustify
67+
abstract override var alignItems: YogaAlign
6868

69-
abstract override fun setJustifyContent(justifyContent: YogaJustify)
69+
abstract override var alignSelf: YogaAlign
7070

71-
abstract override fun getAlignItems(): YogaAlign
71+
abstract override var alignContent: YogaAlign
7272

73-
abstract override fun setAlignItems(alignItems: YogaAlign)
73+
abstract override var positionType: YogaPositionType
7474

75-
abstract override fun getAlignSelf(): YogaAlign
75+
abstract override var boxSizing: YogaBoxSizing
7676

77-
abstract override fun setAlignSelf(alignSelf: YogaAlign)
78-
79-
abstract override fun getAlignContent(): YogaAlign
80-
81-
abstract override fun setAlignContent(alignContent: YogaAlign)
82-
83-
abstract override fun getPositionType(): YogaPositionType
84-
85-
abstract override fun setPositionType(positionType: YogaPositionType)
86-
87-
abstract override fun getBoxSizing(): YogaBoxSizing?
88-
89-
abstract override fun setBoxSizing(boxSizing: YogaBoxSizing?)
90-
91-
abstract override fun getWrap(): YogaWrap
92-
93-
abstract override fun setWrap(wrap: YogaWrap)
77+
abstract override var wrap: YogaWrap
9478

9579
public abstract var overflow: YogaOverflow?
9680

9781
public abstract var display: YogaDisplay?
9882

99-
abstract override fun getFlex(): Float
100-
101-
abstract override fun setFlex(flex: Float)
83+
abstract override var flex: Float
10284

103-
abstract override fun getFlexGrow(): Float
85+
abstract override var flexGrow: Float
10486

105-
abstract override fun setFlexGrow(flexGrow: Float)
87+
abstract override var flexShrink: Float
10688

107-
abstract override fun getFlexShrink(): Float
108-
109-
abstract override fun setFlexShrink(flexShrink: Float)
110-
111-
abstract override fun getFlexBasis(): YogaValue
89+
abstract override val flexBasis: YogaValue
11290

11391
abstract override fun setFlexBasis(flexBasis: Float)
11492

@@ -138,7 +116,7 @@ public abstract class YogaNode : YogaProps {
138116

139117
abstract override fun getBorder(edge: YogaEdge): Float
140118

141-
abstract override fun setBorder(edge: YogaEdge, border: Float)
119+
abstract override fun setBorder(edge: YogaEdge, value: Float)
142120

143121
abstract override fun getPosition(edge: YogaEdge): YogaValue
144122

@@ -148,7 +126,7 @@ public abstract class YogaNode : YogaProps {
148126

149127
public abstract fun setPositionAuto(edge: YogaEdge)
150128

151-
abstract override fun getWidth(): YogaValue
129+
abstract override val width: YogaValue
152130

153131
abstract override fun setWidth(width: Float)
154132

@@ -162,7 +140,7 @@ public abstract class YogaNode : YogaProps {
162140

163141
abstract override fun setWidthStretch()
164142

165-
abstract override fun getHeight(): YogaValue
143+
abstract override val height: YogaValue
166144

167145
abstract override fun setHeight(height: Float)
168146

@@ -176,7 +154,7 @@ public abstract class YogaNode : YogaProps {
176154

177155
abstract override fun setHeightStretch()
178156

179-
abstract override fun getMinWidth(): YogaValue
157+
abstract override val minWidth: YogaValue
180158

181159
abstract override fun setMinWidth(minWidth: Float)
182160

@@ -188,7 +166,7 @@ public abstract class YogaNode : YogaProps {
188166

189167
abstract override fun setMinWidthStretch()
190168

191-
abstract override fun getMinHeight(): YogaValue
169+
abstract override val minHeight: YogaValue
192170

193171
abstract override fun setMinHeight(minHeight: Float)
194172

@@ -200,7 +178,7 @@ public abstract class YogaNode : YogaProps {
200178

201179
abstract override fun setMinHeightStretch()
202180

203-
abstract override fun getMaxWidth(): YogaValue
181+
abstract override val maxWidth: YogaValue
204182

205183
abstract override fun setMaxWidth(maxWidth: Float)
206184

@@ -212,9 +190,9 @@ public abstract class YogaNode : YogaProps {
212190

213191
abstract override fun setMaxWidthStretch()
214192

215-
abstract override fun getMaxHeight(): YogaValue
193+
abstract override val maxHeight: YogaValue
216194

217-
abstract override fun setMaxHeight(maxheight: Float)
195+
abstract override fun setMaxHeight(maxHeight: Float)
218196

219197
abstract override fun setMaxHeightPercent(percent: Float)
220198

@@ -224,9 +202,7 @@ public abstract class YogaNode : YogaProps {
224202

225203
abstract override fun setMaxHeightStretch()
226204

227-
abstract override fun getAspectRatio(): Float
228-
229-
abstract override fun setAspectRatio(aspectRatio: Float)
205+
abstract override var aspectRatio: Float
230206

231207
public abstract fun getGap(gutter: YogaGutter): YogaValue
232208

@@ -252,7 +228,7 @@ public abstract class YogaNode : YogaProps {
252228

253229
abstract override fun setMeasureFunction(measureFunction: YogaMeasureFunction)
254230

255-
abstract override fun setBaselineFunction(baselineFunction: YogaBaselineFunction)
231+
abstract override fun setBaselineFunction(yogaBaselineFunction: YogaBaselineFunction)
256232

257233
public abstract val isMeasureDefined: Boolean
258234

java/com/facebook/yoga/YogaProps.java

Lines changed: 0 additions & 201 deletions
This file was deleted.

0 commit comments

Comments
 (0)