From aed247d7fa4499665041864479fae82089eafe5f Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期二, 07 一月 2020 09:15:57 +0800 Subject: [PATCH] 2019.1.7 --- ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs | 113 +++++++++++++++++++++++++++++--------------------------- 1 files changed, 59 insertions(+), 54 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs old mode 100755 new mode 100644 index dc7d547..2a86275 --- a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs +++ b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs @@ -13,7 +13,7 @@ /// <summary> /// The action. /// </summary> - public Action action; + public Action<DeviceUI, Common.Room> action; ///// <summary> ///// The top view. ///// </summary> @@ -38,7 +38,7 @@ /// 鏀惰棌鎸夐挳 /// </summary> private Button collectionBtn; - + /// <summary> /// 寮�鍏� /// </summary> @@ -47,7 +47,7 @@ /// 婊戞潯 /// </summary> private WaveSeekBar levelSeekBar; - + private Button StatuBtn; /// <summary> @@ -185,7 +185,7 @@ break; } } - + } } catch (Exception ex) @@ -196,7 +196,7 @@ } else if (typeTag == "OnlineStatusChange") { - + } } @@ -211,8 +211,8 @@ { ZbGateway.StatusList.Remove(this); UserView.HomePage.Instance.ScrollEnabled = true; - //action(); - //action = null; + action(device, room); + action = null; if (IsDrawerLockMode) { CommonPage.Instance.IsDrawerLockMode = false; @@ -314,9 +314,9 @@ UserView.HomePage.Instance.AddChidren(detailInfo); UserView.HomePage.Instance.PageIndex += 1; detailInfo.Show(device, room); - detailInfo.action = () => + detailInfo.EditAction += (curDev, curRoom) => { - Show(device, room); + Show(curDev, curRoom); }; } @@ -422,29 +422,31 @@ levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor; } - levelSeekBar.OnStartTrackingTouchEvent += (sender, e) => - { - OnProgressButtonMove(levelSeekBar.Progress); - levelSeekBar.IsProgressTextShow = false; - ProgressBtn.Visible = true; - }; - - levelSeekBar.OnStopTrackingTouchEvent += (sender, e) => - { - ProgressBtn.Visible = false; - levelSeekBar.IsProgressTextShow = true; - }; - - levelSeekBar.OnProgressChangedEvent += (send2, e2) => + levelSeekBar.OnStartTrackingTouchEvent += (sender, e) => + { + OnProgressButtonMove(levelSeekBar.Progress); + levelSeekBar.IsProgressTextShow = false; + ProgressBtn.Visible = true; + }; + + levelSeekBar.OnStopTrackingTouchEvent += (sender, e) => + { + ProgressBtn.Visible = false; + levelSeekBar.IsProgressTextShow = true; + }; + + levelSeekBar.OnProgressChangedEvent += (send2, e2) => { - OnProgressButtonMove(e2); - - //鍒ゆ柇鏄惁300ms灞忚斀 - if (levelSeekBar.IsProgressChangeDelay()) return; - - dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0)); - }; + OnProgressButtonMove(e2); + + //鍒ゆ柇鏄惁300ms灞忚斀 + if (levelSeekBar.IsProgressChangeDelay()) return; + + dimmableLight.SetLevel((int)(levelSeekBar.Progress * MaxLevel / 100.0)); + }; + + InitProgressBtn(itemView); InitProgressBtn(itemView); @@ -501,31 +503,34 @@ itemView.AddChidren(roomName); } - /// <summary> - /// OnProgressButtonMove - /// </summary> - private void OnProgressButtonMove(int mProgress) - { - ProgressBtn.Y = ProgressBtnY + levelSeekBar.NowProgressY; - ProgressBtn.Text = mProgress + "%"; - } - - /// <summary> - /// 娣诲姞杩涘害鎸夐挳 - /// </summary> + /// <summary> + /// OnProgressButtonMove + /// </summary> + private void OnProgressButtonMove(int mProgress) + { + ProgressBtn.Y = ProgressBtnY + levelSeekBar.NowProgressY; + ProgressBtn.Text = mProgress + "%"; + } + + /// <summary> + /// 娣诲姞杩涘害鎸夐挳 + /// </summary> private void InitProgressBtn(FrameLayout layout) - { - ProgressBtnY = levelSeekBar.Y - Application.GetMinReal(154); - ProgressBtn = new Button() - { - Y = ProgressBtnY, - Width = Application.GetMinReal(135), - Height = Application.GetMinReal(104), - UnSelectedImagePath = "Item/ProgressBubbles.png", - Visible = false, - Gravity = Gravity.CenterHorizontal - }; - layout.AddChidren(ProgressBtn); + { + ProgressBtnY = levelSeekBar.Y - Application.GetMinReal(154); + ProgressBtn = new Button() + { + Y = ProgressBtnY, + Width = Application.GetMinReal(135), + Height = Application.GetMinReal(104), + UnSelectedImagePath = "Item/ProgressBubbles.png", + Visible = false, + Gravity = Gravity.CenterHorizontal, + TextSize = 14, + IsBold = true, + TextColor = ZigbeeColor.Current.GXCTextWhiteColor + }; + layout.AddChidren(ProgressBtn); } #endregion -- Gitblit v1.8.0