using System; using Shared; using HDL_ON.Entity; using HDL_ON.UI.CSS; namespace HDL_ON.UI { public partial class ACPage : FrameLayout { #region 控件集合 FrameLayout bodyView; /// /// 功能名称按钮 /// Button btnFunctionName; /// /// 房间楼层信息按钮 /// Button btnFromFoorAndRoom; /// /// 收藏按钮 /// Button btnCollection; /// /// 窗帘背景icon /// ArcSeekBar arcBar; /// /// 减号按钮 /// Button btnMinus; /// /// 加号按钮 /// Button btnPlus; /// /// 温度按钮 /// Button btnTemp; Button btnTempUint; /// /// 室内温度按钮 /// Button btnIndoorTemp; /// /// 模式按钮 /// Button btnPattern; /// /// 风俗按钮 /// Button btnWindSpeed; /// /// 电源按钮 /// Button btnSwitch; #endregion #region 区域变量 Function function; Button btnCollection_Out; Button btnFunctionName_Out; Button btnFromFloor_Out; /// /// 刷新显示信息 /// Action actionRefresh; #endregion public ACPage(Function func) { bodyView = this; function = func; } public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut) { bodyView.BackgroundColor = CSS_Color.BackgroundColor; btnCollection_Out = btnCollectionIcon; btnFunctionName_Out = btnFunctionNameOut; btnFromFloor_Out = btnFromFloorOut; FrameLayout controlView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(88), Width = Application.GetRealWidth(327), Height = Application.GetRealHeight(526), BackgroundImagePath = "Public/Fragmentbg.png", }; bodyView.AddChidren(controlView); btnFunctionName = new Button() { X = Application.GetRealWidth(16), Y = Application.GetRealHeight(14), Width = Application.GetRealWidth(270), Height = Application.GetRealHeight(37), TextColor = CSS_Color.FirstLevelTitleColor, TextAlignment = TextAlignment.CenterLeft, TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, Text = function.name, }; controlView.AddChidren(btnFunctionName); btnFromFoorAndRoom = new Button() { X = Application.GetRealWidth(16), Y = btnFunctionName.Bottom, Width = Application.GetRealWidth(270), Height = Application.GetRealHeight(21), TextColor = CSS_Color.PromptingColor1, TextAlignment = TextAlignment.CenterLeft, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, Text = function.GetRoomListName() }; controlView.AddChidren(btnFromFoorAndRoom); btnCollection = new Button() { X = Application.GetRealWidth(273), Y = Application.GetRealHeight(14), Width = Application.GetMinRealAverage(40), Height = Application.GetMinRealAverage(40), SelectedImagePath = "Collection/CollectionIcon.png", UnSelectedImagePath = "Collection/CollectionGrayIcon.png", IsSelected = function.collection }; controlView.AddChidren(btnCollection); arcBar = new ArcSeekBar() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(120), Width = Application.GetRealWidth(280), Height = Application.GetRealWidth(280), Angle = 160, ThumbColor = CSS_Color.AuxiliaryColor1, ThumbModeFill = true, ProgressBarColor = CSS_Color.MainColor, ThumbRadius = Application.GetRealWidth(14), ArcWidthWithDefaultStyle = Application.GetRealWidth(12), MinValue = 16, MaxValue = 38, Progress = 16, ProgressBarUnitSring = "°C", IsClickable = true, ProgressTextColor = 0x00000000, ArcColor = CSS_Color.BackgroundColor, }; controlView.AddChidren(arcBar); btnTemp = new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(206), Width = Application.GetRealWidth(71), Height = Application.GetRealWidth(60), TextColor = CSS_Color.FirstLevelTitleColor, TextSize = 56, IsBold = true, Text = "20", TextAlignment = TextAlignment.Center, }; controlView.AddChidren(btnTemp); btnTempUint = new Button() { X = btnTemp.Right, Y = btnTemp.Y, Width = Application.GetRealWidth(30), Height = Application.GetRealWidth(20), TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.EmphasisFontSize_Secondary, IsBold = true, TextAlignment = TextAlignment.CenterLeft, Text = "°C", }; controlView.AddChidren(btnTempUint); btnIndoorTemp = new Button() { Gravity = Gravity.CenterHorizontal, Y = btnTemp.Bottom, Width = Application.GetRealWidth(100), Height = Application.GetRealHeight(20), Text = Language.StringByID(StringId.IndoorTemp) + "20°C", TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, }; controlView.AddChidren(btnIndoorTemp); btnMinus = new Button() { X = Application.GetRealWidth(21), Y = Application.GetRealHeight(263), Width = Application.GetRealWidth(32), Height = Application.GetRealWidth(32), UnSelectedImagePath = "Public/MinusSignIcon.png", }; controlView.AddChidren(btnMinus); btnPlus = new Button() { X = Application.GetRealWidth(275), Y = Application.GetRealHeight(263), Width = Application.GetRealWidth(32), Height = Application.GetRealWidth(32), UnSelectedImagePath = "Public/PlusSignIcon.png", }; controlView.AddChidren(btnPlus); btnPattern = new Button() { X = Application.GetRealWidth(64), Y = Application.GetRealHeight(330), Width = Application.GetRealWidth(38), Height = Application.GetRealWidth(38), UnSelectedImagePath = "FunctionIcon/AC/CoolIcon.png", }; controlView.AddChidren(btnPattern); btnWindSpeed = new Button() { X = Application.GetRealWidth(225), Y = Application.GetRealHeight(330), Width = Application.GetRealWidth(38), Height = Application.GetRealWidth(38), UnSelectedImagePath = "FunctionIcon/AC/WindHighIcon.png", }; controlView.AddChidren(btnWindSpeed); btnSwitch = new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(462), Width = Application.GetRealWidth(40), Height = Application.GetRealWidth(40), UnSelectedImagePath = "Public/PowerClose.png", SelectedImagePath = "Public/PowerOpen.png", }; controlView.AddChidren(btnSwitch); LoadEventList(); new TopViewDiv(bodyView, Language.StringByID(StringId.LocationManagement)).LoadTopView(function, actionRefresh); } } }