Skip to content

Releases: pavpolscan/armanager-lib-android

release 0.0.9

28 Dec 08:25
20dbf39
Compare
Choose a tag to compare
  • clean-up of internal ARManager APIs
  • separation of extension and modification concepts of a library

release 0.0.8

27 Dec 14:43
f023bd0
Compare
Choose a tag to compare

Added methods to smoothly perform switch between distinct ARViews for same tracked barcode,
Use ARManager.barcodeAreaInSameRange(trackedBarcode) to determine if the area of a barcode on processed frame is out of previously calculated region and re-rendering of ARView with another layout is required. Please use below snippet within your app to achieve smooth transitions:

@Override
    public void onSessionUpdated(
            @NonNull BarcodeTracking mode,
            @NonNull final BarcodeTrackingSession session,
            @NonNull FrameData data
    ) {
        // Be careful, this function is not invoked on the main thread!
        runOnUiThread(new Runnable() {
            @Override
            public void run() {

                for (TrackedBarcode trackedBarcode : session.getAddedTrackedBarcodes()) {
                    //we use scanResults to display what codes were tracked on 'Done' button press
                    scanResults.add(new ScanResult(trackedBarcode.getBarcode()));

                    //retrieve once per barcode data about it from backend and store in scannedBarcodesData map
                    Map<String,String> barcodeValuesMap=getTestDataForBarcode(trackedBarcode);
                    scannedBarcodesData.put(trackedBarcode.getBarcode().getData(),barcodeValuesMap);

                    //get ARView for the barcode and push it to the overlay
                    ARView arView=arManager.getARViewFor(trackedBarcode,scannedBarcodesData.get(trackedBarcode.getBarcode().getData()));
                    overlay.setViewForTrackedBarcode(trackedBarcode, arView);

                }
                for (TrackedBarcode trackedBarcode : session.getTrackedBarcodes().values()){
                    if (!session.getAddedTrackedBarcodes().contains(trackedBarcode)) {
                        
                        //verify if the area of barcode has changed and is out of previous range
                        if (!arManager.barcodeAreaInSameRange(trackedBarcode)) {
                            ARView arView = arManager.getARViewFor(trackedBarcode, scannedBarcodesData.get(trackedBarcode.getBarcode().getData()));
                            overlay.setViewForTrackedBarcode(trackedBarcode, arView);
                        }
                    }
                }
            }
        });
    }