From 6eb21769c74cfcd10084f73ff3f212355849a3c7 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期一, 17 五月 2021 15:00:13 +0800
Subject: [PATCH] 2021-5-17-2
---
HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs | 105 ++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 97 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..da2a973 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,17 +111,28 @@
/// </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="frame">鐖舵帶浠�</param>
+ /// <param name="titleName">鏍囬鍚嶇О</param>
+ /// <param name="stateValue">涔嬪墠鐘舵�佸��</param>
+ /// <param name="action">杩斿洖鍥炶皟</param>
+ public void FLayoutView(FrameLayout frame, string titleName,string stateValue, Action<string> action)
{
+ FrameLayout fLayout = new FrameLayout
+ {
+ BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+ };
+ frame.AddChidren(fLayout);
fLayout.AddChidren(frameLayout);
frameLayout.AddChidren(btnTitle);
frameLayout.AddChidren(btnCancel);
@@ -131,13 +142,91 @@
frameLayout.AddChidren(seekBarVol);
frameLayout.AddChidren(btn_add);
frameLayout.AddChidren(btn_add_click);
+ btnTitle.Text = titleName;
+ //绗竴涓彉鍖栬褰曢�変腑鍊�
+ int brightnesValue = 0;
+ if (stateValue != "")
+ {
+ try
+ {
+ //杩涙潵鐨勭姸鎬�
+ brightnesValue = int.Parse(stateValue.Replace("%", ""));
+ seekBarVol.Progress = brightnesValue;
+ }
+ 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