• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CSSJustify类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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);
        }
    }
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:10,代码来源:FlexboxCSSParser.java


示例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));
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:28,代码来源:LayoutPropertyApplicatorTest.java


示例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));
}
 
开发者ID:Right-Men,项目名称:Ironman,代码行数:33,代码来源:LayoutPropertyApplicatorTest.java


示例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;
}
 
开发者ID:zhangyuanwei,项目名称:CSSLayout,代码行数:30,代码来源:CSSLayout.java


示例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("-", "_")));
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:6,代码来源:LayoutShadowNode.java


示例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);
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:69,代码来源:LayoutPropertyApplicatorTest.java


示例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();
}
 
开发者ID:zhangyuanwei,项目名称:CSSLayout,代码行数:64,代码来源:CSSLayout.java


示例8: setJustifyContent

import com.facebook.csslayout.CSSJustify; //导入依赖的package包/类
public void setJustifyContent(CSSJustify justifyContent) {
    mCSSNode.setJustifyContent(justifyContent);
    requestLayoutWhithoutDirty();
}
 
开发者ID:zhangyuanwei,项目名称:CSSLayout,代码行数:5,代码来源:CSSLayout.java



注:本文中的com.facebook.csslayout.CSSJustify类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DynFixed类代码示例发布时间:2022-05-22
下一篇:
Java Criterion类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap