From 5bd5cdbae1d22b5e14e6933b807ed97b89807b6f Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期三, 18 十月 2023 19:33:20 +0800 Subject: [PATCH] 2023年10月18日19:32:41 --- HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs | 2 HDL_ON/UI/UI2/FuntionControlView/Aks/SendMethod.cs | 8 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs | 71 +++++++++++++ HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs | 43 +++----- HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs | 101 +------------------- HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs | 8 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs | 42 ++++--- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs | 16 ++ HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs | 4 9 files changed, 137 insertions(+), 158 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs index 3b9cf3e..7d455a8 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs @@ -269,11 +269,11 @@ case SPK.SensorHelp: { LogicView.FunTypeView view = new LogicView.FunTypeView(); - view.btnText.TextID = StringId.qiujiuandzhengchang; + view.btnText.TextID = StringId.qiujiu; fLayout.AddChidren(view.FLayoutView()); view.btnClick.MouseUpEventHandler += (sender, e) => { - DeviceView(device, view.btnState, StringId.qiujiu, StringId.zhengchang ); + DeviceView(device, view.btnState, StringId.qiujiu, StringId.zhengchang,1); }; if (edit) { @@ -895,7 +895,7 @@ /// <param name="button">閫変腑鐘舵�佹樉绀烘枃鏈珺tn鎺т欢</param> /// <param name="btnText1">灞炴�х姸鎬佸�兼枃鏈�1</param> /// <param name="btnText2">灞炴�х姸鎬佸�兼枃鏈�2</param> - /// <param name="viewCount">view鏁伴噺</param> + /// <param name="viewCount">view鏁伴噺,榛樿2涓獀iew</param> private void DeviceView(Entity.Function device, Button button, int btnText1, int btnText2,int viewCount=2) { FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence }; @@ -1124,7 +1124,7 @@ if (device.spk == SPK.SensorLight) { //鐓ф槑浼犳劅鍣� - max =int.MaxValue; + max =1200; } new LogicView.TipPopView { }.InputBox(textInt, stateValue, (value) => diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs index f39f42f..7943ef1 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs @@ -539,10 +539,18 @@ } else { - int intValue = int.Parse(editText.Text.Trim()); - if (intValue <minValue || intValue > maxValue) + int intValue = -1; + try { - errorId_IsNullOrEmpty = Language.StringByID(StringId.setvalue).Replace("1",minValue.ToString()).Replace("000",maxValue.ToString()); + intValue = int.Parse(editText.Text.Trim()); + } + catch + { + intValue = -1; + } + if (intValue < minValue || intValue > maxValue) + { + errorId_IsNullOrEmpty = Language.StringByID(StringId.setvalue).Replace("1", minValue.ToString()).Replace("100", maxValue.ToString()); } } if (errorId_IsNullOrEmpty!="") @@ -557,7 +565,7 @@ btnTip.X = Application.GetRealWidth(53); btnTip.Y = editBjView.Bottom + Application.GetRealHeight(12); btnTip.Width = Application.GetRealWidth(157);//200 - btnTip.Height = Application.GetRealHeight(24);//17 + btnTip.Height = Application.GetRealHeight(17);//17 btnTip.Text = errorId_IsNullOrEmpty; btnTip.TextColor = CSS_Color.textRedColor; btnTip.TextSize = TextSize.text12; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs index e0333ce..3d0b7fc 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs @@ -128,8 +128,10 @@ { Y = topView.fLayout.Bottom, Height = Application.GetRealHeight(H_W.H - H_W.T_Height), + }; this.AddChidren(vv); + //杩涙潵榛樿鎾斁鍣ㄧ晫闈� //this.SwitchUI(IntType.Player); } @@ -192,7 +194,7 @@ { this.remoteControlList = SendMethod.Current.GetRemoteControlLits(this.device.deviceId); this.sequencerList = SendMethod.Current.GetSequencerLits(this.device.deviceId); - //TestData(this.remoteControlList); + TestData(this.remoteControlList); } catch { } finally diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs index 72a5ba3..c5eb0cc 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs @@ -16,10 +16,24 @@ /// 璁剧疆鎺у埗鐐瑰嚮浜嬩欢 /// </summary> /// <param name="isClick">false鐐瑰嚮鏃犳晥</param> - public void setClick(bool isClick) + public void SetClick(bool isClick) { this.mIsClick = isClick; } + /// <summary> + /// 璁剧疆鎺у埗鐐瑰嚮浜嬩欢 + /// </summary> + /// <param name="isClick">false鐐瑰嚮鏃犳晥</param> + public bool GetClick() + { + return this.mIsClick; + } + + /// <summary> + /// 寤舵椂鏃堕棿ms + /// </summary> + private const int millisecondsTimeout = 100; + /// <summary> /// 璋冩暣鐪熷疄楂樺害 /// </summary> @@ -60,8 +74,61 @@ } return bottomHeight; } + /// <summary> + /// 璁剧疆楂樹寒棰滆壊 + /// </summary> + /// <param name="view">缁勪欢</param> + public void SetHighlightBackground(View view) + { + if (view == null) + { + return; + } + //鎸変笅鍘绘敼鍙樿儗鏅鑹� + view.BackgroundColor = AksCommonMethod.seleBackgroundColor; + new System.Threading.Thread(() => + { + System.Threading.Thread.Sleep(millisecondsTimeout); + Application.RunOnMainThread(() => + { + //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� + view.BackgroundColor = 0x00000000; + }); + }) + { IsBackground = true }.Start(); - + } + + /// <summary> + /// 璁剧疆Button涓撶敤 + /// </summary> + /// <param name="button">缁勪欢</param> + public void SetButtonIsSelected(Button button) + { + if (button == null) + { + return; + } + //鎸変笅鍘绘敼鍙樿儗鏅鑹� + button.IsSelected =true; + new System.Threading.Thread(() => + { + System.Threading.Thread.Sleep(millisecondsTimeout); + Application.RunOnMainThread(() => + { + //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� + button.IsSelected=false; + }); + }) + { IsBackground = true }.Start(); + + } + + + + + + } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs index 7fb3e4a..a117fb3 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs @@ -152,35 +152,39 @@ { EventHandler<MouseEventArgs> UpClick = (sender, e) => { + if (!this.GetClick()) { + return; + } action?.Invoke(this, btnImage, btnName); - this.BackgroundColor = 0x00000000; + SetHighlightBackground(this); + //鎸変笅鍘绘敼鍙樿儗鏅鑹� + //this.BackgroundColor = AksCommonMethod.seleBackgroundColor; - //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� }; this.MouseUpEventHandler += UpClick; btnImage.MouseUpEventHandler += UpClick; btnName.MouseUpEventHandler += UpClick; - EventHandler<MouseEventArgs> CancelClick = (sender, e) => - { - this.BackgroundColor = 0x00000000; - //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� - }; - this.MouseUpOutsideEventHandler += CancelClick; - btnImage.MouseUpOutsideEventHandler += CancelClick; - btnName.MouseUpOutsideEventHandler += CancelClick; + //EventHandler<MouseEventArgs> CancelClick = (sender, e) => + //{ + // this.BackgroundColor = 0x00000000; + // //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� + //}; + //this.MouseUpOutsideEventHandler += CancelClick; + //btnImage.MouseUpOutsideEventHandler += CancelClick; + //btnName.MouseUpOutsideEventHandler += CancelClick; - EventHandler<MouseEventArgs> DownClick = (sender, e) => - { - - //鎸変笅鍘绘敼鍙樿儗鏅鑹� - this.BackgroundColor = AksCommonMethod.seleBackgroundColor; + //EventHandler<MouseEventArgs> DownClick = (sender, e) => + //{ - }; + // //鎸変笅鍘绘敼鍙樿儗鏅鑹� + // this.BackgroundColor = AksCommonMethod.seleBackgroundColor; - this.MouseDownEventHandler += DownClick; - btnImage.MouseDownEventHandler += DownClick; - btnName.MouseDownEventHandler += DownClick; + //}; + + //this.MouseDownEventHandler += DownClick; + //btnImage.MouseDownEventHandler += DownClick; + //btnName.MouseDownEventHandler += DownClick; } /// <summary> /// 璁剧疆鍥炬爣 diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs index 87995cc..ea95c39 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity; + namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView { /// <summary> @@ -128,20 +129,18 @@ //涓嶆敮鎸佹寜閿偣鍑昏儗鏅鑹� if (!keypad.isClicked) { - buttonFram.Enable = false; - buttonFram.GetImageButton().Alpha =0.5f; - buttonFram.GetImageButton().Enable = false; - buttonFram.GetNameButton().Enable = false; + buttonFram.GetImageButton().Alpha = 0.5f; buttonFram.GetNameButton().TextColor = AksCommonMethod.unBackgroundColor; - //buttonFram.BackgroundColor =AksCommonMethod.unParentBackgroundColor; + buttonFram.SetClick(false); } buttonFram.SetClickListener((fl, btnIcon, btnName) => { - if (buttonFram.Tag != null && buttonFram.Tag is KeypadEntity) + if (buttonFram.Tag == null) { - selectKeyAction?.Invoke((KeypadEntity)buttonFram.Tag); + return; } + selectKeyAction?.Invoke((KeypadEntity)buttonFram.Tag); }); //if (defaultIndex != -1 && defaultIndex == i) @@ -219,18 +218,18 @@ //涓嶆敮鎸佹寜閿偣鍑昏儗鏅鑹� if (!keypad.isClicked) { - buttonFram.Enable = false; buttonFram.GetImageButton().Alpha = 0.5f; - buttonFram.GetImageButton().Enable = false; - buttonFram.GetNameButton().Enable = false; buttonFram.GetNameButton().TextColor = AksCommonMethod.unBackgroundColor; + buttonFram.SetClick(false); } buttonFram.SetClickListener((fl, btnIcon, btnName) => { - if (buttonFram.Tag != null&& buttonFram.Tag is KeypadEntity) + if (buttonFram.Tag == null) { - selectKeyAction?.Invoke((KeypadEntity)buttonFram.Tag); + return; } + selectKeyAction?.Invoke((KeypadEntity)buttonFram.Tag); + }); //if (defaultIndex != -1 && defaultIndex == i) @@ -256,12 +255,12 @@ } int currnetheightValue = 0; int currnetWidthValue = 0; - int heightMaxValue = 84-6; + int heightMaxValue = 84 - 6; int widthMaxValue = 78; //鑾峰彇鐩稿涓�涓含搴﹀�� int heightDimensionValue = this.Height - Application.GetRealHeight(this.topMargin) - Application.GetRealHeight(this.bottomMargin) - Application.GetRealHeight(heightMaxValue / 2); int widthDimensionValue = this.Width - Application.GetRealWidth(this.leftMargin) - Application.GetRealWidth(this.rightMargin) - Application.GetRealHeight(widthMaxValue / 2); - for (int i = 0; i <mList.Count; i++) + for (int i = 0; i < mList.Count; i++) { var keypad = mList[i]; Button button = new Button @@ -292,29 +291,19 @@ //涓嶆敮鎸佹寜閿偣鍑昏儗鏅鑹� if (!keypad.isClicked) { - button.Enable = false; button.TextColor = AksCommonMethod.unBackgroundColor; + } - button.MouseDownEventHandler += (sen, e) => - { - - button.IsSelected = true; - }; - button.MouseUpOutsideEventHandler += (sen, e) => - { - button.IsSelected = false; - - }; button.MouseUpEventHandler += (sen, e) => { - if (button.Tag == null || ((KeypadEntity)button.Tag).keypad == "none") + if (button.Tag == null || ((KeypadEntity)button.Tag).keypad == "none"|| !((KeypadEntity)button.Tag).isClicked) { return; } selectKeyAction?.Invoke((KeypadEntity)button.Tag); - button.IsSelected = false; + SetButtonIsSelected(button); }; //if (defaultIndex != -1 && defaultIndex == i) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs index dba07fc..50de22b 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs @@ -144,28 +144,11 @@ keypadEntity.name = btnTop.Name; keypadEntity.keypad = "key_up"; action?.Invoke(keypadEntity); - btnTop.IsSelected = false; - //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� + SetButtonIsSelected(btnTop); }; btnTop.MouseUpEventHandler += UpClick; btnTopClick.MouseUpEventHandler += UpClick; - - EventHandler<MouseEventArgs> DownClick = (sender, e) => - { - //鎸変笅鍘绘敼鍙樿儗鏅鑹� - btnTop.IsSelected = true; - }; - btnTop.MouseDownEventHandler += DownClick; - btnTopClick.MouseDownEventHandler += DownClick; - - EventHandler<MouseEventArgs> OutsideClick = (sender, e) => - { - //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� - btnTop.IsSelected = false; - }; - btnTop.MouseUpOutsideEventHandler += OutsideClick; - btnTopClick.MouseUpOutsideEventHandler += OutsideClick; } /// <summary> @@ -180,31 +163,10 @@ keypadEntity.name = btnBottom.Name; keypadEntity.keypad = "key_down"; action?.Invoke(keypadEntity); - btnBottom.IsSelected = false; - //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� + SetButtonIsSelected(btnBottom); }; btnBottom.MouseUpEventHandler += UpClick; btnBottomClick.MouseUpEventHandler += UpClick; - - - EventHandler<MouseEventArgs> DownClick = (sender, e) => - { - btnBottom.IsSelected = true; - - //鎸変笅鍘绘敼鍙樿儗鏅鑹� - }; - btnBottom.MouseDownEventHandler += DownClick; - btnBottomClick.MouseDownEventHandler += DownClick; - - - EventHandler<MouseEventArgs> OutsideClick = (sender, e) => - { - //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� - btnBottom.IsSelected = false; - }; - btnBottom.MouseUpOutsideEventHandler += OutsideClick; - btnBottomClick.MouseUpOutsideEventHandler += OutsideClick; - } /// <summary> @@ -219,28 +181,10 @@ keypadEntity.name = btnLeft.Name; keypadEntity.keypad = "key_left"; action?.Invoke(keypadEntity); - btnLeft.IsSelected = false; - //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� + SetButtonIsSelected(btnLeft); }; btnLeft.MouseUpEventHandler += UpClick; btnLeftClick.MouseUpEventHandler += UpClick; - - - EventHandler<MouseEventArgs> DownClick = (sender, e) => - { - btnLeft.IsSelected = true; - //鎸変笅鍘绘敼鍙樿儗鏅鑹� - }; - btnLeft.MouseDownEventHandler += DownClick; - btnLeftClick.MouseDownEventHandler += DownClick; - - EventHandler<MouseEventArgs> OutsideClick = (sender, e) => - { - //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� - btnLeft.IsSelected = false; - }; - btnLeft.MouseUpOutsideEventHandler += OutsideClick; - btnLeftClick.MouseUpOutsideEventHandler += OutsideClick; } /// <summary> @@ -255,32 +199,12 @@ keypadEntity.name = btnRight.Name; keypadEntity.keypad = "key_right"; action?.Invoke(keypadEntity); - btnRight.IsSelected = false; - //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� + SetButtonIsSelected(btnRight); }; btnRight.MouseUpEventHandler += UpClick; btnRightClick.MouseUpEventHandler += UpClick; - - EventHandler<MouseEventArgs> DownClick = (sender, e) => - { - //鎸変笅鍘绘敼鍙樿儗鏅鑹� - btnRight.IsSelected = true; - - }; - btnRight.MouseDownEventHandler += DownClick; - btnRightClick.MouseDownEventHandler += DownClick; - - EventHandler<MouseEventArgs> OutsideClick = (sender, e) => - { - //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� - btnRight.IsSelected = false; - }; - btnRight.MouseUpOutsideEventHandler += OutsideClick; - btnRightClick.MouseUpOutsideEventHandler += OutsideClick; } - - /// <summary> /// ok @@ -294,25 +218,10 @@ keypadEntity.name = btnOk.Name; keypadEntity.keypad = "key_ok"; action?.Invoke(keypadEntity); - btnOk.IsSelected = false; - //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� + SetButtonIsSelected(btnOk); }; btnOk.MouseUpEventHandler += UpClick; - - EventHandler<MouseEventArgs> DownClick = (sender, e) => - { - btnOk.IsSelected = true; - //鎸変笅鍘绘敼鍙樿儗鏅鑹� - }; - btnOk.MouseDownEventHandler += DownClick; - - EventHandler<MouseEventArgs> OutsideClick = (sender, e) => - { - //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� - btnOk.IsSelected = false; - }; - btnOk.MouseUpOutsideEventHandler += OutsideClick; } } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/SendMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/SendMethod.cs index 1c07079..0b0e43a 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/SendMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/SendMethod.cs @@ -135,10 +135,10 @@ public bool KeypadExecute(string deviceId, string rcId, string keypad, string keyName, bool isSupport, TipType tipType = TipType.flicker) { - if (!isSupport) { - CommonMethod.Current.ShowTip("鎸夐敭涓嶆敮鎸�.", 3); - return false; - } + //if (!isSupport) { + // CommonMethod.Current.ShowTip("鎸夐敭涓嶆敮鎸�.", 3); + // return false; + //} Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("deviceId", deviceId);//璁惧id diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs index 527741b..9baec70 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs @@ -308,7 +308,7 @@ //杩斿洖 fanhuiFL.SetClickListener(() => { - KeyControl("return", "杩斿洖"); + KeyControl("cancel", "杩斿洖"); }); //涓婁竴閮� -- Gitblit v1.8.0