WJC
2019-11-21 6a518151a9a8efb62c768198aebe4a0ff9ce77f2
ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
old mode 100755 new mode 100644
@@ -32,11 +32,11 @@
            var titleName = new Button
            {
                TextSize = 16,
                TextSize = 17,
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                TextAlignment = TextAlignment.CenterLeft,
                X = Application.GetRealWidth(176),
                Width = Application.GetRealWidth(400),
                Width = Application.GetRealWidth(600),
                Height = Application.GetRealHeight(69),
                Y = Application.GetRealHeight(92),
                TextID = MyInternationalizationString.selection,
@@ -112,6 +112,7 @@
                TextID = MyInternationalizationString.automationname,
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                Y = Application.GetRealHeight(35),
                TextSize = 15,
            };
            logicnamefl.AddChidren(text);
@@ -123,7 +124,7 @@
                X = text.Right,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                TextSize = 13,
                TextSize = 14,
                Text = Common.Logic.CurrentLogic.LogicName,
                //TextID=MyInternationalizationString.automation1,
            };
@@ -166,7 +167,7 @@
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                Width = Application.GetRealWidth(300),
                Height = Application.GetRealHeight(60),
                TextSize = 16,
                TextSize = 15,
                Gravity = Gravity.CenterVertical,
            });
@@ -277,6 +278,7 @@
                        TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
                        TextID = MyInternationalizationString.addconditions,
                        X = Application.GetRealWidth(390),
                        TextSize = 14,
                    };
                    addfl.AddChidren(addtextbtn);
@@ -343,6 +345,7 @@
                                    TextAlignment = TextAlignment.CenterLeft,
                                    Gravity = Gravity.CenterVertical,
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextSize = 14,
                                };
                                conditionsRowLayout.AddChidren(timevalue);
@@ -354,6 +357,7 @@
                                    Gravity = Gravity.CenterVertical,
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    X = conditionsRowLayout.Width - Application.GetRealWidth(400),
                                    TextSize = 14,
                                };
                                conditionsRowLayout.AddChidren(timeTxet);
@@ -454,6 +458,7 @@
                                    Text = conditions["StartHour"] + ":" + s1 + "-" + conditions["StopHour"] + ":" + s2,
                                    //TextColor = 0xff121212,
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextSize = 14,
                                };
                                conditionsRowLayout.AddChidren(timevalue);
                                var timeTxet = new Button
@@ -464,6 +469,7 @@
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    X = conditionsRowLayout.Width - Application.GetRealWidth(400),
                                    TextID = MyInternationalizationString.timeframe,
                                    TextSize = 14,
                                };
                                conditionsRowLayout.AddChidren(timeTxet);
@@ -501,6 +507,7 @@
                                    TextAlignment = TextAlignment.CenterLeft,
                                    Text = deviceinof.DeviceEpointName,
                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                                    TextSize = 14,
                                };
                                conditionsRowLayout.AddChidren(btndevice);
@@ -541,7 +548,7 @@
                                        UserView.HomePage.Instance.AddChidren(memberList);
                                        UserView.HomePage.Instance.PageIndex += 1;
                                        MemberList.edit = true;
                                        memberList.Show(deviceinof);
                                        memberList.Show(deviceinof, conditions);
                                    }
                                };
@@ -555,6 +562,7 @@
                                    TextAlignment = TextAlignment.CenterRight,
                                    X = Application.GetRealWidth(400),
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextSize = 14,
                                };
                                conditionsRowLayout.AddChidren(devicestatus);
@@ -718,13 +726,14 @@
                                        break;
                                    case DeviceType.DoorLock:
                                        {
                                            conditionIcon.UnSelectedImagePath = "ZigeeLogic/doorlock.png";
                                            for (int a = 0; a < Common.Logic.CurrentLogic.Accounts.Count; a++)
                                            {
                                                if (Common.Logic.CurrentLogic.Accounts[a]["Type"] == "1")
                                                {
                                                    if (Common.Logic.CurrentLogic.Accounts[a]["UserId"] == conditions["AttriButeData2"])
                                                    {
                                                        devicestatus.Text = conditions["Account"];
                                                        devicestatus.Text = Common.Logic.CurrentLogic.Accounts[a]["Account"];
                                                        break;
                                                    }
@@ -772,6 +781,7 @@
                                    Gravity = Gravity.CenterVertical,
                                    Text = logicinof.LogicName,
                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                                    TextSize = 14,
                                    //TextColor = 0xff121212,
                                };
                                conditionsRowLayout.AddChidren(btnlogic);
@@ -802,6 +812,7 @@
                                    TextAlignment = TextAlignment.CenterRight,
                                    X = Application.GetRealWidth(500),
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextSize = 14,
                                };
                                conditionsRowLayout.AddChidren(logicstatus);
@@ -826,6 +837,7 @@
                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                                    //TextColor = 0xff121212,
                                    TextID = MyInternationalizationString.security,
                                    TextSize = 14,
                                };
                                //conditionsRowLayout.AddChidren(btnsecurity);
