HDL Home App 第二版本 旧平台金堂用 正在使用
hxb
2022-08-30 25429f085093d89d543a0b90e30d0d62d1b7dac9
ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDeviceChange.cs
@@ -30,7 +30,12 @@
        /// </summary>
        private FrameLayout TipLayout = null;
        private List<string> TabList = new List<string>() { Language.StringByID(R.MyInternationalizationString.uLight), Language.StringByID(R.MyInternationalizationString.uDeviceBelongId100) };
        private List<string> TabList = new List<string>()
        {
            Language.StringByID(R.MyInternationalizationString.uLight),
            Language.StringByID(R.MyInternationalizationString.uDeviceBelongId100),
            Language.StringByID(R.MyInternationalizationString.AC)
        };
        private int CurrentSelectIndex = 0;
        private int imageWith = 683;
@@ -174,6 +179,7 @@
                    Button button = new Button();
                    tab_layout.AddChidren(button);
                    button.Width = Application.GetRealWidth(250);
                    button.Height= Application.GetRealWidth(250);
                    button.Text = TabList[i];
                    button.X = ControlCommonResourse.XXLeft / 2 + i * button.Width;
                    button.AddTag("Index", i);
@@ -251,6 +257,23 @@
                            }
                        }
                        break;
                    case 2: // 空调
                        {
                            int n = 0;
                            for (int i = 0; i < CurrentRoom.DeviceList.Count; i++)
                            {
                                SmartSound.Device device = CurrentRoom.DeviceList[i];
                                //
                                if (device.DeviceType == 7)
                                {
                                    var deviceRowLayout = new DeviceRowLayout(this, device, n);
                                    DeviceListView.AddChidren(deviceRowLayout);
                                    deviceRowLayout.InitControl();
                                    n++;
                                }
                            }
                        }
                        break;
                }
                if (DeviceListView.ChildrenCount > 5)
@@ -285,9 +308,9 @@
            //生成一个弹窗画面
            var dialogForm = new DialogInputControl();
            //编辑住宅
            dialogForm.SetTitleText("自定义唤醒词");
            dialogForm.SetTitleText("自定义昵称");
            //请输入住宅名称
            dialogForm.SetTipText("请输入唤醒词");
            dialogForm.SetTipText("请输入昵称");
            dialogForm.Text = scene.NicksName;
            //按下确认按钮
@@ -316,9 +339,9 @@
            //生成一个弹窗画面
            var dialogForm = new DialogInputControl();
            //编辑住宅
            dialogForm.SetTitleText("自定义唤醒词");
            dialogForm.SetTitleText("自定义昵称");
            //请输入住宅名称
            dialogForm.SetTipText("请输入唤醒词");
            dialogForm.SetTipText("请输入昵称");
            dialogForm.Text = device.NicksName;
            //按下确认按钮
@@ -344,20 +367,22 @@
        /// </summary>
        private void ShowSceneDelectDialog(SmartSound.Scene scene)
        {
            this.ShowMassage(ShowMsgType.Confirm, "确认删除该控制内容?", async () =>
            {
                try
            this.ShowMassage(ShowMsgType.Confirm, "确认删除该控制内容?", () =>
           {
               HdlThreadLogic.Current.RunThread(async () =>
                {
                    this.ShowProgressBar();
                    CurrentRoom.SceneList.Remove(scene);
                    LoadSceneView();
                    string json = await postBatchEdit();
                }
                catch (Exception e)
                {
                    string sss = e.Message;
                }
            }, Language.StringByID(R.MyInternationalizationString.OkMsg));
                    HdlThreadLogic.Current.RunMainInThread(() =>
                    {
                        LoadSceneView();
                        this.CloseProgressBar();
                    });
                });
           }, Language.StringByID(R.MyInternationalizationString.OkMsg));
        }
        /// <summary>
@@ -365,20 +390,21 @@
        /// </summary>
        private void ShowDeviceDelectDialog(SmartSound.Device device)
        {
            this.ShowMassage(ShowMsgType.Confirm, "确认删除该控制内容?", async () =>
            this.ShowMassage(ShowMsgType.Confirm, "确认删除该控制内容?",  () =>
             {
                 try
                 {
                    //DeviceListView.RemoveAt(index);
                    CurrentRoom.DeviceList.Remove(device);
                     RefreshFunctionListView();
                     string json = await postBatchEdit();
                 }
                 catch (Exception e)
                 HdlThreadLogic.Current.RunThread(async () =>
                 {
                     string sss = e.Message;
                 }
                     this.ShowProgressBar();
                     CurrentRoom.DeviceList.Remove(device);
                     string json = await postBatchEdit();
                     HdlThreadLogic.Current.RunMainInThread(() =>
                     {
                         RefreshFunctionListView();
                         this.CloseProgressBar();
                     });
                 });
             }, Language.StringByID(R.MyInternationalizationString.OkMsg));
        }
@@ -446,7 +472,7 @@
            // 提交数据至服务器
            string url = "https://developer.hdlcontrol.com/zigbeespeakerservice/BatchEdit";
            string json = Newtonsoft.Json.JsonConvert.SerializeObject(SmartSound.getInstantiate());
            string response_str = await MyHttpWebResponse.PostWebRequest(url, json, Encoding.UTF8);
            string response_str = MyHttpWebResponse.PostWebRequest(url, json, Encoding.UTF8);
            return response_str;
        }
@@ -489,7 +515,7 @@
                btnCaption = frameTable.AddLeftCaption(remark, 2000);
                var nicknameIcon = frameTable.AddRightArrow();//58
                nicknameIcon.TextSize = 17;
                nicknameIcon.TextSize = 14;
                nicknameIcon.SelectedImagePath = "SmartSound/Nickname.png";
                nicknameIcon.UnSelectedImagePath = "SmartSound/Nickname.png";
@@ -555,7 +581,7 @@
                btnCaption = frameTable.AddLeftCaption(remark, 2000);
                var nicknameIcon = frameTable.AddRightArrow();//58
                nicknameIcon.TextSize = 17;
                nicknameIcon.TextSize = 14;
                nicknameIcon.SelectedImagePath = "SmartSound/Nickname.png";
                nicknameIcon.UnSelectedImagePath = "SmartSound/Nickname.png";