docs: public static int calcDesiredSize(Context context, int parentWidth, int parentHeight) {
      int orientation = context.getResources().getConfiguration().orientation;
      int desiredSize = (orientation == Configuration.ORIENTATION_LANDSCAPE) ?
              parentWidth : parentHeight;
      return Math.min(desiredSize, parentWidth);
    }