本文整理了Java中com.facebook.yoga.YogaEdge
类的一些代码示例,展示了YogaEdge
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YogaEdge
类的具体详情如下:
包路径:com.facebook.yoga.YogaEdge
类名称:YogaEdge
暂无
代码示例来源:origin: facebook/litho
private void setIsPaddingPercent(YogaEdge edge, boolean isPaddingPercent) {
if (mIsPaddingPercent == null && isPaddingPercent) {
mIsPaddingPercent = new boolean[YogaEdge.ALL.intValue() + 1];
}
if (mIsPaddingPercent != null) {
mIsPaddingPercent[edge.intValue()] = isPaddingPercent;
}
}
代码示例来源:origin: facebook/litho
public YogaEdge getEdge(int index) {
return YogaEdge.fromInt(lookup(index + 1));
}
代码示例来源:origin: facebook/litho
private static int edgeIndex(YogaEdge edge) {
switch (edge) {
case START:
case LEFT:
return EDGE_LEFT;
case TOP:
return EDGE_TOP;
case END:
case RIGHT:
return EDGE_RIGHT;
case BOTTOM:
return EDGE_BOTTOM;
case HORIZONTAL:
case VERTICAL:
case ALL:
// Fall-through
}
throw new IllegalArgumentException("Given unsupported edge " + edge.name());
}
代码示例来源:origin: facebook/litho
private boolean isPaddingPercent(YogaEdge edge) {
return mIsPaddingPercent != null && mIsPaddingPercent[edge.intValue()];
}
代码示例来源:origin: facebook/litho
void setEdgeWidth(YogaEdge edge, int width) {
if (width < 0) {
throw new IllegalArgumentException(
"Given negative border width value: " + width + " for edge " + edge.name());
}
setEdgeValue(mEdgeWidths, edge, width);
}
代码示例来源:origin: facebook/litho
public float getRaw(YogaEdge edge) {
return mEdges[edge.intValue()];
}
代码示例来源:origin: facebook/litho
public float get(YogaEdge edge) {
float defaultValue = (edge == YogaEdge.START || edge == YogaEdge.END
? YogaConstants.UNDEFINED
: mDefaultValue);
if (mValueFlags == 0) {
return defaultValue;
}
if ((mValueFlags & sFlagsMap[edge.intValue()]) != 0) {
return mEdges[edge.intValue()];
}
if (mHasAliasesSet) {
YogaEdge secondType = edge == YogaEdge.TOP || edge == YogaEdge.BOTTOM
? YogaEdge.VERTICAL
: YogaEdge.HORIZONTAL;
if ((mValueFlags & sFlagsMap[secondType.intValue()]) != 0) {
return mEdges[secondType.intValue()];
} else if ((mValueFlags & sFlagsMap[YogaEdge.ALL.intValue()]) != 0) {
return mEdges[YogaEdge.ALL.intValue()];
}
}
return defaultValue;
}
代码示例来源:origin: facebook/litho
public boolean set(YogaEdge edge, float value) {
if (!floatsEqual(mEdges[edge.intValue()], value)) {
mEdges[edge.intValue()] = value;
if (YogaConstants.isUndefined(value)) {
mValueFlags &= ~sFlagsMap[edge.intValue()];
} else {
mValueFlags |= sFlagsMap[edge.intValue()];
}
mHasAliasesSet =
(mValueFlags & sFlagsMap[YogaEdge.ALL.intValue()]) != 0 ||
(mValueFlags & sFlagsMap[YogaEdge.VERTICAL.intValue()]) != 0 ||
(mValueFlags & sFlagsMap[YogaEdge.HORIZONTAL.intValue()]) != 0;
return true;
}
return false;
}
代码示例来源:origin: facebook/litho
private int addEdge(YogaEdge yogaEdge) {
int size = lookup(0);
insert(size + 1, yogaEdge.intValue());
insert(0, size + 1);
return size;
}
代码示例来源:origin: koudle/AndYogaSample
@Override
public float getMargin(YogaEdge edge) {
if (!mHasSetMargin) {
return edge.intValue() < YogaEdge.START.intValue() ? 0 : YogaConstants.UNDEFINED;
}
return jni_YGNodeStyleGetMargin(mNativePointer, edge.intValue());
}
代码示例来源:origin: koudle/AndYogaSample
@Override
public float getBorder(YogaEdge edge) {
if (!mHasSetBorder) {
return edge.intValue() < YogaEdge.START.intValue() ? 0 : YogaConstants.UNDEFINED;
}
return jni_YGNodeStyleGetBorder(mNativePointer, edge.intValue());
}
代码示例来源:origin: koudle/AndYogaSample
@Override
public float getPadding(YogaEdge edge) {
if (!mHasSetPadding) {
return edge.intValue() < YogaEdge.START.intValue() ? 0 : YogaConstants.UNDEFINED;
}
return jni_YGNodeStyleGetPadding(mNativePointer, edge.intValue());
}
代码示例来源:origin: koudle/AndYogaSample
@Override
public void setPosition(YogaEdge edge, float position) {
mHasSetPosition = true;
jni_YGNodeStyleSetPosition(mNativePointer, edge.intValue(), position);
}
代码示例来源:origin: koudle/AndYogaSample
@Override
public void setPadding(YogaEdge edge, float padding) {
mHasSetPadding = true;
jni_YGNodeStyleSetPadding(mNativePointer, edge.intValue(), padding);
}
代码示例来源:origin: koudle/AndYogaSample
@Override
public void setMargin(YogaEdge edge, float margin) {
mHasSetMargin = true;
jni_YGNodeStyleSetMargin(mNativePointer, edge.intValue(), margin);
}
代码示例来源:origin: koudle/AndYogaSample
@Override
public void setBorder(YogaEdge edge, float border) {
mHasSetBorder = true;
jni_YGNodeStyleSetBorder(mNativePointer, edge.intValue(), border);
}
代码示例来源:origin: koudle/AndYogaSample
@Override
public float getPosition(YogaEdge edge) {
if (!mHasSetPosition) {
return YogaConstants.UNDEFINED;
}
return jni_YGNodeStyleGetPosition(mNativePointer, edge.intValue());
}
内容来源于网络,如有侵权,请联系作者删除!