From baca65d449433d73516660d849c112ed8f5d3dd3 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期四, 19 十月 2023 10:35:32 +0800 Subject: [PATCH] 2023年10月19日10:34:19 --- HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs | 51 ++++++++++++--------------------------------------- 1 files changed, 12 insertions(+), 39 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs index 2fb6578..45d58cf 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs @@ -178,17 +178,17 @@ }); //闊抽噺+ - btn_jia.MouseDownEventHandler += (sender, e) => + btn_jia.MouseUpEventHandler += (sender, e) => { - btn_jia.IsSelected = true; ControlCommand(HisenseTVFunctionalAttributeConstant.volume_add, ""); + this.SetButtonIsSelected(btn_jia); }; //闊抽噺- - btn_jian.MouseDownEventHandler += (sender, e) => + btn_jian.MouseUpEventHandler += (sender, e) => { - btn_jian.IsSelected = true; ControlCommand(HisenseTVFunctionalAttributeConstant.volume_subtract, ""); + this.SetButtonIsSelected(btn_jian); }; //鑿滃崟 caidanBtn.SetClickListener((btn) => @@ -302,7 +302,7 @@ return; } - if (!this.device.online&& key!= HisenseTVFunctionalAttributeConstant.wol) + if (!this.device.online && key != HisenseTVFunctionalAttributeConstant.wol) { //璁惧涓嶅湪绾挎帶鍒跺け璐� Application.RunOnMainThread(() => @@ -499,16 +499,6 @@ }; yinliangFL.AddChidren(btn_jian); - btn_jia.MouseUpEventHandler += (sender, e) => - { - btn_jia.IsSelected = false; - - }; - btn_jian.MouseUpEventHandler += (sender, e) => - { - - btn_jian.IsSelected = false; - }; caidanBtn = new CustomButton(); caidanBtn.TextID = StringId.caidan; @@ -656,7 +646,7 @@ /// <summary> /// 鑷畾涔夛紙棣栭〉锛屽叧鏈猴紝鑿滃崟锛夊鍣� /// </summary> - class CustomFrameLayout : FrameLayout + class CustomFrameLayout : BaseFramLayout { public const int widthFrameLayout = 68; public const int heightFrameLayout = 68 + 8 + 20; @@ -714,21 +704,11 @@ /// <param name="button2">娉ㄦ剰:鍦⊿etClickListener()鍓嶉潰璋冪敤AddImageView()鎵嶆湁鏁�</param> public void SetClickListener(Action<FrameLayout, Button, Button> action) { - EventHandler<MouseEventArgs> DownClick = (sender, e) => - { - btnImage.IsSelected = true; - //btnText.IsSelected = true; - action?.Invoke(this, btnImage, btnText); - }; - this.MouseDownEventHandler += DownClick; - btnImage.MouseDownEventHandler += DownClick; - btnText.MouseDownEventHandler += DownClick; - EventHandler<MouseEventArgs> UpClick = (sender, e) => { - btnImage.IsSelected = false; - //btnText.IsSelected = false; + action?.Invoke(this, btnImage, btnText); + SetButtonIsSelected(btnImage); }; this.MouseUpEventHandler += UpClick; btnImage.MouseUpEventHandler += UpClick; @@ -766,19 +746,12 @@ /// <param name="action">鍥炶皟(绗竴涓槸鐖剁被瀵硅薄</param> public void SetClickListener(Action<Button> action) { - EventHandler<MouseEventArgs> DownClick = (sender, e) => - { - //this.BackgroundColor = 0xFFF2F3F7; - this.IsSelected = true; - action?.Invoke(this); - }; - this.MouseDownEventHandler += DownClick; - - EventHandler<MouseEventArgs> UpClick = (sender, e) => { - //this.BackgroundColor = 0xffECEDEE; - this.IsSelected = false; + + action?.Invoke(this); + new BaseFramLayout().SetButtonIsSelected(this); + }; this.MouseUpEventHandler += UpClick; -- Gitblit v1.8.0