陈嘉乐
2020-06-29 9a6f9cfe3ddcf564261ddae823eda21d4539515c
ZigbeeApp/Shared/Phone/Device/Logic/Nightlight.cs
@@ -16,7 +16,7 @@
        string selectedDeviceStatus = "";
        Dictionary<string, object> actionsInfo = null;
        List<Dictionary<string, string>> TaskList = null;
        public void Show(CommonDevice common, bool edit, Dictionary<string, object> editdeviceActionInfo = null)
        public void Show(CommonDevice common, bool edit,string str_if,Dictionary<string, object> editdeviceActionInfo = null)
        {
            actionsInfo = editdeviceActionInfo;
            this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
@@ -40,12 +40,12 @@
            middle.AddChidren(openView.Show());
            openView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
            {
                CurrentDeviceView("夜灯开关", common, edit,openView.seletecdTextBtn);
                CurrentDeviceView("夜灯开关", common, edit, openView.seletecdTextBtn);
            };
            LogicView.LightView brightnessView = new LogicView.LightView();
            brightnessView.frameLayout.Y = openView.frameLayout.Bottom;
            brightnessView.titleBtn.Text = Language.StringByID(MyInternationalizationString.brightness);
            brightnessView.titleBtn.Text = Language.StringByID(MyInternationalizationString.brightness);
            middle.AddChidren(brightnessView.Show());
            brightnessView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
            {
@@ -54,7 +54,7 @@
            LogicView.LightView colorTemperatureView = new LogicView.LightView();
            colorTemperatureView.frameLayout.Y = brightnessView.frameLayout.Bottom;
            colorTemperatureView.titleBtn.Text = Language.StringByID(MyInternationalizationString.colorTemperature);
            colorTemperatureView.titleBtn.Text = Language.StringByID(MyInternationalizationString.colorTemperature);
            middle.AddChidren(colorTemperatureView.Show());
            colorTemperatureView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
            {
@@ -91,10 +91,22 @@
                    }
                }
                var logicCommunalPage = new LogicCommunalPage();
                UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                UserView.HomePage.Instance.PageIndex += 1;
                logicCommunalPage.Show(() => { });
                if (str_if == "logic")
                {
                    var logicCommunalPage = new LogicCommunalPage();
                    UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                    UserView.HomePage.Instance.PageIndex += 1;
                    logicCommunalPage.Show(() => { });
                }
                else if (str_if == "lockaction")
                {
                    //门锁联动事件
                    var lockLogicCommunalPage = new DoorLockLogic.LockLogicCommunalPage();
                    UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
                    UserView.HomePage.Instance.PageIndex += 1;
                    lockLogicCommunalPage.Show(() => { });
                }
            };
@@ -146,7 +158,7 @@
                                    case "8":
                                        {
                                            var intvalue = int.Parse(tasks["Data1"]);
                                            var lightbrightnessvalue = intvalue / 100;
                                            var lightbrightnessvalue = 1000000 / (intvalue * 100);
                                            colorTemperatureView.seletecdTextBtn.Text = lightbrightnessvalue.ToString() + "K";
                                        }
                                        break;
@@ -158,7 +170,7 @@
                }
            }
        }
        public void CurrentDeviceView(string if_str, CommonDevice common, bool edit,Button button)
        public void CurrentDeviceView(string if_str, CommonDevice common, bool edit, Button button)
        {
            var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
            this.AddChidren(flMain);
@@ -189,7 +201,7 @@
            {
                case "夜灯开关":
                    {
                        Dictionary<string, string> switchDictionary = new Dictionary<string, string>();
                        Send.dictionary(switchDictionary, "TaskType", "1");
                        Send.dictionary(switchDictionary, "Data2", "0");
@@ -228,7 +240,7 @@
                            status = Language.StringByID(MyInternationalizationString.close);
                        };
                        if ( TaskList != null&& TaskList.Count!=0)
                        if (TaskList != null && TaskList.Count != 0)
                        {
                            foreach (var value in TaskList)
                            {
@@ -330,13 +342,13 @@
                            SeekBarViewHeight = Application.GetRealHeight(12),//进度条的高度10
                            MinValue = 30,
                            MaxValue = 60,
                            ProgressBarUnitSring="K",//切换单位
                            ProgressBarUnitSring = "K",//切换单位
                        };
                        completeView.Show(2).AddChidren(horizontalSeekBarVol);
                        EventHandler<int> progressclick = (sender, e) =>
                        {
                            selectedDeviceStatus = "8";
                            var lightbrightnessvalue = (100 * horizontalSeekBarVol.Progress);
                            var lightbrightnessvalue = 1000000 / (100 * horizontalSeekBarVol.Progress);
                            Send.dictionary(brightnessDictionary, "Data1", lightbrightnessvalue.ToString());
                            DicValue("8", brightnessDictionary);
                            status = horizontalSeekBarVol.Progress.ToString() + "K";
@@ -352,7 +364,7 @@
                                if (value["TaskType"] == "8")
                                {
                                    var intvalue = int.Parse(value["Data1"]);
                                    var lightbrightnessvalue = intvalue / 100;
                                    var lightbrightnessvalue = 1000000 / (intvalue * 100);
                                    horizontalSeekBarVol.Progress = lightbrightnessvalue;
                                    break;
                                }
@@ -366,7 +378,7 @@
                        Dictionary<string, string> switchDictionary = new Dictionary<string, string>();
                        Send.dictionary(switchDictionary, "TaskType", "7");
                        Send.dictionary(switchDictionary, "Data2", "0");
                        mFunView openView = new mFunView();
                        openView.frameLayout.Y = Application.GetRealHeight(140 + 20);