gxc
2020-02-28 66a9965c44ecc32a6696abca876ab9d1cd091584
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
using System;
using Shared.Common;
namespace Shared.Phone.Device.CommonForm
{
    public class RoomNoNameMainView : FrameLayout
    {
        /// <summary>
        /// SceneIcon
        /// </summary>
        public Button Icon;
        /// <summary>
        /// RoomNameButton
        /// </summary>
        public Button RoomNameButton;
        /// <summary>
        /// CardBG
        /// </summary>
        private Button CardBG;
        /// <summary>
        /// iconFL
        /// </summary>
        public FrameLayout iconFL;
 
        /// <summary>
        /// RoomMainView
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        public RoomNoNameMainView(int x, int y)
        {
            X = Application.GetRealWidth(x);
            Y = Application.GetRealHeight(y);
            Width = Application.GetMinRealAverage(487);
            Height = Application.GetMinRealAverage(348);
        }
 
        /// <summary>
        /// init
        /// </summary>
        public void Init()
        {
            CardBG = new Button
            {
                Width = Application.GetMinRealAverage(495),
                Height = Application.GetMinRealAverage(354),
                UnSelectedImagePath = "Room/RoomCardView.png",
                Gravity = Gravity.CenterHorizontal
            };
            AddChidren(CardBG);
 
            iconFL = new FrameLayout
            {
                X = Application.GetMinRealAverage(14),
                Width = Application.GetMinRealAverage(467),
                Height = Application.GetMinRealAverage(311),
                Gravity = Gravity.CenterHorizontal,
                Radius = (uint)Application.GetMinRealAverage(29),
                BackgroundColor=ZigbeeColor.Current.GXCBlackBackgroundColor3
            };
            AddChidren(iconFL);
 
            Icon = new Button
            {
                X = Application.GetMinRealAverage(115),
                Y=Application.GetMinRealAverage(141),
                Width = Application.GetMinRealAverage(92),
                Height = Application.GetMinRealAverage(72),
                UnSelectedImagePath="Room/NoNameRoom.png"
            };
            iconFL.AddChidren(Icon);
 
            RoomNameButton = new Button()
            {
                X = Application.GetMinRealAverage(230),
                Y = Application.GetMinRealAverage(141),
                Width = Application.GetMinRealAverage(141),
                Height = Application.GetMinRealAverage(84),
                TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
                TextID=R.MyInternationalizationString.Unallocated,
                TextSize=14,
                IsBold=true
,            };
            AddChidren(RoomNameButton);
        }
 
        /// <summary>
        /// SetRoomName
        /// </summary>
        /// <param name="name"></param>
        public void SetRoomName(string name)
        {
            RoomNameButton.Text = name;
        }
 
        /// <summary>
        /// SetRoomIcon
        /// </summary>
        /// <param name="imagePath"></param>
        public void SetRoomIcon(string imagePath)
        {
            Icon.UnSelectedImagePath = imagePath;
        }
 
    }
}