getNativeOffsetForChild

Returns the offset within the native children owned by all layout-only nodes in the subtree rooted at this node for the given child. Put another way, this returns the number of native nodes (nodes not optimized out of the native tree) that are a) to the left (visited before by a DFS) of the given child in the subtree rooted at this node and b) do not have a native parent in this subtree (which means that the given child will be a sibling of theirs in the final native hierarchy since they'll get attached to the same native parent).

Basically, a view might have children that have been optimized away by . Since those children will then add their native children to this view, we now have ranges of native children that correspond to single unoptimized children. The purpose of this method is to return the index within the native children that corresponds to the **start** of the native children that belong to the given child. Also, note that all of the children of a view might be optimized away, so this could return the same value for multiple different children.

Example. Native children are represented by (N) where N is the no-opt child they came from. If no children are optimized away it'd look like this: (0) (1) (2) (3) ... (n)

In case some children are optimized away, it might look like this: (0) (1) (1) (1) (3) (3) (4)

In that case: getNativeOffsetForChild(Node 0) => 0 getNativeOffsetForChild(Node 1) => 1 getNativeOffsetForChild(Node 2) => 4 getNativeOffsetForChild(Node 3) => 4

getNativeOffsetForChild(Node 4) => 6