alexzhirkevich / custom-qr-generator

Android library for creating QR codes with logo, custom shapes, colors, background image. Powered by ZXing
MIT License
173 stars 18 forks source link

Highlight anchor elements for better recognition seems break in Library version 2.0.0-alpha01 #43

Open hardikbhalodi opened 1 year ago

hardikbhalodi commented 1 year ago

Library version 'com.github.alexzhirkevich:custom-qr-generator:2.0.0-alpha01'

Code Snippet QrVectorOptions.Builder options =new QrVectorOptions.Builder()... options.setAnchorsHighlighting(new QrHighlighting(HighlightingType.Default.INSTANCE, HighlightingType.Default.INSTANCE, HighlightingType.None.INSTANCE, 0.6f));

Library version 2.0.0 -alpha01 ouput (Alpha not applying)
Screenshot_153452

Library version 1.6.2 ouput (Correct) Screenshot_154359

Quoted issue https://github.com/alexzhirkevich/custom-qr-generator/issues/27#issue-1690411367

alexzhirkevich commented 1 year ago

you have to add alpha manually to the color. alpha paramter will be removed. color parameter will be added to Default highlighting. For now you can use styled one with default arguments and set color to transparent white

hardikbhalodi commented 1 year ago

I tried that way here is code snippet

 HighlightingType type=new HighlightingType.Styled(null,getQRVectorColor(Color.parseColor("#66ffffff")));
 options.setAnchorsHighlighting(new QrHighlighting(type,
                    type, HighlightingType.None.INSTANCE, 0.6f));

here is Output, getting some margin in version eye Screenshot_165803

alexzhirkevich commented 1 year ago

Use elementShape from here https://github.com/alexzhirkevich/custom-qr-generator/issues/38#issuecomment-1633356526 and create frame for it with the size of 5, not 7

alexzhirkevich commented 1 year ago

Or just use stable version

hardikbhalodi commented 1 year ago

Version stable 'com.github.alexzhirkevich:custom-qr-generator:1.6.2'

With code snippet alpha inside color

HighlightingType type=new HighlightingType.Styled(null,getQRVectorColor(Color.parseColor("#66ffffff")));
 options.setAnchorsHighlighting(new QrHighlighting(type,
                    type, HighlightingType.None.INSTANCE, 0.6f));

Screenshot_165803

with old code snippet alpha as separate parameter options.setAnchorsHighlighting(new QrHighlighting(HighlightingType.Default.INSTANCE, HighlightingType.Default.INSTANCE, HighlightingType.None.INSTANCE, 0.6f));

Screenshot_170515

alexzhirkevich commented 1 year ago

I mean use it how you have used it before, without new code snippet. I'll fix alpha version soon

hardikbhalodi commented 11 months ago

@alexzhirkevich new alpha is fixed?

AKFEvn commented 5 months ago

Hello. Can I ask how to create a QR code like this? Can you guide me? @hardikbhalodi @alexzhirkevich