Example #1
0
  /**
   * Resets this instance to its default state. This method is meant to be used when recycling
   * {@link CSSNode} instances.
   */
  public void reset() {
    if (mParent != null || (mChildren != null && mChildren.size() > 0)) {
      throw new IllegalStateException("You should not reset an attached CSSNode");
    }

    cssstyle.reset();
    csslayout.resetResult();
    lineIndex = 0;
    mLayoutState = LayoutState.DIRTY;
  }
Example #2
0
  private void toStringWithIndentation(StringBuilder result, int level) {
    // Spaces and tabs are dropped by IntelliJ logcat integration, so rely on __ instead.
    StringBuilder indentation = new StringBuilder();
    for (int i = 0; i < level; ++i) {
      indentation.append("__");
    }

    result.append(indentation.toString());
    result.append(csslayout.toString());
    result.append(cssstyle.toString());

    if (getChildCount() == 0) {
      return;
    }

    result.append(", children: [\n");
    for (int i = 0; i < getChildCount(); i++) {
      getChildAt(i).toStringWithIndentation(result, level + 1);
      result.append("\n");
    }
    result.append(indentation + "]");
  }
Example #3
0
 public void setMaxHeight(float maxHeight) {
   if (!valuesEqual(cssstyle.maxHeight, maxHeight)) {
     cssstyle.maxHeight = maxHeight;
     dirty();
   }
 }
Example #4
0
 public void setMinHeight(float minHeight) {
   if (!valuesEqual(cssstyle.minHeight, minHeight)) {
     cssstyle.minHeight = minHeight;
     dirty();
   }
 }
Example #5
0
 public void setMaxWidth(float maxWidth) {
   if (!valuesEqual(cssstyle.maxWidth, maxWidth)) {
     cssstyle.maxWidth = maxWidth;
     dirty();
   }
 }
Example #6
0
 public void setMinWidth(float minWidth) {
   if (!valuesEqual(cssstyle.minWidth, minWidth)) {
     cssstyle.minWidth = minWidth;
     dirty();
   }
 }
Example #7
0
 public void setFlex(float flex) {
   if (!valuesEqual(cssstyle.flex, flex)) {
     cssstyle.flex = flex;
     dirty();
   }
 }
Example #8
0
 public void setWrap(CSSWrap flexWrap) {
   if (cssstyle.flexWrap != flexWrap) {
     cssstyle.flexWrap = flexWrap;
     dirty();
   }
 }
Example #9
0
 public void setPositionType(CSSPositionType positionType) {
   if (cssstyle.positionType != positionType) {
     cssstyle.positionType = positionType;
     dirty();
   }
 }
Example #10
0
 public void setAlignSelf(CSSAlign alignSelf) {
   if (cssstyle.alignSelf != alignSelf) {
     cssstyle.alignSelf = alignSelf;
     dirty();
   }
 }
Example #11
0
 public void setAlignItems(CSSAlign alignItems) {
   if (cssstyle.alignItems != alignItems) {
     cssstyle.alignItems = alignItems;
     dirty();
   }
 }
Example #12
0
 public void setJustifyContent(CSSJustify justifyContent) {
   if (cssstyle.justifyContent != justifyContent) {
     cssstyle.justifyContent = justifyContent;
     dirty();
   }
 }
Example #13
0
 public void setFlexDirection(CSSFlexDirection flexDirection) {
   if (cssstyle.flexDirection != flexDirection) {
     cssstyle.flexDirection = flexDirection;
     dirty();
   }
 }
Example #14
0
 public void setDirection(CSSDirection direction) {
   if (cssstyle.direction != direction) {
     cssstyle.direction = direction;
     dirty();
   }
 }