Java 类com.facebook.yoga.YogaEdge 实例源码

项目:litho-glide    文件:TitleComponentSpec.java   
@OnCreateLayout
static ComponentLayout onCreateLayout(
    ComponentContext c,
    @Prop(resType = STRING) String title) {
  return Text.create(c)
      .text(title)
      .textStyle(BOLD)
      .textSizeDip(24)
      .withLayout().flexShrink(0)
      .backgroundColor(0xDDFFFFFF)
      .positionType(YogaPositionType.ABSOLUTE)
      .positionDip(YogaEdge.BOTTOM, 4)
      .positionDip(YogaEdge.LEFT, 4)
      .paddingDip(YogaEdge.HORIZONTAL, 6)
      .build();
}
项目:litho-picasso    文件:TitleComponentSpec.java   
@OnCreateLayout
static ComponentLayout onCreateLayout(
    ComponentContext c,
    @Prop(resType = STRING) String title) {
  return Text.create(c)
      .text(title)
      .textStyle(BOLD)
      .textSizeDip(24)
      .withLayout().flexShrink(0)
      .backgroundColor(0xDDFFFFFF)
      .positionType(YogaPositionType.ABSOLUTE)
      .positionDip(YogaEdge.BOTTOM, 4)
      .positionDip(YogaEdge.LEFT, 4)
      .paddingDip(YogaEdge.HORIZONTAL, 6)
      .build();
}
项目:litho-glide    文件:ActionsComponentSpec.java   
@OnCreateLayout
static ComponentLayout onCreateLayout(
    ComponentContext c) {
  return Row.create(c)
      .backgroundColor(0xDDFFFFFF)
      .positionType(YogaPositionType.ABSOLUTE)
      .positionDip(YogaEdge.RIGHT, 4)
      .positionDip(YogaEdge.TOP, 4)
      .paddingDip(YogaEdge.ALL, 2)
      .child(FavouriteButton.create(c))
      .build();
}
项目:litho-glide    文件:LithographyRootComponentSpec.java   
@OnCreateLayout static ComponentLayout onCreateLayout(ComponentContext c,
    @Prop final RecyclerBinder recyclerBinder) {

  return Recycler.create(c)
      .binder(recyclerBinder)
      .flexShrink(0)
      .paddingDip(YogaEdge.TOP, 8)
      .testKey(MAIN_SCREEN)
      .buildWithLayout();
}
项目:litho-glide    文件:DecadeSeparatorSpec.java   
@OnCreateLayout
static ComponentLayout onCreateLayout(
    ComponentContext c,
    @Prop final Decade decade) {
  return Row.create(c)
      .alignItems(YogaAlign.CENTER)
      .paddingDip(YogaEdge.ALL, 16)
      .child(
          Row.create(c)
              .heightPx(1)
              .backgroundColor(0xFFAAAAAA)
              .flex(1))
      .child(
          Text.create(c)
              .text(String.valueOf(decade.year))
              .textSizeDip(14)
              .textColor(0xFFAAAAAA)
              .withLayout()
              .marginDip(YogaEdge.HORIZONTAL, 10)
              .flex(0))
      .child(
          Row.create(c)
              .heightPx(1)
              .backgroundColor(0xFFAAAAAA)
              .flex(1))
      .backgroundColor(0xFFFAFAFA)
      .build();
}
项目:litho-glide    文件:FooterComponentSpec.java   
@OnCreateLayout
static ComponentLayout onCreateLayout(
    ComponentContext c,
    @Prop(resType = STRING) String text) {
  return Column.create(c).flexShrink(0).alignContent(YogaAlign.FLEX_START)
      .paddingDip(YogaEdge.ALL, 8)
      .child(
          Text.create(c)
              .text(text)
              .textSizeDip(14)
              .textColor(GRAY)
              .textStyle(ITALIC))
      .build();
}
项目:litho-picasso    文件:ActionsComponentSpec.java   
@OnCreateLayout
static ComponentLayout onCreateLayout(
    ComponentContext c) {
  return Row.create(c)
      .backgroundColor(0xDDFFFFFF)
      .positionType(YogaPositionType.ABSOLUTE)
      .positionDip(YogaEdge.RIGHT, 4)
      .positionDip(YogaEdge.TOP, 4)
      .paddingDip(YogaEdge.ALL, 2)
      .child(FavouriteButton.create(c))
      .build();
}
项目:litho-picasso    文件:LithographyRootComponentSpec.java   
@OnCreateLayout
static ComponentLayout onCreateLayout(
    ComponentContext c,
    @Prop final RecyclerBinder recyclerBinder) {

  return Recycler.create(c)
      .binder(recyclerBinder)
      .withLayout().flexShrink(0)
      .paddingDip(YogaEdge.TOP, 8)
      .testKey(MAIN_SCREEN)
      .build();
}
项目:litho-picasso    文件:DecadeSeparatorSpec.java   
@OnCreateLayout
static ComponentLayout onCreateLayout(
    ComponentContext c,
    @Prop final Decade decade) {
  return Row.create(c)
      .alignItems(YogaAlign.CENTER)
      .paddingDip(YogaEdge.ALL, 16)
      .child(
          Row.create(c)
              .heightPx(1)
              .backgroundColor(0xFFAAAAAA)
              .flex(1))
      .child(
          Text.create(c)
              .text(String.valueOf(decade.year))
              .textSizeDip(14)
              .textColor(0xFFAAAAAA)
              .withLayout()
              .marginDip(YogaEdge.HORIZONTAL, 10)
              .flex(0))
      .child(
          Row.create(c)
              .heightPx(1)
              .backgroundColor(0xFFAAAAAA)
              .flex(1))
      .backgroundColor(0xFFFAFAFA)
      .build();
}
项目:litho-picasso    文件:FooterComponentSpec.java   
@OnCreateLayout
static ComponentLayout onCreateLayout(
    ComponentContext c,
    @Prop(resType = STRING) String text) {
  return Column.create(c).flexShrink(0).alignContent(YogaAlign.FLEX_START)
      .paddingDip(YogaEdge.ALL, 8)
      .child(
          Text.create(c)
              .text(text)
              .textSizeDip(14)
              .textColor(GRAY)
              .textStyle(ITALIC))
      .build();
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
private void updatePadding() {
  for (int spacingType = Spacing.LEFT; spacingType <= Spacing.ALL; spacingType++) {
    if (spacingType == Spacing.LEFT ||
        spacingType == Spacing.RIGHT ||
        spacingType == Spacing.START ||
        spacingType == Spacing.END) {
      if (YogaConstants.isUndefined(mPadding[spacingType]) &&
          YogaConstants.isUndefined(mPadding[Spacing.HORIZONTAL]) &&
          YogaConstants.isUndefined(mPadding[Spacing.ALL])) {
        mYogaNode.setPadding(YogaEdge.fromInt(spacingType), mDefaultPadding.getRaw(spacingType));
        continue;
      }
    } else if (spacingType == Spacing.TOP || spacingType == Spacing.BOTTOM) {
      if (YogaConstants.isUndefined(mPadding[spacingType]) &&
          YogaConstants.isUndefined(mPadding[Spacing.VERTICAL]) &&
          YogaConstants.isUndefined(mPadding[Spacing.ALL])) {
        mYogaNode.setPadding(YogaEdge.fromInt(spacingType), mDefaultPadding.getRaw(spacingType));
        continue;
      }
    } else {
      if (YogaConstants.isUndefined(mPadding[spacingType])) {
        mYogaNode.setPadding(YogaEdge.fromInt(spacingType), mDefaultPadding.getRaw(spacingType));
        continue;
      }
    }

    if (mPaddingIsPercent[spacingType]) {
      mYogaNode.setPaddingPercent(YogaEdge.fromInt(spacingType), mPadding[spacingType]);
    } else {
      mYogaNode.setPadding(YogaEdge.fromInt(spacingType), mPadding[spacingType]);
    }
  }
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
private void updatePadding() {
  for (int spacingType = Spacing.LEFT; spacingType <= Spacing.ALL; spacingType++) {
    if (spacingType == Spacing.LEFT ||
        spacingType == Spacing.RIGHT ||
        spacingType == Spacing.START ||
        spacingType == Spacing.END) {
      if (YogaConstants.isUndefined(mPadding[spacingType]) &&
          YogaConstants.isUndefined(mPadding[Spacing.HORIZONTAL]) &&
          YogaConstants.isUndefined(mPadding[Spacing.ALL])) {
        mYogaNode.setPadding(YogaEdge.fromInt(spacingType), mDefaultPadding.getRaw(spacingType));
        continue;
      }
    } else if (spacingType == Spacing.TOP || spacingType == Spacing.BOTTOM) {
      if (YogaConstants.isUndefined(mPadding[spacingType]) &&
          YogaConstants.isUndefined(mPadding[Spacing.VERTICAL]) &&
          YogaConstants.isUndefined(mPadding[Spacing.ALL])) {
        mYogaNode.setPadding(YogaEdge.fromInt(spacingType), mDefaultPadding.getRaw(spacingType));
        continue;
      }
    } else {
      if (YogaConstants.isUndefined(mPadding[spacingType])) {
        mYogaNode.setPadding(YogaEdge.fromInt(spacingType), mDefaultPadding.getRaw(spacingType));
        continue;
      }
    }

    if (mPaddingIsPercent[spacingType]) {
      mYogaNode.setPaddingPercent(YogaEdge.fromInt(spacingType), mPadding[spacingType]);
    } else {
      mYogaNode.setPadding(YogaEdge.fromInt(spacingType), mPadding[spacingType]);
    }
  }
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public void setMargin(int spacingType, float margin) {
  mYogaNode.setMargin(YogaEdge.fromInt(spacingType), margin);
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public void setMarginPercent(int spacingType, float percent) {
  mYogaNode.setMarginPercent(YogaEdge.fromInt(spacingType), percent);
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public void setMarginAuto(int spacingType) {
  mYogaNode.setMarginAuto(YogaEdge.fromInt(spacingType));
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public final float getPadding(int spacingType) {
  return mYogaNode.getLayoutPadding(YogaEdge.fromInt(spacingType));
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public final YogaValue getStylePadding(int spacingType) {
  return mYogaNode.getPadding(YogaEdge.fromInt(spacingType));
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public void setBorder(int spacingType, float borderWidth) {
  mYogaNode.setBorder(YogaEdge.fromInt(spacingType), borderWidth);
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public void setPosition(int spacingType, float position) {
  mYogaNode.setPosition(YogaEdge.fromInt(spacingType), position);
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public void setPositionPercent(int spacingType, float percent) {
  mYogaNode.setPositionPercent(YogaEdge.fromInt(spacingType), percent);
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public void setMargin(int spacingType, float margin) {
  mYogaNode.setMargin(YogaEdge.fromInt(spacingType), margin);
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public void setMarginPercent(int spacingType, float percent) {
  mYogaNode.setMarginPercent(YogaEdge.fromInt(spacingType), percent);
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public void setMarginAuto(int spacingType) {
  mYogaNode.setMarginAuto(YogaEdge.fromInt(spacingType));
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public final float getPadding(int spacingType) {
  return mYogaNode.getLayoutPadding(YogaEdge.fromInt(spacingType));
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public final YogaValue getStylePadding(int spacingType) {
  return mYogaNode.getPadding(YogaEdge.fromInt(spacingType));
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public void setBorder(int spacingType, float borderWidth) {
  mYogaNode.setBorder(YogaEdge.fromInt(spacingType), borderWidth);
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public void setPosition(int spacingType, float position) {
  mYogaNode.setPosition(YogaEdge.fromInt(spacingType), position);
}
项目:RNLearn_Project1    文件:ReactShadowNode.java   
public void setPositionPercent(int spacingType, float percent) {
  mYogaNode.setPositionPercent(YogaEdge.fromInt(spacingType), percent);
}