code: private RectF getArcRect(float offset) {
          RectF workingSurface = new RectF();
          workingSurface.left = getPaddingLeft() + offset;
          workingSurface.top = getPaddingTop() + offset;
          workingSurface.right = getWidth() - getPaddingRight() - offset;
          workingSurface.bottom = getHeight() - getPaddingBottom() - offset;
  
          float width = workingSurface.right - workingSurface.left;
          float height = workingSurface.bottom - workingSurface.top;
  
          this.mDiameter = Math.min(width, height);
          float radius = mDiameter / 2;
          float centerX = width / 2;
          float centerY = height / 2;
  
          //float left, float top, float right, float bottom
          return new RectF(centerX - radius + offset, centerY - radius + offset, centerX + radius + offset, centerY + radius + offset);
      }
docs: Calculates the coordinates of {@link android.graphics.RectF} that
  are perfectly within the available window
  
  @param offset Half the width of the pain stroke
  @return The rectF