computeActualIndex method

  1. @visibleForTesting
int computeActualIndex(
  1. int targetIndex,
  2. int parentNodeLevel
)

Implementation

@visibleForTesting
int computeActualIndex(int targetIndex, int parentNodeLevel) {
  int actualIndex = targetIndex;

  for (int i = targetIndex + 1; i < animatedListStateController.length; i++) {
    if (animatedListStateController.list[i].level > parentNodeLevel + 1) {
      actualIndex++;
    } else {
      break;
    }
  }

  return actualIndex;
}