code: @Override
    protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
      final int specWidthSize = MeasureSpec.getSize(widthMeasureSpec);
      final int specWidthMode = MeasureSpec.getMode(widthMeasureSpec);
      final int specHeightSize = MeasureSpec.getSize(heightMeasureSpec);
      final int specHeightMode = MeasureSpec.getMode(heightMeasureSpec);
  
      //We expect to be somewhere inside a MaterialCalendarView, which should measure EXACTLY
      if (specHeightMode == MeasureSpec.UNSPECIFIED || specWidthMode == MeasureSpec.UNSPECIFIED) {
        throw new IllegalStateException("CalendarPagerView should never be left to decide it's size");
      }
  
      //The spec width should be a correct multiple
      final int measureTileWidth = specWidthSize / DEFAULT_DAYS_IN_WEEK;
      final int measureTileHeight = specHeightSize / getRows();
  
      //Just use the spec sizes
      setMeasuredDimension(specWidthSize, specHeightSize);
  
      int count = getChildCount();
  
      for (int i = 0; i < count; i++) {
        final View child = getChildAt(i);
  
        int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(
            measureTileWidth,
            MeasureSpec.EXACTLY
        );
  
        int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(
            measureTileHeight,
            MeasureSpec.EXACTLY
        );
  
        child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
      }
    }
docs: {@inheritDoc}