From 1adc419371631dfae3a9050fd593bbd537de9932 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期一, 21 十二月 2020 15:03:12 +0800 Subject: [PATCH] 2020-12-21-2 --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs | 99 +++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 91 insertions(+), 8 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs index 70dcbe9..ef6ceed 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs @@ -72,22 +72,22 @@ /// </summary> public Button btn_subtract_click = new Button { - Width = Application.GetMinRealAverage(24+20), + Width = Application.GetMinRealAverage(24 + 20), Height = Application.GetMinRealAverage(24), - X = Application.GetRealWidth(26-20), + X = Application.GetRealWidth(26 - 20), Y = Application.GetRealHeight(118), }; public DiyImageSeekBar seekBarVol = new DiyImageSeekBar { Y = Application.GetRealHeight(103),//杩涘害鏉$埗鎺т欢Y鍧愭爣 - X = Application.GetRealWidth(62-10),//杩涘害鏉鍧愭爣 - SeekBarPadding=Application.GetRealHeight(10),//杩涘害鏉″疄闄呴暱搴�=244-10*2(鍐呰竟璺�); + X = Application.GetRealWidth(62 - 10),//杩涘害鏉鍧愭爣 + SeekBarPadding = Application.GetRealHeight(10),//杩涘害鏉″疄闄呴暱搴�=244-10*2(鍐呰竟璺�); Width = Application.GetRealWidth(240),//杩涘害鏉$殑闀垮害 Height = Application.GetRealHeight(54),//杩涘害鏉$埗鎺т欢楂樺害 IsProgressTextShow = true,//鏄剧ず鐧惧垎姣� IsClickable = true,//杩涘害鏉℃槸鍚︽粦鍔� - ProgressBarColor =CSS.CSS_Color.textConfirmColor,//閫変腑杩涘害鏉¢鑹� + ProgressBarColor = CSS.CSS_Color.textConfirmColor,//閫変腑杩涘害鏉¢鑹� ThumbImagePath = "LogicIcon/point.png",//杩涘害鏉℃寜閽浘鏍� ThumbImageHeight = Application.GetRealHeight(54),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級 ProgressTextColor = CSS.CSS_Color.textColor, @@ -111,16 +111,22 @@ /// </summary> public Button btn_add_click = new Button { - Width = Application.GetMinRealAverage(24+20), + Width = Application.GetMinRealAverage(24 + 20), Height = Application.GetMinRealAverage(24), X = Application.GetRealWidth(294), Y = Application.GetRealHeight(118), }; + + + /// <summary> /// View鐨勬柟娉� /// </summary> - /// <param name="fLayout"></param> - public void FLayoutView(FrameLayout fLayout) + /// <param name="fLayout">鐖舵帶浠�</param> + /// <param name="titleName">鏍囬鍚嶇О</param> + /// <param name="stateValue">涔嬪墠鐘舵�佸��</param> + /// <param name="action">杩斿洖鍥炶皟</param> + public void FLayoutView(FrameLayout fLayout, string titleName,string stateValue, Action<string> action) { fLayout.AddChidren(frameLayout); frameLayout.AddChidren(btnTitle); @@ -131,13 +137,90 @@ frameLayout.AddChidren(seekBarVol); frameLayout.AddChidren(btn_add); frameLayout.AddChidren(btn_add_click); + //绗竴涓彉鍖栬褰曢�変腑鍊� + int brightnesValue = 0; + if (stateValue != "") + { + try + { + //杩涙潵鐨勭姸鎬� + brightnesValue = int.Parse(stateValue); + seekBarVol.Progress = int.Parse(stateValue); + } + catch { } + } + //鈥旂偣鍑讳簨浠� + btn_subtract_click.MouseUpEventHandler += (sender2, e2) => + { + if (brightnesValue > 0) + { + brightnesValue -= 1; + seekBarVol.Progress = brightnesValue; + } + }; + //+鐐瑰嚮浜嬩欢 + btn_add_click.MouseUpEventHandler += (sende2, e2) => + { + if (brightnesValue < 100) + { + brightnesValue += 1; + seekBarVol.Progress = brightnesValue; + + } + }; + //杩涘害鏉℃粦鍔ㄧ偣鍑讳簨浠� + EventHandler<int> progressclick = (sender2, e2) => + { + brightnesValue = seekBarVol.Progress; + }; + seekBarVol.OnProgressChangedEvent += progressclick; + seekBarVol.OnStopTrackingTouchEvent += progressclick; //鍙栨秷鐐瑰嚮浜嬩欢 btnCancel.MouseUpEventHandler += (sender, e1) => { //绉婚櫎fLayout鐣岄潰 fLayout.RemoveFromParent(); }; + //纭畾鐐瑰嚮浜嬩欢 + btnConfirm.MouseUpEventHandler += (sender, e1) => + { + //if (brightnesValue == 0) + //{ + // return; + //} + action(brightnesValue.ToString()); + //绉婚櫎fLayout鐣岄潰 + fLayout.RemoveFromParent(); + }; + } + + + + + ///// <summary> + ///// View鐨勬柟娉� + ///// </summary> + ///// <param name="fLayout"></param> + //public void FLayoutView(FrameLayout fLayout) + //{ + // fLayout.AddChidren(frameLayout); + // frameLayout.AddChidren(btnTitle); + // frameLayout.AddChidren(btnCancel); + // frameLayout.AddChidren(btnConfirm); + // frameLayout.AddChidren(btn_subtract); + // frameLayout.AddChidren(btn_subtract_click); + // frameLayout.AddChidren(seekBarVol); + // frameLayout.AddChidren(btn_add); + // frameLayout.AddChidren(btn_add_click); + // //鍙栨秷鐐瑰嚮浜嬩欢 + // btnCancel.MouseUpEventHandler += (sender, e1) => + // { + // //绉婚櫎fLayout鐣岄潰 + // fLayout.RemoveFromParent(); + // }; + + //} } } -- Gitblit v1.8.0