Consider using the new image viewer for barcodes
Not sure how viable, but the new image viewer introduced in #3184 is a lot more flexible than the current setup. Maybe we can somehow make it work with the barcode in the "full screen view"?
If so, we can maybe fix both #3171 and #2821 at once. As an added benefit, it would severely reduce the complexity of the LoyaltyCardViewActivity, which is an old Java class using Android XML, which was want to migrate away from.
Something to research.
Hi! I am trying to work on this, and I have already built some base for it. What is the expected result more precisely? Do we want to keep the functionality to stretch the barcode drawable based on the sliders on the bottom?
I marked it as "Something to research" because I'm not completely sure what would be best or if it's even a good idea. But it would make the code a lot cleaner while giving more flexibility to users I think.
I think the one thing most people want is for the barcode to be near the edge? So I think what we need it:
- The image viewer to support hiding the top bar
- The image viewer supporting aligning the image anywhere but the center (default: top)
If those conditions are satisfied, people could zoom any way they want so I think the sliders are no longer needed then.
Though I do see one pain point: sometimes scanners exist with very little space available, like these in the Netherlands (this one has more space than many), so it needs to be possible to make a 2D barcode take very little vertical space:
So yeah, I'm not sure how this would work best. Above all, we need to not break existing use cases, so maybe we need to be able to resize horizontally and vertically separately (so: stretch)?
Thanks for the clarification, it gave me a better understanding. By now I got this behaviour: https://github.com/user-attachments/assets/62eae9e9-8ce2-41c2-aa5a-5e9300e13ee2
I still need to polish something, but I wanted to ask you of this Is close to what we want to obtaim
It's a bit hard to tell with the video, I don't think I see any two finger zoom actions? So I'm not quite sure how it is working in your video.
Are you extending the current image viewer to allow moving instead of just zooming or what are you doing? I can't tell if this is the correct direction, not enough info.
My bad providing no context, sorry about it. So basically my idea is: double finger slide = drag (only vertically), zoom in/out vertically/horizontally extends the qr code in the appropriate direction. The qr stretch is implemented through the pre-existing qr-code generation logic and mantains a percentage of both width and heigth stretch so that it is backwards compatible