@@ -858,6 +870,7 @@
                                    Gravity = Gravity.CenterVertical,
                                    TextAlignment = TextAlignment.CenterLeft,
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextSize = 14,
                                };
                                conditionsRowLayout.AddChidren(securitystatus);
@@ -885,15 +898,16 @@
                            break;
                        case 7:
                            {
                                conditionIcon.UnSelectedImagePath = "ZigeeLogic/position.png";
                                var btnlocation = new Button
                                {
                                    Width = Application.GetRealWidth(700),
                                    TextAlignment = TextAlignment.CenterLeft,
                                    Gravity = Gravity.CenterVertical,
                                    //Text = "地理位置",
                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                                    //TextColor = 0xff121212,
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextID = MyInternationalizationString.geographicalposition,
                                    TextSize = 14,
                                };
                                conditionsRowLayout.AddChidren(btnlocation);
@@ -921,6 +935,7 @@
                                    TextAlignment = TextAlignment.CenterRight,
                                    X = Application.GetRealWidth(500),
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextSize = 14,
                                };
                                conditionsRowLayout.AddChidren(locationstatus);
                                foreach (var radius in Common.Logic.CurrentLogic.Accounts)
@@ -1004,7 +1019,7 @@
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                Width = Application.GetRealWidth(300),
                Height = Application.GetRealHeight(60),
                TextSize = 16,
                TextSize = 15,
                Gravity = Gravity.CenterVertical,
            };
            targetRowLayout.AddChidren(btntargettitle);
@@ -1074,6 +1089,7 @@
                        TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
                        TextID = MyInternationalizationString.addfunction,
                        X = Application.GetRealWidth(390),
                        TextSize = 14,
                    };
                    addfl.AddChidren(addtextbtn);
                    EventHandler<MouseEventArgs> addfunctionclick = (sender, e) =>
@@ -1144,6 +1160,7 @@
                                    TextAlignment = TextAlignment.CenterLeft,
                                    Text = deviceinof.DeviceEpointName,
                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                                    TextSize = 14,
                                };
                                actionsrowLayout.AddChidren(btndevicename);
@@ -1169,6 +1186,7 @@
                                    TextAlignment = TextAlignment.CenterRight,
                                    X = Application.GetRealWidth(450),
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextSize = 14,
                                };
                                actionsrowLayout.AddChidren(devicestatus);
@@ -1184,13 +1202,6 @@
                                ///编辑点击事件
                                deviceedit.MouseUpEventHandler += (sender, e) =>
                                {
                                    //var deviceStatePage = new DeviceStatePage();
                                    //UserView.HomePage.Instance.AddChidren(deviceStatePage);
                                    //UserView.HomePage.Instance.PageIndex += 1;
                                    //deviceStatePage.IsDeviceEditor = true;
                                    //deviceStatePage.Show(deviceinof);
                                    //ActionModifyDeviceStateView(deviceinof);
                                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
                                    this.AddChidren(flMain);
                                    LogicDevicePage.CurrentDeviceStateView(flMain, deviceinof, true);
@@ -1465,6 +1476,7 @@
                                    TextAlignment = TextAlignment.CenterLeft,
                                    Text = sceneinof.Name,
                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                                    TextSize = 14,
                                };
                                actionsrowLayout.AddChidren(btndevicename);
@@ -1503,6 +1515,7 @@
                                    Gravity = Gravity.CenterVertical,
                                    Text = logicinof.LogicName,
                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                                    TextSize = 14,
                                    //TextColor = 0xff121212,
                                };
                                actionsrowLayout.AddChidren(btnlogic);
