From 8cefc1f93fc2db49465a5dd11ce94ed11267ea53 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期二, 22 八月 2023 17:48:39 +0800 Subject: [PATCH] 2023年08月22日17:48:30 --- HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs | 199 +++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 159 insertions(+), 40 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs index 6b5a1b0..0b3d646 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> @@ -160,47 +160,129 @@ btnOpenCollectIcon.IsSelected = this.device.collect = !btnOpenCollectIcon.IsSelected; this.device.CollectFunction(); }; - + //棣栭〉 - 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, "0", (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); }; @@ -213,10 +295,40 @@ //寮�鏈� clickBtn.MouseDownEventHandler += (sen, e) => { - vv.Visible = true; - baseCloseFFL.Visible = false; + ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "1", (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> /// 鍒濆鏁版嵁 @@ -242,6 +354,8 @@ } }); } + + #region -------鐣岄潰甯冨眬--------- /// <summary> /// 鍒濆鍖栥�愬紑鏈恒�戠晫闈� /// </summary> @@ -316,7 +430,7 @@ shouyeFL.AddImageView(); shouyeFL.AddTextButtonView(); shouyeFL.GetImageButton().UnSelectedImagePath = "HisenseTv/shouye.png"; - shouyeFL.GetTextButton().Text = "棣栭〉"; + shouyeFL.GetTextButton().TextID = StringId.shouye; kaiguanFL = new CustomFrameLayout(); @@ -326,7 +440,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 +449,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 +474,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 +504,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 +534,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 +549,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 +681,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 +715,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 +734,7 @@ /// <summary> /// 鍒濆鍖栧ご閮� /// </summary> - private void InitTopUI() + private void InitTopUI() { this.BackgroundColor = MusicColor.ViewColor; this.topView = new TopView(); @@ -692,9 +808,11 @@ } //this.cellFrame.X = this.btnCurrDeviceRoom.Right + Application.GetRealWidth(20); } - - } + #endregion + + } + #region -------鑷畾涔夊綋鍓嶇晫闈㈢殑瀹瑰櫒--------- /// <summary> /// 鑷畾涔夛紙棣栭〉锛屽叧鏈猴紝鑿滃崟锛夊鍣� /// </summary> @@ -1052,6 +1170,7 @@ button.SetClickListener((btn) => { // MovieLibrary movieLibrary = new MovieLibrary(); + selectAction?.Invoke(button.Text); }); //if (CurrnetSelectIndex != -1 && CurrnetSelectIndex == i) @@ -1065,7 +1184,7 @@ { return new List<string> { - "HDML 1", + "HDML 1",//" " "HDML 2", "HDML 3", "HDML 4", @@ -1078,6 +1197,6 @@ } - + #endregion } -- Gitblit v1.8.0