code: @Override
      public void draw(Canvas canvas) {
          Barcode barcode = mBarcode;
          if (barcode == null) {
              return;
          }
  
          // Draws the bounding box around the barcode.
          RectF rect = getViewBoundingBox(barcode);
  
          canvas.drawRect(rect, mOverlayPaint);
  
          /**
           * Draw the top left corner
           */
          canvas.drawLine(rect.left, rect.top, rect.left + CORNER_WIDTH, rect.top, mRectPaint);
          canvas.drawLine(rect.left, rect.top, rect.left, rect.top + CORNER_WIDTH, mRectPaint);
  
          /**
           * Draw the bottom left corner
           */
          canvas.drawLine(rect.left, rect.bottom, rect.left, rect.bottom - CORNER_WIDTH, mRectPaint);
          canvas.drawLine(rect.left, rect.bottom, rect.left + CORNER_WIDTH, rect.bottom, mRectPaint);
  
          /**
           * Draw the top right corner
           */
          canvas.drawLine(rect.right, rect.top, rect.right - CORNER_WIDTH, rect.top, mRectPaint);
          canvas.drawLine(rect.right, rect.top, rect.right, rect.top + CORNER_WIDTH, mRectPaint);
  
          /**
           * Draw the bottom right corner
           */
          canvas.drawLine(rect.right, rect.bottom, rect.right - CORNER_WIDTH, rect.bottom, mRectPaint);
          canvas.drawLine(rect.right, rect.bottom, rect.right, rect.bottom - CORNER_WIDTH, mRectPaint);
      }
docs: Draws the barcode annotations for position, size, and raw value on the supplied canvas.