From 58d4ef9af9c906acf2e9f65a3e65092363c8e1cd Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期四, 24 八月 2023 17:42:49 +0800 Subject: [PATCH] 2023年08月24日17:42:25 --- HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs | 62 +++++++++++++++++++------------ 1 files changed, 38 insertions(+), 24 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs index 0b3d646..e939fda 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs @@ -29,6 +29,11 @@ /// </summary> private Button btnRoomName; /// <summary> + /// 涓婁竴绾х晫闈㈢殑鏀惰棌鎺т欢 + /// </summary> + private Button btnCollectionIcon; + + /// <summary> /// 澶撮儴甯冨眬 /// </summary> private TopView topView; @@ -83,12 +88,14 @@ /// </summary> /// <param name="function">璁惧</param> /// <param name="btnDeviceName">涓婁竴绾х晫闈㈢殑璁惧鍚嶅瓧鎺т欢(娉�:涓嶈兘浼爊ull,娌℃湁鍙互浼爊ew Button())</param> - /// <param name="btnRoomName">涓婁竴绾х晫闈㈢殑鎴块棿鍚嶅瓧鎺т欢(娉�:涓嶈兘浼爊ull,娌℃湁鍙互浼爊ew Button())</param> - public HisenseTvPage(Function function, Button btnDeviceName, Button btnRoomName, CommonMethod.Comerom comerom, Action action) + /// <param name="btnRoomName">涓婁竴绾х晫闈㈢殑鎴块棿鍚嶅瓧鎺т欢(娉�:涓嶈兘浼爊ull,娌℃湁鍙互浼爊ew Button())</param> + /// <param name="btnCollectionIcon">涓婁竴绾х晫闈㈢殑鎴块棿鍚嶅瓧鎺т欢(娉�:涓嶈兘浼爊ull,娌℃湁鍙互浼爊ew Button())</param> + public HisenseTvPage(Function function, Button btnDeviceName, Button btnRoomName, Button btnCollectionIcon, CommonMethod.Comerom comerom, Action action) { this.device = function; this.btnDeviceName = btnDeviceName; this.btnRoomName = btnRoomName; + this.btnCollectionIcon = btnCollectionIcon; this.comerom = comerom; this.action = action; @@ -159,6 +166,8 @@ { btnOpenCollectIcon.IsSelected = this.device.collect = !btnOpenCollectIcon.IsSelected; this.device.CollectFunction(); + btnCloseCollectIcon.IsSelected = btnOpenCollectIcon.IsSelected; + this.btnCollectionIcon.IsSelected = btnOpenCollectIcon.IsSelected; }; //棣栭〉 @@ -169,7 +178,7 @@ //鍏虫満 kaiguanFL.SetClickListener((fl, btnImage, btnText) => { - ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "0", (isBool) => + ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "off", (isBool) => { if (isBool) { @@ -291,11 +300,13 @@ { btnCloseCollectIcon.IsSelected = this.device.collect = !btnCloseCollectIcon.IsSelected; this.device.CollectFunction(); + btnOpenCollectIcon.IsSelected = btnCloseCollectIcon.IsSelected; + this.btnCollectionIcon.IsSelected = btnCloseCollectIcon.IsSelected; }; //寮�鏈� clickBtn.MouseDownEventHandler += (sen, e) => { - ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "1", (isBool) => + ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "on", (isBool) => { if (isBool) { @@ -331,7 +342,7 @@ catch { } } /// <summary> - /// 鍒濆鏁版嵁 + /// 鍒濆鍖栨暟鎹� /// </summary> private void ReadData() { @@ -743,29 +754,32 @@ this.AddChidren(topView.TopFLayoutView()); } /// <summary> - /// 鏍规嵁璁惧寮�鍏崇姸鎬佹樉绀烘寚瀹氭樉绀虹晫闈� + /// 鏍规嵁璁惧寮�鍏崇姸鎬佹樉绀烘寚瀹氱晫闈� /// (杩涙潵鐨勬椂鍊欑敤鍒�) /// </summary> /// <returns></returns> private void CurrentAssignPage() { + CommonMethod.Current.MainThread(() => + { - if (this.device == null) - { - vv.Visible = false; - baseCloseFFL.Visible = true; - return; - } - if (this.device.GetAttrState("on_off") == "on") - { - vv.Visible = true; - baseCloseFFL.Visible = false; - } - else - { - vv.Visible = false; - baseCloseFFL.Visible = true; - } + if (this.device == null) + { + vv.Visible = false; + baseCloseFFL.Visible = true; + return; + } + if (this.device.GetAttrState("on_off") == "on" || this.device.GetAttrState("on_off") == "1") + { + vv.Visible = true; + baseCloseFFL.Visible = false; + } + else + { + vv.Visible = false; + baseCloseFFL.Visible = true; + } + }); } @@ -875,7 +889,7 @@ { EventHandler<MouseEventArgs> DownClick = (sender, e) => { - this.BackgroundColor = 0xFFF2F3F7; + //this.BackgroundColor = 0xFFF2F3F7; action?.Invoke(this, btnImage, btnText); }; this.MouseDownEventHandler += DownClick; @@ -885,7 +899,7 @@ EventHandler<MouseEventArgs> UpClick = (sender, e) => { - this.BackgroundColor = 0x00000000; + //this.BackgroundColor = 0x00000000; }; this.MouseUpEventHandler += UpClick; btnImage.MouseUpEventHandler += UpClick; -- Gitblit v1.8.0