public static void setConfiguredSize(
      @Nullable final View parentView, final View vitoView, final Config config) {
    if (parentView != null) {
      if (config.overrideSize) {
        SizeUtil.updateViewLayoutParams(vitoView, config.overridenWidth, config.overridenHeight);
      } else {
        int size =
            SizeUtil.calcDesiredSize(
                parentView.getContext(), parentView.getWidth(), parentView.getHeight());
        SizeUtil.updateViewLayoutParams(vitoView, size, (int) (size / Const.RATIO));
      }
    }
  }
Utility method which set the size based on the parent and configurations

@param parentView The parent View
@param vitoView The View to resize
@param config The Config object
samples/scrollperf/src/main/java/com/facebook/samples/scrollperf/util/SizeUtil.java