From 9bea5849559521fe09b681025958886e9d6e2d74 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期二, 24 十二月 2019 14:29:51 +0800
Subject: [PATCH] 2019.12.24

---
 ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs |   63 +++++++++++++++++++++++++++++--
 1 files changed, 59 insertions(+), 4 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
index 94c1dc7..c8c1092 100644
--- a/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Light/DimmableLightControl.cs
@@ -67,6 +67,15 @@
         /// IsDrawerLockMode
         /// </summary>
         public bool IsDrawerLockMode;
+        /// <summary>
+        /// ProgressBtn
+        /// </summary>
+        Button ProgressBtn;
+        /// <summary>
+        /// ProgressBtnY
+        /// </summary>
+        int ProgressBtnY;
+
         #endregion
 
         #region 鈼� 鎺ュ彛__________________________
@@ -387,7 +396,7 @@
                 Width = Application.GetRealWidth(271),
                 Height = Application.GetRealHeight(533),
                 Gravity = Gravity.CenterHorizontal,
-                WavePadding = 2,
+                WavePadding = Application.GetRealWidth(8),
                 MaxValue=100,
                 Progress = (int)(dimmableLight.Level*1.0/MaxLevel*100),
                 WaveColor = ZigbeeColor.Current.GXCWaveSeekBarColor
@@ -405,10 +414,29 @@
                 levelSeekBar.WaveColor = ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor;
             }
 
-            levelSeekBar.OnProgressChangedEvent += (send2, e2) =>
+            levelSeekBar.OnStartTrackingTouchEvent += (sender, e) =>
+            {
+                OnProgressButtonMove(levelSeekBar.Progress);
+                ProgressBtn.Visible = true;
+            };
+
+            levelSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
+            {
+                ProgressBtn.Visible = false;
+            };
+
+            levelSeekBar.OnProgressChangedEvent += (send2, e2) =>
             {
-                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);
 
             switchBtn = new Button()
             {
@@ -462,6 +490,33 @@
             itemView.AddChidren(roomName);
         }
 
+        /// <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);
+        }
+
         #endregion
 
         #region 鈼� 缁戝畾鎸夐挳_______________________

--
Gitblit v1.8.0