private boolean onTap(float rawX,float rawY){
  Barcode barcode=null;
  if (mMode == MVBarcodeScanner.ScanningMode.SINGLE_AUTO) {
    BarcodeGraphic graphic=mGraphicOverlay.getFirstGraphic();
    if (graphic != null) {
      barcode=graphic.getBarcode();
      if (barcode != null && mListener != null) {
        mListener.onBarcodeScanned(barcode);
      }
    }
  }
 else   if (mMode == MVBarcodeScanner.ScanningMode.SINGLE_MANUAL) {
    Set<BarcodeGraphic> graphicSet=mGraphicOverlay.getAllGraphics();
    if (graphicSet != null && !graphicSet.isEmpty()) {
      for (      BarcodeGraphic graphic : graphicSet) {
        if (graphic != null && graphic.isPointInsideBarcode(rawX,rawY)) {
          barcode=graphic.getBarcode();
          break;
        }
      }
      if (mListener != null) {
        mListener.onBarcodeScanned(barcode);
      }
    }
  }
 else {
    Set<BarcodeGraphic> graphicSet=mGraphicOverlay.getAllGraphics();
    if (graphicSet != null && !graphicSet.isEmpty()) {
      List<Barcode> barcodes=new ArrayList<>();
      for (      BarcodeGraphic graphic : graphicSet) {
        if (graphic != null) {
          barcode=graphic.getBarcode();
          if (barcode != null)           barcodes.add(barcode);
        }
      }
      if (mListener != null) {
        mListener.onBarcodesScanned(barcodes);
      }
    }
  }
  return barcode != null;
}

private boolean onTap ( float rawX , float rawY ) { Barcode barcode = null ; if ( mMode == MVBarcodeScanner . ScanningMode . SINGLE_AUTO ) { BarcodeGraphic graphic = mGraphicOverlay . getFirstGraphic ( ) ; if ( graphic != null ) { barcode = graphic . getBarcode ( ) ; if ( barcode != null && mListener != null ) { mListener . onBarcodeScanned ( barcode ) ; } } } else if ( mMode == MVBarcodeScanner . ScanningMode . SINGLE_MANUAL ) { Set < BarcodeGraphic > graphicSet = mGraphicOverlay . getAllGraphics ( ) ; if ( graphicSet != null && ! graphicSet . isEmpty ( ) ) { for ( BarcodeGraphic graphic : graphicSet ) { if ( graphic != null && graphic . isPointInsideBarcode ( rawX , rawY ) ) { barcode = graphic . getBarcode ( ) ; break ; } } if ( mListener != null ) { mListener . onBarcodeScanned ( barcode ) ; } } } else { Set < BarcodeGraphic > graphicSet = mGraphicOverlay . getAllGraphics ( ) ; if ( graphicSet != null && ! graphicSet . isEmpty ( ) ) { List < Barcode > barcodes = new ArrayList < > ( ) ; for ( BarcodeGraphic graphic : graphicSet ) { if ( graphic != null ) { barcode = graphic . getBarcode ( ) ; if ( barcode != null ) barcodes . add ( barcode ) ; } } if ( mListener != null ) { mListener . onBarcodesScanned ( barcodes ) ; } } } return barcode != null ; }
ontap is called to capture the oldest barcode currently detected and return it to the caller .
