using System; using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; using Shared; namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice.View { public class PirView { /// /// 父控件 /// public FrameLayout devfLayout = new FrameLayout { Y = Application.GetRealHeight(12), X = Application.GetRealWidth(16), Width = Application.GetRealWidth(375 - 16 * 2), // Height = Application.GetRealHeight(92 + (50 * pirDevice.FunctioList.Count)), BackgroundColor = CSS.CSS_Color.view, Radius = (uint)Application.GetRealHeight(12), }; /// /// 图标 /// public Button priequipmentBtn = new Button { Y = Application.GetRealHeight(16), X = Application.GetRealWidth(5), Width = Application.GetRealWidth(60), Height = Application.GetRealWidth(60), UnSelectedImagePath = "PirIcon/priequipment.png", TextAlignment = TextAlignment.Center, }; /// /// 名称 /// public Button deviceNameBtn = new Button { Y = Application.GetRealHeight(16), X = Application.GetRealWidth(72), Width = Application.GetRealWidth(120+80), Height = Application.GetRealHeight(20), //Text = pirDevice.name, TextAlignment = TextAlignment.CenterLeft, TextSize = TextSize.text14, TextColor = CSS.CSS_Color.textColor, IsBold = true, }; /// /// 当前个数 /// public TextButton geBtn = new TextButton { Y = Application.GetRealHeight(40), X = Application.GetRealWidth(72), Width = Application.GetRealWidth(120), Height = Application.GetRealHeight(17), //Text = pirDevice.FunctioList.Count.ToString(), TextAlignment = TextAlignment.CenterLeft, TextSize = TextSize.text12, TextColor = CSS.CSS_Color.textConfirmColor, }; /// /// 总数 /// public Button sumBtn = new Button { Y = Application.GetRealHeight(40), Width = Application.GetRealWidth(50), Height = Application.GetRealHeight(17), Text = "/10", TextAlignment = TextAlignment.CenterLeft, TextSize = TextSize.text12, TextColor = CSS.CSS_Color.textCancelColor, }; /// /// 状态图标 /// public Button stateIconBtn = new Button { Y = Application.GetRealHeight(23), X = Application.GetRealWidth(291-5), Width = Application.GetRealWidth(8), Height = Application.GetRealWidth(8), UnSelectedImagePath ="PirIcon/offline.png", SelectedImagePath = "PirIcon/online.png", }; /// /// 红外宝状态(在线-离线) /// public Button stateTextBtn = new Button { Y = Application.GetRealHeight(18), X = Application.GetRealWidth(303-5), Width = Application.GetRealWidth(30+5), Height = Application.GetRealHeight(17), TextID = StringId.zaixianhwb, TextAlignment = TextAlignment.CenterLeft, TextSize = TextSize.text12, TextColor = CSS.CSS_Color.textRedColor,// CSS.CSS_Color.textColor, SelectedTextColor = 0xFF67D569, IsBold = true, }; /// /// 线 /// public Button lineBtn = new Button { Y = Application.GetRealHeight(92) - 1, X = Application.GetRealWidth(16), Width = Application.GetRealWidth(343 - 16 * 2), Height = 1, BackgroundColor = CSS.CSS_Color.viewLine, }; /// /// 点击事件 /// public Button clickBtn = new Button { Y = Application.GetRealHeight(12), X = Application.GetRealWidth(16), Width = Application.GetRealWidth(375 - 16 * 2), Height = Application.GetRealHeight(92), BackgroundColor = 0x00000000, //CSS.CSS_Color.view, Radius = (uint)Application.GetRealHeight(12), //Tag = Pir.pirDeviceList[i], }; /// /// view方法 /// /// /// public void Show(int i, FrameLayout fLayout) { fLayout.AddChidren(devfLayout); devfLayout.Height = Application.GetRealHeight(92 + (50 * i)); devfLayout.AddChidren(priequipmentBtn); devfLayout.AddChidren(deviceNameBtn); devfLayout.AddChidren(geBtn); geBtn.Width = geBtn.GetTextWidth(); devfLayout.AddChidren(sumBtn); sumBtn.X = geBtn.Right; sumBtn.TextAlignment = TextAlignment.CenterLeft; devfLayout.AddChidren(stateIconBtn); devfLayout.AddChidren(stateTextBtn); devfLayout.AddChidren(lineBtn); devfLayout.AddChidren(clickBtn); } } }