-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how i can make edge color in CompoundBarcodeView #352
Comments
I also would like to know how to do it. |
Did anyone find solution. Im still not getting. |
@luminousman @YanisSalos Paint paint1 = new Paint();
paint1.setColor(context.getResources().getColor(R.color.zxing_colorAccent));
int frameLength = (int) (32 * getResources().getDisplayMetrics().density + 0.5f);
int frameWidth = (int) (3 * getResources().getDisplayMetrics().density + 0.5f);
canvas.drawRect(frame.left, frame.top, frame.left + frameLength, frame.top + frameWidth, paint1);
canvas.drawRect(frame.left, frame.top, frame.left + frameWidth, frame.top + frameLength, paint1);
canvas.drawRect(frame.left, frame.bottom - frameLength, frame.left + frameWidth, frame.bottom, paint1);
canvas.drawRect(frame.left, frame.bottom - frameWidth, frame.left + frameLength, frame.bottom, paint1);
canvas.drawRect(frame.right - frameWidth, frame.bottom - frameLength, frame.right, frame.bottom, paint1);
canvas.drawRect(frame.right - frameLength, frame.bottom - frameWidth, frame.right, frame.bottom, paint1);
canvas.drawRect(frame.right - frameWidth, frame.top, frame.right, frame.top + frameLength, paint1);
canvas.drawRect(frame.right - frameLength, frame.top, frame.right, frame.top + frameWidth, paint1); it is not optimized but works |
The simple solution is to follow the custom scanner activity. Create a new layout and there you can add a view your background.
|
Can you spesific for tutorial ? how to Mainactivity connecting to new custom layout ? |
Step by step:
|
I am can't found mBarcodeScannerView, mCaptureManager. I am uses implementation 'com.journeyapps:zxing-android-embedded:3.6.0@aar' |
mBarcodeScannerView = CompoundBarcodeView @beryindo next time dont bother to make a question without searching on repository. The samples has all you need with CaptureManager. |
here is how I achieved it - https://stackoverflow.com/a/50556050/1134412 |
@chathura2020 Sorry for the ignorance, but how exactly were you able to edit the ViewfinderView class? |
@pedrooa yes, I keep the library source locally |
Thanks for the examples posted here. Note that you don't need to copy the entire library if you want to modify this - you only need to copy and modify ViewfinderView and DecoratedBarcodeView. |
how i can make edge color blue in CompoundBarcodeView
like this : https://lh6.ggpht.com/-LHkE5TWqK0bWUdreGY2m28wJa9YsMvkkXiL-1u7ZRcBs2gXP8bsTTpo9IWWdY1hhaw=w170
I have search but i didnt reach my point please help and thanks
The text was updated successfully, but these errors were encountered: