Created
April 5, 2018 19:56
-
-
Save masudias/3f3b142b041b2dd2b33c6f114af57575 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.android.gms.vision.MultiProcessor; | |
import com.google.android.gms.vision.Tracker; | |
import com.google.android.gms.vision.barcode.Barcode; | |
/** | |
* Factory for creating a tracker and associated graphic to be associated with a new barcode. The | |
* multi-processor uses this factory to create barcode trackers as needed -- one for each barcode. | |
*/ | |
class BarcodeTrackerFactory implements MultiProcessor.Factory<Barcode> { | |
private BarcodeGraphicTracker.BarcodeDetectorListener mDetectorListener; | |
BarcodeTrackerFactory(BarcodeGraphicTracker.BarcodeDetectorListener detectorListener) { | |
mDetectorListener = detectorListener; | |
} | |
@Override | |
public Tracker<Barcode> create(Barcode barcode) { | |
BarcodeGraphicTracker graphicTracker = new BarcodeGraphicTracker(); | |
if (mDetectorListener != null) | |
graphicTracker.setDetectorListener(mDetectorListener); | |
return graphicTracker; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment