wxr
2020-09-09 c3e1b733fc45bd9f0b88bfb560cfa87a270b079b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using Android.Content;
using Android.Views;
using Android.Widget;
using HDL_ON_Android;
 
namespace HDL_ON
{
 
    public class ZXingCustomScanView : RelativeLayout
    {
        public Action OnCancel;
        public Action OnTorch;
        public TextView cancelTextView, flashTextView, titleTextView;
        public ZXingCustomScanView(Context context) : base(context)
        {
            View.Inflate(context, Resource.Layout.zxing_layout, this);
 
            titleTextView = FindViewById<TextView>(Resource.Id.tv_zxing_scan);
 
            cancelTextView = FindViewById<TextView>(Resource.Id.tv_zxing_back);
            cancelTextView.Text = cancelText;
            flashTextView = FindViewById<TextView>(Resource.Id.tv_zxing_flash);
            flashTextView.Text = flashText;
 
            cancelTextView.Click += Cancel_Click;
            flashTextView.Click += Flash_Click;
        }
        
        String cancelText = "Cancel";
        public String CancelText
        {
            get
            {
                return cancelText;
            }
            set {
                cancelText = value;
                cancelTextView.Text = cancelText;
            }
        }
 
        String flashText = "Flash";
        public String FlashText
        {
            get
            {
                return flashText;
            }
            set
            {
                flashText = value;
                flashTextView.Text = flashText;
            }
        }
 
 
 
 
 
        private void Flash_Click(object sender, EventArgs e)
        {
            OnTorch?.Invoke();
        }
 
        private void Cancel_Click(object sender, System.EventArgs e)
        {
            OnCancel?.Invoke();
        }
 
    }
}