public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mEmailSettings = LoadSettings(); mAccuracyModule = new ReadingAccuracyModule(3); mLayoutInflater = inflater; var view = inflater.Inflate(Resource.Layout.fragment_camera2_basic, container, false); mCaptureRectangleView = new CaptureRectangleView(this.Context); mNumberRectanglesView = new NumberRectanglesView(Context, mCaptureRectangleView); var layout = (RelativeLayout)view.FindViewById(Resource.Id.mainLayout); layout.AddView(mNumberRectanglesView); layout.AddView(mCaptureRectangleView); mSectorColorToggleButton = (ImageView)view.FindViewById(Resource.Id.sectorColorToggleButton); RefreshSectorColorButtonResource(); mSectorColorToggleButton.SetOnClickListener(this); ((ImageView)view.FindViewById(Resource.Id.emailTemplateButton)).SetOnClickListener(this); ((ImageView)view.FindViewById(Resource.Id.flashlightToggleButton)).SetOnClickListener(this); _cameraPreviewTexture = (TextureView)view.FindViewById(Resource.Id.texture); mTextView = (TextView)view.FindViewById(Resource.Id.textView); return(view); }
public NumberRectanglesView(Context context, CaptureRectangleView captureView) : base(context) { mPaint = new Paint(PaintFlags.AntiAlias); mPaint.StrokeCap = Paint.Cap.Round; mPaint.Color = Android.Graphics.Color.Blue; mPaint.StrokeWidth = 5.0f; mPaint.SetStyle(Paint.Style.Stroke); mCaptureView = captureView; }