Android bindings for display property

Summary: Diff D4501141 added display attributes for Yoga.  This exposes them in the android library.

Reviewed By: emilsjolander

Differential Revision: D4605574

fbshipit-source-id: dbad3d6fe924682c6b81f65bbba9727085de2d81
This commit is contained in:
Robert Spencer
2017-02-28 00:24:34 -08:00
committed by Facebook Github Bot
parent 6a60d4893e
commit 533f560ce0
2 changed files with 8 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ import com.facebook.yoga.android.R;
import com.facebook.yoga.YogaAlign;
import com.facebook.yoga.YogaConstants;
import com.facebook.yoga.YogaDirection;
import com.facebook.yoga.YogaDisplay;
import com.facebook.yoga.YogaEdge;
import com.facebook.yoga.YogaFlexDirection;
import com.facebook.yoga.YogaJustify;
@@ -411,6 +412,8 @@ public class YogaLayout extends ViewGroup {
node.setBorder(YogaEdge.ALL, value);
} else if (attribute == R.styleable.yoga_direction) {
node.setDirection(YogaDirection.fromInt(Math.round(value)));
} else if (attribute == R.styleable.yoga_display) {
node.setDisplay(YogaDisplay.fromInt(Math.round(value)));
} else if (attribute == R.styleable.yoga_flex) {
node.setFlex(value);
} else if (attribute == R.styleable.yoga_flex_basis) {

View File

@@ -57,6 +57,11 @@
<enum name="rtl" value="2"/>
</attr>
<attr name="display" format="enum">
<enum name="flex" value="0"/>
<enum name="none" value="1"/>
</attr>
<attr name="flex" format="float"/>
<attr name="flex_basis" format="float"/>