From 505effa88b17ce8c3c7ac5403b76d9e5d0cfc2a5 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期一, 28 十月 2024 11:58:31 +0800
Subject: [PATCH] 谷歌版本问题修复

---
 HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs |  109 ++++++++++++++++++++++++++----------------------------
 1 files changed, 52 insertions(+), 57 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs
index 9602f7c..a8a547d 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs
@@ -95,7 +95,7 @@
             FrameLayout controlView = new FrameLayout()
             {
                 Gravity = Gravity.CenterHorizontal,
-                Y = Application.GetRealHeight(88),
+                Y = Application.GetRealHeight(88 + 10),
                 Width = Application.GetRealWidth(327),
                 Height = Application.GetRealHeight(526),
                 BackgroundImagePath = "Public/Fragmentbg.png",
@@ -300,24 +300,19 @@
                     return;
                 if (updateTemp.spk == bodyView.function.spk && updateTemp.sid == bodyView.function.sid)
                 {
-                try
+                    try
                     {
-                        if (!bodyView.onCurtainAnimation)
+                        var percent = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Percent));
+                        bodyView.curtainSeekBar.Progress = percent;
+                        bodyView.btnProgress.Text = percent + "%";
+
+                        var e = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Angle));
+                        bodyView.angleBar.Progress = e;
+                        float angle = e - 90;
+                        bodyView.btnAngle.Text = (e - 0) + "掳";
+                        foreach (var btn in bodyView.buttons)
                         {
-                            var percent = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Percent));
-                            bodyView.CurtainAnimation(percent);
-                            bodyView.btnProgress.Text = percent + "%";
-
-                            var e = Convert.ToInt32( updateTemp.GetAttrState(FunctionAttributeKey.Angle));
-                            bodyView.angleBar.Progress = e;
-                            float angle = e - 90;
-                            bodyView.btnAngle.Text = (e - 0) + "掳";
-                            foreach (var btn in bodyView.buttons)
-                            {
-                                btn.SetRotation(angle);
-                            }
-
-
+                            btn.SetRotation(angle);
                         }
                     }
                     catch { }
@@ -424,24 +419,24 @@
         {
             btnCurtainClose.MouseUpEventHandler = (sender, e) =>
             {
-            //if (!function.online)
-            //{
-            //    new Tip()
-            //    {
-            //        CloseTime = 1,
-            //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-            //        Direction = AMPopTipDirection.None,
-            //    }.Show(MainPage.BaseView);
-            //    return;
-            //}
-            new System.Threading.Thread(() =>
-            {
-                System.Threading.Thread.Sleep(2000);
-                Application.RunOnMainThread(() =>
+                if (!function.isOnline())
                 {
-                    btnCurtainClose.IsSelected = false;
-                });
-            })
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
+                new System.Threading.Thread(() =>
+                    {
+                        System.Threading.Thread.Sleep(2000);
+                        Application.RunOnMainThread(() =>
+                        {
+                            btnCurtainClose.IsSelected = false;
+                        });
+                    })
                 { IsBackground = true }.Start();
                 function.trait_on_off.curValue = "off";
                 function.SetAttrState(FunctionAttributeKey.Percent, 0);
@@ -453,17 +448,17 @@
 
             btnCurtainStop.MouseUpEventHandler = (sender, e) =>
             {
-            //if (!function.online)
-            //{
-            //    new Tip()
-            //    {
-            //        CloseTime = 1,
-            //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-            //        Direction = AMPopTipDirection.None,
-            //    }.Show(MainPage.BaseView);
-            //    return;
-            //}
-            onCurtainAnimation = false;
+            if (!function.isOnline())
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
+                onCurtainAnimation = false;
                 new System.Threading.Thread(() =>
                 {
                     System.Threading.Thread.Sleep(2000);
@@ -481,17 +476,17 @@
 
             btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
             {
-            //if (!function.online)
-            //{
-            //    new Tip()
-            //    {
-            //        CloseTime = 1,
-            //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
-            //        Direction = AMPopTipDirection.None,
-            //    }.Show(MainPage.BaseView);
-            //    return;
-            //}
-            new System.Threading.Thread(() =>
+            if (!function.isOnline())
+                {
+                    new Tip()
+                    {
+                        CloseTime = 1,
+                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
+                        Direction = AMPopTipDirection.None,
+                    }.Show(MainPage.BaseView);
+                    return;
+                }
+                new System.Threading.Thread(() =>
             {
                 System.Threading.Thread.Sleep(2000);
                 Application.RunOnMainThread(() =>
@@ -508,7 +503,7 @@
                 CurtainAnimation(100);
             };
 
-            //if (function.online)
+            if (function.isOnline())
             {
                 btnCurtainStop.MouseDownEventHandler = (sender, e) =>
                 {

--
Gitblit v1.8.0