From 34e965100d635346e2d4cd6e6013bdaed66b3004 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 02 一月 2020 19:52:13 +0800
Subject: [PATCH] 2019.1.2-3

---
 ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs |   87 ++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 76 insertions(+), 11 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs b/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
old mode 100755
new mode 100644
index 5d4d399..923e1f7
--- a/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Curtain/RollerShadeControl.cs
@@ -88,6 +88,10 @@
         /// ProgressBtnY
         /// </summary>
         int ProgressBtnY;
+        /// <summary>
+        /// ProgressBtnX
+        /// </summary>
+        int ProgressBtnX;
 
         #endregion
 
@@ -214,8 +218,8 @@
         /// Changeds the IS cene status.
         /// </summary>
         /// <param name="scene">Scene.</param>
-        public void ChangedISceneStatus(Scene scene)
-        {
+        public void ChangedISceneStatus(Scene scene)
+        {
             //throw new NotImplementedException();
         }
         #endregion
@@ -383,7 +387,8 @@
                 Gravity = Gravity.CenterHorizontal,
                 Text = device.CommonDevice.DeviceEpointName,
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
-                TextSize = 15
+                TextSize = 15,
+                IsBold=true
             };
             itemView.AddChidren(deviceNameBtn);
 
@@ -394,7 +399,8 @@
                 Height = Application.GetRealHeight(60),
                 Gravity = Gravity.CenterHorizontal,
                 TextColor = ZigbeeColor.Current.GXCTextGrayColor,
-                Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {device.GetDeviceStatu()}"
+                Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {device.GetDeviceStatu()}",
+                TextSize = 10
             };
             itemView.AddChidren(StatuBtn);
 
@@ -458,7 +464,7 @@
             }
 
             SetCurtainType(itemView, (device.CommonDevice as Rollershade).WcdType);
-            
+
             var roomBG = new Button
             {
                 Y = Application.GetRealHeight(1178 - 50),
@@ -494,7 +500,8 @@
                 Height = Application.GetRealHeight(50),
                 Text = room.Name,
                 TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.GXCTextWhiteColor
+                TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
+                TextSize = 12
             };
             itemView.AddChidren(roomName);
         }
@@ -741,6 +748,7 @@
                 curtainSeekBar.Width = Application.GetRealWidth(570);
                 curtainSeekBar.Height = Application.GetRealHeight(513);
                 curtainSeekBar.Gravity = Gravity.CenterHorizontal;
+                curtainSeekBar.IsProgressTextShow = false;
                 curtainSeekBar.Progress = (device.CommonDevice as Rollershade).WcdCurrentPositionLiftPercentage;
                 layout.AddChidren(curtainSeekBar);
 
@@ -748,6 +756,29 @@
                 {
                     (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainSeekBar.Progress);
                 };
+
+                curtainSeekBar.OnStartTrackingTouchEvent += (sender, e) =>
+                {
+                    OnProgressButtonMoveForCurtain(curtainSeekBar.Progress);
+                    ProgressBtn.Visible = true;
+                };
+
+                curtainSeekBar.OnStopTrackingTouchEvent += (sender, e) =>
+                {
+                    ProgressBtn.Visible = false;
+                };
+
+                curtainSeekBar.OnProgressChangedEvent += (send2, e2) =>
+                {
+
+                    OnProgressButtonMoveForCurtain(e2);
+
+                    //鍒ゆ柇鏄惁300ms灞忚斀
+                    //if (curtainRollSeekBar.IsProgressChangeDelay()) return;
+
+                    //(device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress);
+                };
+                InitProgressBtnForCurtain(layout);
             }
         }
 
@@ -764,18 +795,52 @@
                 Height = Application.GetMinReal(104),
                 UnSelectedImagePath = "Item/ProgressBubbles.png",
                 Visible = false,
-                Gravity = Gravity.CenterHorizontal
+                Gravity = Gravity.CenterHorizontal,
+                TextSize=14,
+                IsBold=true,
+                TextColor=ZigbeeColor.Current.GXCTextWhiteColor
             };
             layout.AddChidren(ProgressBtn);
         }
 
+        /// <summary>
+        /// OnProgressButtonMove
+        /// </summary>
+        private void OnProgressButtonMove(int mProgress)
+        {
+            ProgressBtn.Y = ProgressBtnY + curtainRollSeekBar.NowProgressY;
+            ProgressBtn.Text = mProgress + "%";
+        }
+
+
         /// <summary>
-        /// OnProgressButtonMove
+        /// 娣诲姞杩涘害鎸夐挳
         /// </summary>
-        private void OnProgressButtonMove(int mProgress)
+        private void InitProgressBtnForCurtain(FrameLayout layout)
         {
-            ProgressBtn.Y = ProgressBtnY + curtainRollSeekBar.NowProgressY;
-            ProgressBtn.Text = mProgress + "%";
+            ProgressBtnX = curtainSeekBar.X - Application.GetMinReal(20);
+            ProgressBtn = new Button()
+            {
+                X = ProgressBtnX,
+                Y = curtainSeekBar.Y + curtainSeekBar.Height / 2 - Application.GetMinReal(180),
+                Width = Application.GetMinReal(135),
+                Height = Application.GetMinReal(104),
+                UnSelectedImagePath = "Item/ProgressBubbles.png",
+                Visible = false,
+                TextSize = 14,
+                IsBold = true,
+                TextColor = ZigbeeColor.Current.GXCTextWhiteColor
+            };
+            layout.AddChidren(ProgressBtn);
+        }
+
+        /// <summary>
+        /// OnProgressButtonMove
+        /// </summary>
+        private void OnProgressButtonMoveForCurtain(int mProgress)
+        {
+            ProgressBtn.X = ProgressBtnX + curtainSeekBar.NowProgressX- Application.GetMinReal(5);
+            ProgressBtn.Text = mProgress + "%";
         }
 
         #endregion

--
Gitblit v1.8.0