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 | 257 +++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 195 insertions(+), 62 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs index 6b5a1b0..e939fda 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs @@ -15,7 +15,7 @@ { - #region 鈻� 鍙橀噺澹版槑___________________________ + #region -------鍙橀噺澹版槑--------- /// <summary> /// 璁惧 /// </summary> @@ -28,6 +28,11 @@ /// 涓婁竴绾х晫闈㈢殑鎴块棿鍚嶅瓧鎺т欢 /// </summary> private Button btnRoomName; + /// <summary> + /// 涓婁竴绾х晫闈㈢殑鏀惰棌鎺т欢 + /// </summary> + private Button btnCollectionIcon; + /// <summary> /// 澶撮儴甯冨眬 /// </summary> @@ -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,48 +166,132 @@ { btnOpenCollectIcon.IsSelected = this.device.collect = !btnOpenCollectIcon.IsSelected; this.device.CollectFunction(); + btnCloseCollectIcon.IsSelected = btnOpenCollectIcon.IsSelected; + this.btnCollectionIcon.IsSelected = btnOpenCollectIcon.IsSelected; }; - + //棣栭〉 - shouyeFL.SetClickListener((fl, btnImage, btnText) => { }); + shouyeFL.SetClickListener((fl, btnImage, btnText) => + { + ControlCommand(HisenseTVFunctionalAttributeConstant.home_page, ""); + }); //鍏虫満 kaiguanFL.SetClickListener((fl, btnImage, btnText) => { - vv.Visible = false; - baseCloseFFL.Visible = true; + ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "off", (isBool) => + { + if (isBool) + { + CommonMethod.Current.MainThread(() => + { + vv.Visible = false; + baseCloseFFL.Visible = true; + }); + } + else + { + //鎻愮ず:鍏虫満澶辫触; + } + }); }); //鑿滃崟 - caidanFL.SetClickListener((fl, btnImage, btnText) => { }); + caidanFL.SetClickListener((fl, btnImage, btnText) => + { + ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "11"); + + }); //闊抽噺+ - btn_jia.MouseDownEventHandler += (sender, e) => { }; + btn_jia.MouseDownEventHandler += (sender, e) => + { + ControlCommand(HisenseTVFunctionalAttributeConstant.volume_add, ""); + + }; //闊抽噺- - btn_jian.MouseDownEventHandler += (sender, e) => { }; + btn_jian.MouseDownEventHandler += (sender, e) => + { + ControlCommand(HisenseTVFunctionalAttributeConstant.volume_subtract, ""); + }; //鎾斁 - bofangBtn.SetClickListener((btn) => { }); + bofangBtn.SetClickListener((btn) => + { + ControlCommand(HisenseTVFunctionalAttributeConstant.media_play, ""); + + }); //鏆傚仠 - zantingBtn.SetClickListener((btn) => { }); + zantingBtn.SetClickListener((btn) => + { + ControlCommand(HisenseTVFunctionalAttributeConstant.media_pause, ""); + }); //蹇繘 - kuaijinBtn.SetClickListener((btn) => { }); + kuaijinBtn.SetClickListener((btn) => + { + ControlCommand(HisenseTVFunctionalAttributeConstant.fast_forward, ""); + }); //蹇�� - kauituiBtn.SetClickListener((btn) => { }); + kauituiBtn.SetClickListener((btn) => + { + ControlCommand(HisenseTVFunctionalAttributeConstant.fast_back, ""); + }); //闈欓煶 - jingyinBtn.SetClickListener((btn) => { }); + jingyinBtn.SetClickListener((btn) => + { + ControlCommand(HisenseTVFunctionalAttributeConstant.mute, "1"); + }); //璁剧疆 - shezhiBtn.SetClickListener((btn) => { }); + shezhiBtn.SetClickListener((btn) => + { + ControlCommand(HisenseTVFunctionalAttributeConstant.system_setting, ""); + }); //瑙i櫎闈欓煶 - jiechujingyinBtn.SetClickListener((btn) => { }); + jiechujingyinBtn.SetClickListener((btn) => + { + ControlCommand(HisenseTVFunctionalAttributeConstant.mute, "0"); + }); //杩斿洖 - fanhuiBtn.SetClickListener((btn) => { }); - //鎺у埗鑿滃崟 + fanhuiBtn.SetClickListener((btn) => + { + ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "5"); + }); + //涓� + muenFrameLayout.SetTopClickListener((muen) => + { + + ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "0"); + + }); + //涓� + muenFrameLayout.SetBottomClickListener((muen) => + { + + ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "1"); + + }); + //宸� muenFrameLayout.SetLeftClickListener((muen) => { + + ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "2"); + + }); + //鍙� + muenFrameLayout.SetRightClickListener((muen) => + { + + ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "3"); + + }); + //OK + muenFrameLayout.SetOkClickListener((muen) => + { + + ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "4"); }); //淇″彿婧� sourceFrameLayout.selectAction += (text) => { - - + string value = text.Replace(" ", "_"); + ControlCommand(HisenseTVFunctionalAttributeConstant.signal, value); }; @@ -209,17 +300,49 @@ { btnCloseCollectIcon.IsSelected = this.device.collect = !btnCloseCollectIcon.IsSelected; this.device.CollectFunction(); + btnOpenCollectIcon.IsSelected = btnCloseCollectIcon.IsSelected; + this.btnCollectionIcon.IsSelected = btnCloseCollectIcon.IsSelected; }; //寮�鏈� clickBtn.MouseDownEventHandler += (sen, e) => { - vv.Visible = true; - baseCloseFFL.Visible = false; + ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "on", (isBool) => + { + if (isBool) + { + CommonMethod.Current.MainThread(() => + { + vv.Visible = true; + baseCloseFFL.Visible = false; + }); + } + else + { + //鎻愮ず:寮�鏈哄け璐�; + } + }); + }; } /// <summary> - /// 鍒濆鏁版嵁 + /// 鍙戦�佹帶鍒跺睘鎬ф寚浠� + /// </summary> + /// <param name="key">鍔熻兘灞炴��(璇泙涓婂畾涔夌殑)</param> + /// <param name="value">鍊�</param> + /// <param name="action">缁撴灉鍥炶皟(榛樿涓嶅洖璋�)</param> + private void ControlCommand(string key, string value, Action<bool> action = null) + { + try + { + Dictionary<string, string> dic = new Dictionary<string, string>(); + dic.Add(key, value); + Send.Current.SendControlCommand(this.device, dic, action); + } + catch { } + } + /// <summary> + /// 鍒濆鍖栨暟鎹� /// </summary> private void ReadData() { @@ -242,6 +365,8 @@ } }); } + + #region -------鐣岄潰甯冨眬--------- /// <summary> /// 鍒濆鍖栥�愬紑鏈恒�戠晫闈� /// </summary> @@ -316,7 +441,7 @@ shouyeFL.AddImageView(); shouyeFL.AddTextButtonView(); shouyeFL.GetImageButton().UnSelectedImagePath = "HisenseTv/shouye.png"; - shouyeFL.GetTextButton().Text = "棣栭〉"; + shouyeFL.GetTextButton().TextID = StringId.shouye; kaiguanFL = new CustomFrameLayout(); @@ -326,7 +451,7 @@ kaiguanFL.AddImageView(); kaiguanFL.AddTextButtonView(); kaiguanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/kaiguan.png"; - kaiguanFL.GetTextButton().Text = "鍏虫満"; + kaiguanFL.GetTextButton().TextID = StringId.guanji; caidanFL = new CustomFrameLayout(); backgroundOpenFl.AddChidren(caidanFL); @@ -335,7 +460,7 @@ caidanFL.AddImageView(); caidanFL.AddTextButtonView(); caidanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/caidan.png"; - caidanFL.GetTextButton().Text = "鑿滃崟"; + caidanFL.GetTextButton().TextID = StringId.caidan; var yinliangFL = new FrameLayout(); backgroundOpenFl.AddChidren(yinliangFL); @@ -360,7 +485,8 @@ { Y = Application.GetRealHeight(90), Height = Application.GetRealHeight(20), - Text = "闊抽噺", + //Text = "闊抽噺", + TextID = StringId.yinliang, TextColor = MusicColor.TextColor, TextSize = TextSize.Text14, Gravity = Gravity.CenterHorizontal, @@ -389,28 +515,28 @@ }; bofangBtn = new CustomButton(); - bofangBtn.Text = "鎾斁"; + bofangBtn.TextID = StringId.bofang; bofangBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24); bofangBtn.X = yinliangFL.Right + Application.GetRealWidth(37); backgroundOpenFl.AddChidren(bofangBtn); zantingBtn = new CustomButton(); - zantingBtn.Text = "鏆傚仠"; + zantingBtn.TextID = StringId.zanting; zantingBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24); zantingBtn.X = bofangBtn.Right + Application.GetRealWidth(37); backgroundOpenFl.AddChidren(zantingBtn); kuaijinBtn = new CustomButton(); - kuaijinBtn.Text = "蹇繘"; + kuaijinBtn.TextID = StringId.kuaijin; kuaijinBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16); kuaijinBtn.X = yinliangFL.Right + Application.GetRealWidth(37); backgroundOpenFl.AddChidren(kuaijinBtn); kauituiBtn = new CustomButton(); - kauituiBtn.Text = "蹇��"; + kauituiBtn.TextID = StringId.kuaitui; kauituiBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16); kauituiBtn.X = kuaijinBtn.Right + Application.GetRealWidth(37); backgroundOpenFl.AddChidren(kauituiBtn); @@ -419,14 +545,14 @@ jingyinBtn = new CustomButton(); - jingyinBtn.Text = "闈欓煶"; + jingyinBtn.TextID = StringId.jingyin; jingyinBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16); jingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37); backgroundOpenFl.AddChidren(jingyinBtn); shezhiBtn = new CustomButton(); - shezhiBtn.Text = "璁剧疆"; + shezhiBtn.TextID = StringId.shezhi; shezhiBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16); shezhiBtn.X = jingyinBtn.Right + Application.GetRealWidth(37); backgroundOpenFl.AddChidren(shezhiBtn); @@ -434,14 +560,14 @@ jiechujingyinBtn = new CustomButton(); - jiechujingyinBtn.Text = "瑙i櫎闈欓煶"; + jiechujingyinBtn.TextID = StringId.jiechujingyin; jiechujingyinBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16); jiechujingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37); backgroundOpenFl.AddChidren(jiechujingyinBtn); fanhuiBtn = new CustomButton(); - fanhuiBtn.Text = "杩斿洖"; + fanhuiBtn.TextID = StringId.fanhui; fanhuiBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16); fanhuiBtn.X = jiechujingyinBtn.Right + Application.GetRealWidth(37); backgroundOpenFl.AddChidren(fanhuiBtn); @@ -566,7 +692,8 @@ Height = Application.GetRealHeight(22), TextSize = TextSize.Text16, TextColor = MusicColor.TextColor, - Text = "宸插叧鏈�", + //Text = "宸插叧鏈�", + TextID = StringId.yiguanji, TextAlignment = TextAlignment.Center, Gravity = Gravity.CenterHorizontal, Padding = new Padding(0, 16, 0, 16), @@ -599,7 +726,7 @@ Height = Application.GetRealHeight(16), TextSize = TextSize.Text12, TextColor = MusicColor.TextCancelColor, - Text = "寮�鏈�", + TextID = StringId.kaiji, TextAlignment = TextAlignment.Center, Gravity = Gravity.CenterHorizontal, Padding = new Padding(0, 2, 0, 2), @@ -618,7 +745,7 @@ /// <summary> /// 鍒濆鍖栧ご閮� /// </summary> - private void InitTopUI() + private void InitTopUI() { this.BackgroundColor = MusicColor.ViewColor; this.topView = new TopView(); @@ -627,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; + } + }); } @@ -692,9 +822,11 @@ } //this.cellFrame.X = this.btnCurrDeviceRoom.Right + Application.GetRealWidth(20); } - - } + #endregion + + } + #region -------鑷畾涔夊綋鍓嶇晫闈㈢殑瀹瑰櫒--------- /// <summary> /// 鑷畾涔夛紙棣栭〉锛屽叧鏈猴紝鑿滃崟锛夊鍣� /// </summary> @@ -757,7 +889,7 @@ { EventHandler<MouseEventArgs> DownClick = (sender, e) => { - this.BackgroundColor = 0xFFF2F3F7; + //this.BackgroundColor = 0xFFF2F3F7; action?.Invoke(this, btnImage, btnText); }; this.MouseDownEventHandler += DownClick; @@ -767,7 +899,7 @@ EventHandler<MouseEventArgs> UpClick = (sender, e) => { - this.BackgroundColor = 0x00000000; + //this.BackgroundColor = 0x00000000; }; this.MouseUpEventHandler += UpClick; btnImage.MouseUpEventHandler += UpClick; @@ -1052,6 +1184,7 @@ button.SetClickListener((btn) => { // MovieLibrary movieLibrary = new MovieLibrary(); + selectAction?.Invoke(button.Text); }); //if (CurrnetSelectIndex != -1 && CurrnetSelectIndex == i) @@ -1065,7 +1198,7 @@ { return new List<string> { - "HDML 1", + "HDML 1",//" " "HDML 2", "HDML 3", "HDML 4", @@ -1078,6 +1211,6 @@ } - + #endregion } -- Gitblit v1.8.0