From fe3b2466c68b5db70d38e78039703add3b8b1dfe Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 31 十二月 2020 19:29:43 +0800 Subject: [PATCH] 合并了代码 --- ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs | 38 +++++++++++++++++++++++++------------- 1 files changed, 25 insertions(+), 13 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs index 09fa0c8..f0464ee 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceColorTemperatureLightDetailCardForm.cs @@ -53,11 +53,15 @@ this.ScrollEnabled = false; //鍏堟竻绌� this.listControl = new List<ButtonBase>(); + //璁剧疆鍒濆鐘舵�� + this.IsLightOpen = ((LightBase)this.device).OnOffStatus == 1; + this.canSetProgressValue = this.IsLightOpen; + //璁剧疆鐘舵�佹枃瀛� - if (((LightBase)this.device).OnOffStatus == 1) + if (this.IsLightOpen == true) { //浜害 XX - this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uBrightness) + " " + HdlDeviceCommonLogic.Current.GetMainPageDeviceStatuText(this.device)); + this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uBrightness) + " " + HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device)); } else { @@ -75,7 +79,14 @@ waveSeekBar.MaxValue = 100; waveSeekBar.Progress = (int)(((ColorTemperatureLight)this.device).Level * 1.0 / MaxLevel * 100); waveSeekBar.CornerRadius = Application.GetRealHeight(58); - waveSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarColor_Start, ZigbeeColor.Current.GXCWaveSeekBarColor_End); + if (this.IsLightOpen == true) + { + waveSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarColor_Start, ZigbeeColor.Current.GXCWaveSeekBarColor_End); + } + else + { + waveSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); + } frameWhiteBack.AddChidren(waveSeekBar); //寮�鍏� @@ -84,6 +95,7 @@ btnSwitch.SelectedImagePath = "Item/SwitchSelected.png"; btnSwitch.Y = waveSeekBar.Bottom + Application.GetRealHeight(418); btnSwitch.Gravity = Gravity.CenterHorizontal; + btnSwitch.IsSelected = this.IsLightOpen; frameWhiteBack.AddChidren(btnSwitch); listControl.Add(btnSwitch); btnSwitch.ButtonClickEvent += (sender, e) => @@ -91,14 +103,6 @@ //鍙戦�佸紑鍏冲懡浠� this.SetSwitchCommand(!btnSwitch.IsSelected); }; - - //璁剧疆鍒濆鐘舵�� - this.IsLightOpen = ((LightBase)this.device).OnOffStatus == 1; - this.canSetProgressValue = this.IsLightOpen; - if (IsLightOpen == true) - { - btnSwitch.IsSelected = true; - } //褰╃伅鎺т欢閲岄潰鐨勯偅涓樉绀虹櫨鍒嗘瘮鐨勬帶浠� int progressY = waveSeekBar.Y - Application.GetMinReal(154); @@ -153,7 +157,7 @@ //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴鏀圭紦瀛� ((ColorTemperatureLight)this.device).Level = value * MaxLevel / 100; //浜害 XX - this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uBrightness) + " " + HdlDeviceCommonLogic.Current.GetMainPageDeviceStatuText(this.device)); + this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uBrightness) + " " + HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device)); } }; @@ -339,7 +343,7 @@ if (isOpen == true) { //浜害鏄繀椤昏鍒锋柊鐨� 浜害 XX - this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uBrightness) + " " + HdlDeviceCommonLogic.Current.GetMainPageDeviceStatuText(this.device)); + this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uBrightness) + " " + HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device)); } if (isOpen == false && this.IsLightOpen == true) { @@ -350,6 +354,14 @@ { //寮�鍏崇姸鎬佸彉鏇� listControl[0].IsSelected = isOpen; + if (isOpen == true) + { + waveSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarColor_Start, ZigbeeColor.Current.GXCWaveSeekBarColor_End); + } + else + { + waveSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); + } } if (this.isProgressing == false) { -- Gitblit v1.8.0