Expose layout paddding in java api

Summary: Expose layout padding api from D4376572

Reviewed By: passy

Differential Revision: D4377069

fbshipit-source-id: 2e0c04104560e1be586562b27b3457576590dc18
This commit is contained in:
Emil Sjolander
2017-01-05 12:48:10 -08:00
committed by Facebook Github Bot
parent bf5eeaf61e
commit e539ecc9aa
4 changed files with 57 additions and 0 deletions

View File

@@ -138,4 +138,21 @@ public class YogaNodeTest {
node0.copyStyle(node1);
assertEquals(100, (int) node0.getMaxHeight().value);
}
@Test
public void testLayoutPadding() {
final YogaNode node = new YogaNode();
node.setWidth(100);
node.setHeight(100);
node.setPadding(YogaEdge.START, 1);
node.setPadding(YogaEdge.END, 2);
node.setPadding(YogaEdge.TOP, 3);
node.setPadding(YogaEdge.BOTTOM, 4);
node.calculateLayout();
assertEquals(1, (int) node.getLayoutPadding(YogaEdge.LEFT));
assertEquals(2, (int) node.getLayoutPadding(YogaEdge.RIGHT));
assertEquals(3, (int) node.getLayoutPadding(YogaEdge.TOP));
assertEquals(4, (int) node.getLayoutPadding(YogaEdge.BOTTOM));
}
}