@@ -1534,6 +1547,7 @@
                                    X = Application.GetRealWidth(1080 - 330),
                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                                    TextAlignment = TextAlignment.CenterRight,
                                    TextSize = 14,
                                };
                                actionsrowLayout.AddChidren(logicstatus);
@@ -1557,6 +1571,7 @@
                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                                    //TextColor = 0xff121212,
                                    TextID = MyInternationalizationString.security,
                                    TextSize = 14,
                                };
                                //actionsrowLayout.AddChidren(btnsecurity);
@@ -1585,6 +1600,7 @@
                                    Gravity = Gravity.CenterVertical,
                                    TextAlignment = TextAlignment.CenterLeft,
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextSize = 14,
                                };
                                actionsrowLayout.AddChidren(securitystatus);
@@ -1632,6 +1648,7 @@
                                    Width = Application.GetRealWidth(500),
                                    TextAlignment = TextAlignment.CenterLeft,
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextSize = 14,
                                };
                                actionsrowLayout.AddChidren(delaytimeBtn);
                                if (Minutes != 0)
@@ -1739,6 +1756,7 @@
                Width = Application.GetRealWidth(300),
                Height = Application.GetRealHeight(60),
                Gravity = Gravity.CenterVertical,
                TextSize = 14,
            };
            weekRowLayout.AddChidren(settxet);
            var btnweektext = new Button
@@ -1751,6 +1769,7 @@
                TextID = MyInternationalizationString.everyday,
                Y = Application.GetRealHeight(35),
                X = settxet.Right,
                TextSize = 14,
            };
            weekRowLayout.AddChidren(btnweektext);
@@ -1811,6 +1830,7 @@
                Height = Application.GetRealHeight(60),
                Gravity = Gravity.CenterVertical,
                TextID = MyInternationalizationString.pushswitch,
                TextSize = 14,
            };
            pushswitchRowlayout.AddChidren(btnswitchtxet);
@@ -1863,6 +1883,7 @@
                Width = Application.GetRealWidth(300),
                Height = Application.GetRealHeight(60),
                Gravity = Gravity.CenterVertical,
                TextSize = 14,
            };
            custompushRowLayout.AddChidren(btncustompush);
@@ -1908,15 +1929,12 @@
                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
                TextID = MyInternationalizationString.Save,
                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
                TextSize=16,
            };
            saveFrameLayout.AddChidren(btnsave);
            btnsave.MouseUpEventHandler += async (sender, e) =>
            {
                var name = logicTextBox.Text.Trim();
                //if (Common.Logic.CurrentLogic.Conditions.Count != 0 && Common.Logic.CurrentLogic.Actions.Count != 0)
                //{
                //    AddChidren(btnsave);
                //}
                if (string.IsNullOrEmpty(logicTextBox.Text.Trim()))
                {
                    new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), Language.StringByID(MyInternationalizationString.Close)).Show();
@@ -1952,11 +1970,7 @@
                CommonPage.Loading.Hide();
                UserView.HomePage.Instance.RemoveViewByTag("Logic");
                Category.Category.instance?.RefreshBodyView();
                //UserView.HomePage.Instance.RemoveAt("Logic1");
                //Category.Category category = new Category.Category();
                //UserView.HomePage.Instance.AddChidren(category);
                //UserView.HomePage.Instance.PageIndex += 1;
                //category.Show(2);
            };
@@ -2265,6 +2279,7 @@
                Width = Application.GetRealWidth(200),
                X = Application.GetRealWidth(80),
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = 14,
            };
            timetype.AddChidren(Btncancel);
            Btncancel.MouseUpEventHandler += (sender16, e16) =>
@@ -2292,6 +2307,7 @@
                Width = Application.GetRealWidth(200),
                TextAlignment = TextAlignment.CenterRight,
                X = Btntitle.Right + Application.GetRealWidth(100),
                TextSize = 14,
            };
            timetype.AddChidren(Btncomplete);
@@ -2327,6 +2343,7 @@
                TextID = MyInternationalizationString.Allconditions,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
                TextSize = 14,
            };
            androw.AddChidren(andbtn);
@@ -2362,6 +2379,7 @@
                TextID = MyInternationalizationString.anycondition,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
                TextSize = 14,
            };
            orrow.AddChidren(orbtn);