alexzhirkevich/custom-qr-generator

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

Opened this issue · 8 comments

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
#27 (comment)

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

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

Use elementShape from here #38 (comment) and create frame for it with the size of 5, not 7

Or just use stable version

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

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

@alexzhirkevich new alpha is fixed?

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