wei
2021-10-28 270b3d8539f6b4a991a9ebf3b3a9eceb436d61d5
HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs
@@ -405,6 +405,7 @@
                {
                    lightingView.SetViewStatus(lightTemp.state == "on");
                }
                //MainPage.Log($"时间戳:{device.time_stamp}  时间:{device.GeteTime()} 烘干:{hotDryTemp.state} 风干:{windDryTemp.state} 消毒:{disinfectTemp.state} 灯光状态:{lightTemp.state}");
                #endregion
                #region 修改时间
@@ -451,16 +452,15 @@
        public bool Lighting = false;
        public ClothesHangerControl(string iconPath1, string iconPath2, string title, string time)
        public ClothesHangerControl(string unSelectedIconPath, string selectedIconPath, string title, string time)
        {
            btnIcon = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(28),
                Height = Application.GetRealWidth(28),
                UnSelectedImagePath = iconPath1,
                SelectedImagePath = iconPath2,
                UnSelectedImagePath = unSelectedIconPath,
                SelectedImagePath = selectedIconPath,
            };
            this.AddChidren(btnIcon);
@@ -478,7 +478,7 @@
            btnTime = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = btnTitle.Bottom,
                Y = Application.GetRealHeight(74-32),
                Height = Application.GetRealHeight(32),
                Text = time,
                TextColor = 0x00000000,
@@ -494,29 +494,44 @@
        public void ChangeTime(string newTime)
        {
            int.TryParse(newTime, out leftTime);
            leftTime *= 60;
            if (leftTime > 0)
            {
                Application.RunOnMainThread(() =>
                {
                    btnTime.Text = new TimeSpan(0, leftTime, 0).ToString().Remove(5, 3);
                });
                leftTime--;
            }
            else if (leftTime == 0)
            {
                Application.RunOnMainThread(() =>
                {
                    btnTime.Text = "";
                });
            }
            if (countdownThread == null)
            {
                countdownThread = new System.Threading.Thread(() =>
                {
                    while (true)
                    {
                        if (leftTime > 1)
                        if (leftTime > 0)
                        {
                            Application.RunOnMainThread(() =>
                            {
                                btnTime.Text = new TimeSpan(0, 0, leftTime).ToString();
                                btnTime.Text = new TimeSpan(0, leftTime, 0).ToString().Remove(5,3) ;
                            });
                            System.Threading.Thread.Sleep(1000);
                            leftTime--;
                        }
                        else
                        else if(leftTime == 0)
                        {
                            Application.RunOnMainThread(() =>
                            {
                                btnTime.Text = "";
                            });
                        }
                        System.Threading.Thread.Sleep(60000);
                    }
                })
                { IsBackground = true };