Как сделать закругленную рамку видоискателя для сканера QR кода
Нужна помощь с рамкой видоискателя сканера qr кода journeyapps zxing как сделать со скруглением углов с настраиваемым радиусом скругления
Вот код Java который я использую, но рамка получается квадратная без скругления
private float mLineRate = 0.1f;
private float mLineDepth =
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5, getResources().getDisplayMetrics());
private int mLineColor = Color.rgb(50, 205, 50);
@Override public void onDraw (Canvas canvas){
final Rect frame = framingRect;
final Size previewSize = this.previewSize;
final int width = getWidth();
final int height = getHeight();
paint.setColor(mLineColor);
canvas.drawRect(frame.left, frame.top,frame.left + frame.width() * mLineRate,frame.top + mLineDepth, paint);
canvas.drawRect(frame.left, frame.top, frame.left + mLineDepth, frame.top + frame.height() * mLineRate, paint);
canvas.drawRect(frame.right - frame.width() * mLineRate, frame.top, frame.right, frame.top + mLineDepth, paint);
canvas.drawRect(frame.right - mLineDepth, frame.top, frame.right, frame.top + frame.height() * mLineRate, paint);
canvas.drawRect(frame.left,frame.bottom - mLineDepth,frame.left + frame.width() * mLineRate, frame.bottom, paint);
canvas.drawRect(frame.left, frame.bottom - frame.height() * mLineRate, frame.left + mLineDepth, frame.bottom, paint);
canvas.drawRect(frame.right - frame.width() * mLineRate, frame.bottom - mLineDepth, frame.right, frame.bottom, paint);
canvas.drawRect(frame.right - mLineDepth, frame.bottom - frame.height() * mLineRate, frame.right, frame.bottom, paint);
}
