wjc
2023-08-15 0c216014c649090d765902301cbfc9157f8f1ee4
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
using HDL_ON.UI.Music;
using System;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
    public class TypeMultiFramLayout
    {
 
        private uint UpBackgroundColor = MusicColor.ViewColor;
        private uint DownBackgroundColor = 0xFFEFEFEF;
 
        /// <summary>
        /// 多个类型容器
        /// </summary>
        public FrameLayout multiFramLayout = new FrameLayout
        {
            BackgroundColor = MusicColor.ViewColor,
            X = Application.GetRealWidth(16),
            Width = Application.GetRealWidth(311),
            Height = Application.GetRealHeight(40),
            Radius = (uint)Application.GetRealHeight(20),
        };
 
 
 
        public FrameLayout leftFramLayout = new FrameLayout
        {
            X = Application.GetRealWidth(16),
            Gravity = Gravity.CenterVertical,
            Width = Application.GetRealWidth(139),
            Height = Application.GetRealHeight(23),
            Radius = (uint)Application.GetRealHeight(20),
 
        };
 
 
        public Button btnBottonLeftImage = new Button
        {
            Width = Application.GetRealWidth(16),
            Height = Application.GetRealWidth(16),
            UnSelectedImagePath = "AksIcon/shixuqi.png",
            Gravity = Gravity.CenterVertical,
            Name = "btnBottonLeftImage",
        };
 
        public Button btnBottonName = new Button
        {
            Width = Application.GetRealWidth(100),
            Height = Application.GetRealHeight(23),
            TextID = StringId.shixuqi,
            TextSize = TextSize.Text16,
            TextColor = MusicColor.TextColor,
            TextAlignment = TextAlignment.CenterLeft,
            Gravity = Gravity.CenterVertical,
            IsMoreLines = true,
        };
 
 
 
        public FrameLayout lineFramLayout = new FrameLayout
        {
            BackgroundColor = MusicColor.TextColor,
            Y = Application.GetRealHeight(10),
            Width = Application.GetRealWidth(1),
            Height = Application.GetRealHeight(20),
        };
 
 
 
        public FrameLayout rightFramLayout = new FrameLayout
        {
            Gravity = Gravity.CenterVertical,
            Width = Application.GetRealWidth(138),
            Height = Application.GetRealHeight(23),
            Radius = (uint)Application.GetRealHeight(20),
 
        };
 
 
        public Button btnBottonRightImage = new Button
        {
            Width = Application.GetRealWidth(16),
            Height = Application.GetRealWidth(16),
            UnSelectedImagePath = "AksIcon/xuanze.png",
            Gravity = Gravity.CenterRight,
        };
 
 
        public Button btnBottonRightName = new Button
        {
            Width = Application.GetRealWidth(100),
            Height = Application.GetRealHeight(23),
            TextID = StringId.bofangqi,
            TextSize = TextSize.Text16,
            TextColor = MusicColor.TextColor,
            TextAlignment = TextAlignment.CenterRight,
            Gravity = Gravity.CenterVertical,
            IsMoreLines = true,
        };
 
 
        public void AddView(FrameLayout layout)
        {
            layout.AddChidren(multiFramLayout);
            multiFramLayout.AddChidren(leftFramLayout);
            leftFramLayout.AddChidren(btnBottonLeftImage);
            leftFramLayout.AddChidren(btnBottonName);
            multiFramLayout.AddChidren(lineFramLayout);
            multiFramLayout.AddChidren(rightFramLayout);
            rightFramLayout.AddChidren(btnBottonRightImage);
            rightFramLayout.AddChidren(btnBottonRightName);
            btnBottonName.X = btnBottonLeftImage.Right + Application.GetRealWidth(4);
            lineFramLayout.X = leftFramLayout.Right;
            rightFramLayout.X = lineFramLayout.Right;
            btnBottonRightName.X = btnBottonLeftImage.Right + Application.GetRealWidth(4);
        }
 
 
        public void SetClickUpBackgroundColor(uint backgroundColor)
        {
            this.UpBackgroundColor = backgroundColor;
 
        }
 
        public void SetClickDownBackgroundColor(uint backgroundColor)
        {
            this.DownBackgroundColor = backgroundColor;
        }
 
        /// <summary>
        /// 序时器类型容器
        /// </summary>
        /// <param name="action">回调(第一个是父类对象</param>
        public void SetLeftFlClickListener(Action<FrameLayout> action)
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                //leftFramLayout.BackgroundColor = this.UpBackgroundColor;
               
                //弹起来还原背景颜色
            };
            leftFramLayout.MouseUpEventHandler += UpClick;
            btnBottonLeftImage.MouseUpEventHandler += UpClick;
            btnBottonName.MouseUpEventHandler += UpClick;
 
 
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                //按下去改变背景颜色
                //leftFramLayout.BackgroundColor = this.DownBackgroundColor;
                action?.Invoke(leftFramLayout);
            };
            leftFramLayout.MouseDownEventHandler += DownClick;
            btnBottonLeftImage.MouseDownEventHandler += DownClick;
            btnBottonName.MouseDownEventHandler += DownClick;
        }
 
        /// <summary>
        /// 播放器类型容器
        /// </summary>
        /// <param name="action">回调(第一个是父类对象</param>
        public void SetRightFlClickListener(Action<FrameLayout> action)
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                //rightFramLayout.BackgroundColor = this.UpBackgroundColor;
          
                //弹起来还原背景颜色
            };
            rightFramLayout.MouseUpEventHandler += UpClick;
            btnBottonRightImage.MouseUpEventHandler += UpClick;
            btnBottonRightName.MouseUpEventHandler += UpClick;
 
 
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                //按下去改变背景颜色
                //rightFramLayout.BackgroundColor = this.DownBackgroundColor;
                action?.Invoke(rightFramLayout);
            };
            rightFramLayout.MouseDownEventHandler += DownClick;
            btnBottonRightImage.MouseDownEventHandler += DownClick;
            btnBottonRightName.MouseDownEventHandler += DownClick;
        }
       
 
 
    }
}