YogaLayout addView by index & params #803

Closed
opened 2018-08-15 02:05:18 -07:00 by myalcinkuru · 2 comments
myalcinkuru commented 2018-08-15 02:05:18 -07:00 (Migrated from github.com)

Report

The problem is;
-Something looks like wrong when i addView the child by index & params. Child does not place itself in specified position. Even if i give -1 does not add the child at the last position.

Issues and Steps to Reproduce

  • Create a root & child(5 piece) YogaLayout
  • Create ViewGroup.LayoutParams obj by providing width & height parameters
  • Then add childs YogaLayout to root one by required parameters; child, -1 or total child count / 2 (middle) , ViewGroup.LayoutParams obj

Expected Behavior

As i expect, added child should be placed in the specified position

Actual Behavior

Child does not placed in given position.

# Report - As i searched [existing issues](https://github.com/facebook/yoga/issues) and this seems to be not a duplicate. The problem is; -Something looks like wrong when i addView the child by index & params. Child does not place itself in specified position. Even if i give -1 does not add the child at the last position. # Issues and Steps to Reproduce - Create a root & child(5 piece) YogaLayout - Create ViewGroup.LayoutParams obj by providing width & height parameters - Then add childs YogaLayout to root one by required parameters; child, -1 or total child count / 2 (middle) , ViewGroup.LayoutParams obj # Expected Behavior As i expect, added child should be placed in the specified position # Actual Behavior Child does not placed in given position.
chenjianping99 commented 2019-06-20 21:01:07 -07:00 (Migrated from github.com)

change:
”mYogaNode.addChildAt(childNode, mYogaNode.getChildCount());“
to
if (index > 0) {
mYogaNode.addChildAt(childNode, index);
} else {
mYogaNode.addChildAt(childNode, mYogaNode.getChildCount());
}

change: ”mYogaNode.addChildAt(childNode, mYogaNode.getChildCount());“ to if (index > 0) { mYogaNode.addChildAt(childNode, index); } else { mYogaNode.addChildAt(childNode, mYogaNode.getChildCount()); }
NickGerleman commented 2023-04-25 20:44:04 -07:00 (Migrated from github.com)

We're deprecating the com.facebook.yoga.android.YogaLayout ViewGroup in the next major release of Yoga. We intend to still push out a new version aligned to the core Yoga 2.0. I have bulk closed ViewGroup issues to reflect that we are not planning to invest time into functional changes of the ViewGroup. and eventually intend to remove it from the repo.

We're deprecating the `com.facebook.yoga.android.YogaLayout` ViewGroup in the next major release of Yoga. We intend to still push out a new version aligned to the core Yoga 2.0. I have bulk closed ViewGroup issues to reflect that we are not planning to invest time into functional changes of the ViewGroup. and eventually intend to remove it from the repo.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DaddyFrosty/yoga#803
No description provided.