using System; using Shared.Common; namespace Shared.Phone.Device.CurtainPanel { public class ButtonSet : FrameLayout { public ButtonSet() { } /// /// 最上面块View /// public RowLayout topRowLayout = new RowLayout { BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor, Height = Application.GetRealHeight(184), LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor, }; /// /// 标题Btn /// public Button toptitleNameBtn = new Button { TextSize = 17, TextColor = ZigbeeColor.Current.LogicTextBlackColor, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth(176), Width = Application.GetRealWidth(600), Height = Application.GetRealHeight(69), Y = Application.GetRealHeight(92), Text = "按键设置", IsBold = true }; /// /// 后退Btn /// public Button backBtn = new Button { Width = Application.GetRealWidth(30), Height = Application.GetRealHeight(51), X = Application.GetRealWidth(81), Y = Application.GetRealHeight(98), //Gravity = Gravity.CenterVertical; UnSelectedImagePath = "ZigeeLogic/back.png", }; /// /// 增加热键大小Btn /// public Button clickBtn = new Button { Width = Application.GetRealWidth(81 + 51), Height = Application.GetRealHeight(58 + 40), Y = Application.GetRealHeight(98 - 40), }; public VerticalScrolViewLayout verticalScrolView = new VerticalScrolViewLayout { Y = Application.GetRealHeight(184), Height = Application.GetRealHeight(1920 - 184), Width = Application.GetRealWidth(1080), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor }; /// /// 显示点击效果btn /// Button btnClick = new Button(); public void Show() { this.AddChidren(topRowLayout); topRowLayout.AddChidren(toptitleNameBtn); topRowLayout.AddChidren(backBtn); topRowLayout.AddChidren(clickBtn); this.AddChidren(verticalScrolView); FrameLayout frameLayout = new FrameLayout { Height = Application.GetRealHeight(700), Width = Application.GetRealWidth(1080), }; verticalScrolView.AddChidren(frameLayout); Button iconBtn = new Button { Y = Application.GetRealHeight(160), X = Application.GetRealWidth(360), UnSelectedImagePath = "Item/C_Panel.png", Width = Application.GetRealWidth(366), Height = Application.GetRealWidth(366), }; frameLayout.AddChidren(iconBtn); for (int i = 1; i < 5; i++) { Button selectedIcon = new Button { SelectedImagePath = "Item/selected_Panel.png", Width = Application.GetRealWidth(156), Height = Application.GetRealWidth(156), }; frameLayout.AddChidren(selectedIcon); Button selectedText = new Button { Width = Application.GetRealWidth(120), Height = Application.GetRealWidth(38), TextSize=5, TextColor=ZigbeeColor.Current.LogicBtnNotSelectedColor, }; frameLayout.AddChidren(selectedText); switch (i) { case 1: { selectedIcon.Y = Application.GetRealHeight(160 + 26); selectedIcon.X = Application.GetRealWidth(360 + 29); selectedIcon.BackgroundColor = 0xff674746; selectedText.Y = Application.GetRealHeight(160 + 26 + 63); selectedText.X = Application.GetRealWidth(360 + 29 + 20); selectedText.Text = "窗帘开/停"; } break; case 2: { selectedIcon.Y = Application.GetRealHeight(160 + 26); selectedIcon.X = Application.GetRealWidth(360 + 29 + 156); selectedIcon.BackgroundColor = 0xff888906; selectedText.Y = Application.GetRealHeight(160 + 26 + 63); selectedText.X = Application.GetRealWidth(360 + 29 + 156 + 14); selectedText.Text = "窗帘关/停"; } break; case 3: { selectedIcon.Y = Application.GetRealHeight(160 + 26 + 156); selectedIcon.X = Application.GetRealWidth(360 + 29); selectedIcon.BackgroundColor = 0xff342345; selectedText.Y = Application.GetRealHeight(160 + 26 + 156 + 46); selectedText.X = Application.GetRealWidth(360 + 29 + 20); selectedText.Text = "窗帘开/停"; } break; case 4: { selectedIcon.Y = Application.GetRealHeight(160 + 26 + 156); selectedIcon.X = Application.GetRealWidth(360 + 29 + 156); selectedIcon.BackgroundColor = 0xff568451; selectedText.Y = Application.GetRealHeight(160 + 26 + 156 + 46); selectedText.X = Application.GetRealWidth(360 + 29 +156+ 14); selectedText.Text = "窗帘关/停"; } break; } selectedIcon.MouseUpEventHandler += (sen, e) => { //btnClick.IsSelected = false; //btnClick = selectedIcon; //selectedIcon.IsSelected = true; }; } } } }