How to add display of QR code information using augmented reality

Once I was faced with the task of creating an application that will display product information when scanning using augmented reality. Moreover, it was necessary to display buttons, by clicking on which it was possible to add a product and delete it. After some searches, it was decided to use Google Play Services Vision.

Result:

First, we need a view which renders a series of custom graphics to be overlayed on top of an associated preview
(i.e., the camera preview).

GraphicOverlay:

CameraSourcePreview:

Add them to the layout:

All the logic for adding information about products and changing their state has been added to the ViewModel:

BarcodeGraphic:

I implemented handling of button clicks in a fragment as follows:

Source code: https://github.com/GeorgCantor/team.marker

Thanks for attention!