private static int snapVertical(Collection<ConstraintWidget> widgets,ConstraintWidget widget,ConstraintAnchor anchor,int position,ArrayList<SnapCandidate> snapCandidates){
  SnapCandidate candidate=new SnapCandidate();
  ConstraintHandle handle=WidgetInteractionTargets.constraintHandle(anchor);
  if (handle == null) {
    return position;
  }
  handle.setDrawY(position);
  SnapPlacement.snapAnchor(widgets,widget,anchor,candidate);
  if (candidate.target != null) {
    ConstraintHandle targetHandle=WidgetInteractionTargets.constraintHandle(candidate.target);
    int ty=candidate.y;
    if (targetHandle != null) {
      ty=targetHandle.getDrawY();
    }
    position=ty + candidate.margin;
    snapCandidates.add(candidate);
  }
  return position;
}

private static int snapVertical ( Collection < ConstraintWidget > widgets , ConstraintWidget widget , ConstraintAnchor anchor , int position , ArrayList < SnapCandidate > snapCandidates ) { SnapCandidate candidate = new SnapCandidate ( ) ; ConstraintHandle handle = WidgetInteractionTargets . constraintHandle ( anchor ) ; if ( handle == null ) { return position ; } handle . setDrawY ( position ) ; SnapPlacement . snapAnchor ( widgets , widget , anchor , candidate ) ; if ( candidate . target != null ) { ConstraintHandle targetHandle = WidgetInteractionTargets . constraintHandle ( candidate . target ) ; int ty = candidate . y ; if ( targetHandle != null ) { ty = targetHandle . getDrawY ( ) ; } position = ty + candidate . margin ; snapCandidates . add ( candidate ) ; } return position ; }
utility function to gather snap candidates on the vertical axis
