wxr
2024-09-24 691dbe24f5724f153e07947c7b75bdfea5f0b6d5
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) =>
                {