本文整理汇总了Java中com.facebook.csslayout.CSSJustify类的典型用法代码示例。如果您正苦于以下问题:Java CSSJustify类的具体用法?Java CSSJustify怎么用?Java CSSJustify使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CSSJustify类属于com.facebook.csslayout包,在下文中一共展示了CSSJustify类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setJustfiyContent
import com.facebook.csslayout.CSSJustify; //导入依赖的package包/类
private static void setJustfiyContent() {
String justifyContent = mInlineMap.get(JUSTIFYCONTENT);
if (justifyContent != null) {
CSSJustify juc = justifyMap.get(justifyContent);
if (juc != null) {
mNode.setJustifyContent(juc);
}
}
}
示例2: testEnumerations
import com.facebook.csslayout.CSSJustify; //导入依赖的package包/类
@Test
public void testEnumerations() {
LayoutShadowNode reactShadowNode = spy(new LayoutShadowNode());
ReactStylesDiffMap map = buildStyles(
"flexDirection", "column",
"alignSelf", "stretch",
"alignItems", "center",
"justifyContent", "space_between",
"position", "relative");
reactShadowNode.updateProperties(map);
verify(reactShadowNode).setFlexDirection(CSSFlexDirection.COLUMN);
verify(reactShadowNode).setAlignSelf(CSSAlign.STRETCH);
verify(reactShadowNode).setAlignItems(CSSAlign.CENTER);
verify(reactShadowNode).setJustifyContent(CSSJustify.SPACE_BETWEEN);
verify(reactShadowNode).setPositionType(CSSPositionType.RELATIVE);
reactShadowNode = spy(new LayoutShadowNode());
map = buildStyles();
reactShadowNode.updateProperties(map);
verify(reactShadowNode, never()).setFlexDirection(any(CSSFlexDirection.class));
verify(reactShadowNode, never()).setAlignSelf(any(CSSAlign.class));
verify(reactShadowNode, never()).setAlignItems(any(CSSAlign.class));
verify(reactShadowNode, never()).setJustifyContent(any(CSSJustify.class));
verify(reactShadowNode, never()).setPositionType(any(CSSPositionType.class));
}
示例3: testEnumerations
import com.facebook.csslayout.CSSJustify; //导入依赖的package包/类
@Test
public void testEnumerations() {
LayoutShadowNode reactShadowNode = spy(new LayoutShadowNode());
ReactStylesDiffMap map = buildStyles(
"flexDirection",
"column",
"alignSelf",
"stretch",
"alignItems",
"center",
"justifyContent",
"space_between",
"position",
"relative");
reactShadowNode.updateProperties(map);
verify(reactShadowNode).setFlexDirection(CSSFlexDirection.COLUMN);
verify(reactShadowNode).setAlignSelf(CSSAlign.STRETCH);
verify(reactShadowNode).setAlignItems(CSSAlign.CENTER);
verify(reactShadowNode).setJustifyContent(CSSJustify.SPACE_BETWEEN);
verify(reactShadowNode).setPositionType(CSSPositionType.RELATIVE);
reactShadowNode = spy(new LayoutShadowNode());
map = buildStyles();
reactShadowNode.updateProperties(map);
verify(reactShadowNode, never()).setFlexDirection(any(CSSFlexDirection.class));
verify(reactShadowNode, never()).setAlignSelf(any(CSSAlign.class));
verify(reactShadowNode, never()).setAlignItems(any(CSSAlign.class));
verify(reactShadowNode, never()).setJustifyContent(any(CSSJustify.class));
verify(reactShadowNode, never()).setPositionType(any(CSSPositionType.class));
}
示例4: clear
import com.facebook.csslayout.CSSJustify; //导入依赖的package包/类
public void clear() {
style.direction = CSSDirection.INHERIT;
style.flexDirection = CSSFlexDirection.COLUMN;
style.justifyContent = CSSJustify.FLEX_START;
style.alignContent = CSSAlign.FLEX_START;
style.alignItems = CSSAlign.STRETCH;
style.alignSelf = CSSAlign.AUTO;
style.positionType = CSSPositionType.RELATIVE;
style.flexWrap = CSSWrap.NOWRAP;
style.flex = 0;
style.margin = new Spacing();
style.padding = new Spacing();
style.border = new Spacing();
style.positionTop = CSSConstants.UNDEFINED;
style.positionBottom = CSSConstants.UNDEFINED;
style.positionLeft = CSSConstants.UNDEFINED;
style.positionRight = CSSConstants.UNDEFINED;
style.width = CSSConstants.UNDEFINED;
style.height = CSSConstants.UNDEFINED;
style.minWidth = CSSConstants.UNDEFINED;
style.minHeight = CSSConstants.UNDEFINED;
style.maxWidth = CSSConstants.UNDEFINED;
style.maxHeight = CSSConstants.UNDEFINED;
}
示例5: setJustifyContent
import com.facebook.csslayout.CSSJustify; //导入依赖的package包/类
@ReactProp(name = ViewProps.JUSTIFY_CONTENT)
public void setJustifyContent(@Nullable String justifyContent) {
setJustifyContent(justifyContent == null ? CSSJustify.FLEX_START : CSSJustify.valueOf(
justifyContent.toUpperCase(Locale.US).replace("-", "_")));
}
示例6: testPropertiesResetToDefault
import com.facebook.csslayout.CSSJustify; //导入依赖的package包/类
@Test
public void testPropertiesResetToDefault() {
DisplayMetrics displayMetrics = new DisplayMetrics();
displayMetrics.density = 1.0f;
DisplayMetricsHolder.setWindowDisplayMetrics(displayMetrics);
LayoutShadowNode reactShadowNode = spy(new LayoutShadowNode());
ReactStylesDiffMap map = buildStyles(
"width", 10.0,
"height", 10.0,
"left", 10.0,
"top", 10.0,
"flex", 1.0,
"padding", 10.0,
"marginLeft", 10.0,
"borderTopWidth", 10.0,
"flexDirection", "row",
"alignSelf", "stretch",
"alignItems", "center",
"justifyContent", "space_between",
"position", "absolute");
reactShadowNode.updateProperties(map);
verify(reactShadowNode).setStyleWidth(10.f);
verify(reactShadowNode).setStyleHeight(10.f);
verify(reactShadowNode).setPositionLeft(10.f);
verify(reactShadowNode).setPositionTop(10.f);
verify(reactShadowNode).setFlex(1.0f);
verify(reactShadowNode).setPadding(Spacing.ALL, 10.f);
verify(reactShadowNode).setMargin(Spacing.LEFT, 10.f);
verify(reactShadowNode).setBorder(Spacing.TOP, 10.f);
verify(reactShadowNode).setFlexDirection(CSSFlexDirection.ROW);
verify(reactShadowNode).setAlignSelf(CSSAlign.STRETCH);
verify(reactShadowNode).setAlignItems(CSSAlign.CENTER);
verify(reactShadowNode).setJustifyContent(CSSJustify.SPACE_BETWEEN);
verify(reactShadowNode).setPositionType(CSSPositionType.ABSOLUTE);
map = buildStyles(
"width", null,
"height", null,
"left", null,
"top", null,
"flex", null,
"padding", null,
"marginLeft", null,
"borderTopWidth", null,
"flexDirection", null,
"alignSelf", null,
"alignItems", null,
"justifyContent", null,
"position", null);
reset(reactShadowNode);
reactShadowNode.updateProperties(map);
verify(reactShadowNode).setStyleWidth(CSSConstants.UNDEFINED);
verify(reactShadowNode).setStyleHeight(CSSConstants.UNDEFINED);
verify(reactShadowNode).setPositionLeft(CSSConstants.UNDEFINED);
verify(reactShadowNode).setPositionTop(CSSConstants.UNDEFINED);
verify(reactShadowNode).setFlex(0.f);
verify(reactShadowNode).setPadding(Spacing.ALL, CSSConstants.UNDEFINED);
verify(reactShadowNode).setMargin(Spacing.LEFT, CSSConstants.UNDEFINED);
verify(reactShadowNode).setBorder(Spacing.TOP, CSSConstants.UNDEFINED);
verify(reactShadowNode).setFlexDirection(CSSFlexDirection.COLUMN);
verify(reactShadowNode).setAlignSelf(CSSAlign.AUTO);
verify(reactShadowNode).setAlignItems(CSSAlign.STRETCH);
verify(reactShadowNode).setJustifyContent(CSSJustify.FLEX_START);
verify(reactShadowNode).setPositionType(CSSPositionType.RELATIVE);
}
示例7: parseCssAttribute
import com.facebook.csslayout.CSSJustify; //导入依赖的package包/类
private void parseCssAttribute(Context context, AttributeSet attrs) {
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.CSSLayout);
final int N = a.getIndexCount();
for (int i = 0; i < N; i++) {
int attr = a.getIndex(i);
switch (attr) {
case R.styleable.CSSLayout_direction:
setDirection(getEnum(a.getInt(attr, 0), CSSDirection.class));
break;
case R.styleable.CSSLayout_flexDirection:
setFlexDirection(getEnum(a.getInt(attr, 0), CSSFlexDirection.class));
break;
case R.styleable.CSSLayout_justifyContent:
setJustifyContent(getEnum(a.getInt(attr, 0), CSSJustify.class));
break;
case R.styleable.CSSLayout_alignContent:
setAlignContent(getEnum(a.getInt(attr, 0), CSSAlign.class));
break;
case R.styleable.CSSLayout_alignItems:
setAlignItems(getEnum(a.getInt(attr, 0), CSSAlign.class));
break;
case R.styleable.CSSLayout_flexWrap:
setFlexWrap(getEnum(a.getInt(attr, 0), CSSWrap.class));
break;
case R.styleable.CSSLayout_padding:
setPadding(a.getDimension(attr, 0));
break;
case R.styleable.CSSLayout_paddingLeft:
setPaddingLeft(a.getDimension(attr, 0));
break;
case R.styleable.CSSLayout_paddingRight:
setPaddingRight(a.getDimension(attr, 0));
break;
case R.styleable.CSSLayout_paddingTop:
setPaddingTop(a.getDimension(attr, 0));
break;
case R.styleable.CSSLayout_paddingBottom:
setPaddingBottom(a.getDimension(attr, 0));
break;
case R.styleable.CSSLayout_borderWidth:
setBorderWidth(a.getDimension(attr, 0));
break;
case R.styleable.CSSLayout_borderLeftWidth:
setBorderLeftWidth(a.getDimension(attr, 0));
break;
case R.styleable.CSSLayout_borderRightWidth:
setBorderRightWidth(a.getDimension(attr, 0));
break;
case R.styleable.CSSLayout_borderTopWidth:
setBorderTopWidth(a.getDimension(attr, 0));
break;
case R.styleable.CSSLayout_borderBottomWidth:
setBorderBottomWidth(a.getDimension(attr, 0));
break;
}
}
a.recycle();
}
示例8: setJustifyContent
import com.facebook.csslayout.CSSJustify; //导入依赖的package包/类
public void setJustifyContent(CSSJustify justifyContent) {
mCSSNode.setJustifyContent(justifyContent);
requestLayoutWhithoutDirty();
}