HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-09-30 404cdc88627f942df7944af04ee05b9d527752d6
ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
old mode 100644 new mode 100755
@@ -11,13 +11,13 @@
    public class DeviceTarget : FrameLayout
    {
        public DeviceTarget()
        public DeviceTarget ()
        {
            Tag = "Logic";
        }
        public void Show()
        public void Show ()
        {
            this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor;
            var topFrameLayout = new FrameLayout
@@ -28,65 +28,60 @@
            AddChidren(topFrameLayout);
            var titleName = new Button
            {
            var titleName = new Button {
                //Text = "添加执行目标",
                TextID = MyInternationalizationString.addImplementationgoals,
                //TextID = MyInternationalizationString.addImplementationgoals,
                TextSize = 17,
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
            };
            topFrameLayout.AddChidren(titleName);
            topFrameLayout.AddChidren (titleName);
            var back = new Button
            {
                Width = Application.GetRealWidth(110),
                Height = Application.GetRealHeight(110),
                X = Application.GetRealWidth(20),
            var back = new Button {
                Width = Application.GetRealWidth (110),
                Height = Application.GetRealHeight (110),
                X = Application.GetRealWidth (20),
                Gravity = Gravity.CenterVertical,
                UnSelectedImagePath = "ZigeeLogic/Back.png",
            };
            topFrameLayout.AddChidren(back);
            topFrameLayout.AddChidren (back);
            back.MouseDownEventHandler += (sender, e) => {
                RemoveFromParent();
                RemoveFromParent ();
            };
            var middle = new VerticalScrolViewLayout();
            var middle = new VerticalScrolViewLayout ();
            middle.Y = topFrameLayout.Bottom;
            middle.Height = Application.GetRealHeight(1920 - 220);
            middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
            this.AddChidren(middle);
            #region ----- 设备------
            var deviceRowLayout = new RowLayout
            {
                Height = Application.GetRealHeight(180),
                //BackgroundColor = 0xff323232,
            };
            middle.AddChidren(deviceRowLayout);
            middle.AddChidren (deviceRowLayout);
            var device = new Button
            {
                Width = Application.GetRealWidth(400),
            var device = new Button {
                Width = Application.GetRealWidth (400),
                TextID = MyInternationalizationString.device,
                //Text = "设备",
                TextSize = 16,
                TextAlignment = TextAlignment.CenterLeft,
                X = Application.GetRealWidth(40),
                X = Application.GetRealWidth (40),
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
            };
            deviceRowLayout.AddChidren(device);
            deviceRowLayout.AddChidren (device);
            var btndeviceback = new Button
            {
                Width = Application.GetRealWidth(110),
                Height = Application.GetRealHeight(110),
            var btndeviceback = new Button {
                Width = Application.GetRealWidth (110),
                Height = Application.GetRealHeight (110),
                UnSelectedImagePath = "ZigeeLogic/next.png",
                SelectedImagePath = "ZigeeLogic/NextSelecte.png",
                X = Application.GetRealWidth(1080 - 140),//550
                X = Application.GetRealWidth (1080-140),//550
                Gravity = Gravity.CenterVertical,
            };
            deviceRowLayout.AddChidren(btndeviceback);
            deviceRowLayout.AddChidren (btndeviceback);
            EventHandler<MouseEventArgs> deviceclick = (sender, e) => {
                Common.Logic.LogicDviceList.Clear();
@@ -100,116 +95,64 @@
                logicDevicePage.Show();
            };
            deviceRowLayout.MouseUpEventHandler += deviceclick;
            device.MouseUpEventHandler += deviceclick;
            btndeviceback.MouseUpEventHandler += deviceclick;
            #endregion
             deviceRowLayout.MouseUpEventHandler += deviceclick;
             device.MouseUpEventHandler += deviceclick;
             btndeviceback.MouseUpEventHandler += deviceclick;
            #region ----- 场景------
            var sceneRowLayout = new RowLayout
            {
                Height = Application.GetRealHeight(180),
            var sceneRowLayout = new RowLayout {
                Height = Application.GetRealHeight (180),
                //BackgroundColor = 0xff323232,
                Y = deviceRowLayout.Bottom,
                Y=deviceRowLayout.Bottom,
            };
            middle.AddChidren(sceneRowLayout);
            middle.AddChidren (sceneRowLayout);
            var scene = new Button
            {
                Width = Application.GetRealWidth(400),
            var scene = new Button {
                Width = Application.GetRealWidth (400),
                TextID = MyInternationalizationString.scene,
                //Text = "场景",
                TextSize = 16,
                TextAlignment = TextAlignment.CenterLeft,
                X = Application.GetRealWidth(40),
                X = Application.GetRealWidth (40),
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
            };
            sceneRowLayout.AddChidren(scene);
            sceneRowLayout.AddChidren (scene);
            var btnsceneback = new Button
            {
                Width = Application.GetRealWidth(110),
                Height = Application.GetRealHeight(110),
            var btnsceneback = new Button {
                Width = Application.GetRealWidth (110),
                Height = Application.GetRealHeight (110),
                UnSelectedImagePath = "ZigeeLogic/next.png",
                SelectedImagePath = "ZigeeLogic/NextSelecte.png",
                X = Application.GetRealWidth(1080 - 140),//550
                X = Application.GetRealWidth (1080-140),//550
                Gravity = Gravity.CenterVertical,
            };
            sceneRowLayout.AddChidren(btnsceneback);
            sceneRowLayout.AddChidren (btnsceneback);
            EventHandler<MouseEventArgs> sceneclick = (sender, e) => {
                CommonPage.Loading.Start();
                System.Threading.Tasks.Task.Run(() => {
                    Application.RunOnMainThread(() => {
                        CommonPage.Loading.Hide();
                        var addScenePage = new AddScenePage();
                        UserView.HomePage.Instance.AddChidren(addScenePage);
                CommonPage.Loading.Start ();
                System.Threading.Tasks.Task.Run (() => {
                    Application.RunOnMainThread (() => {
                        CommonPage.Loading.Hide ();
                        var addScenePage = new AddScenePage ();
                        UserView.HomePage.Instance.AddChidren (addScenePage);
                        UserView.HomePage.Instance.PageIndex += 1;
                        addScenePage.Show();
                        addScenePage.Show ();
                    });
                });
            };
            sceneRowLayout.MouseUpEventHandler += sceneclick;
            scene.MouseUpEventHandler += sceneclick;
            btnsceneback.MouseUpEventHandler += sceneclick;
            #endregion
             sceneRowLayout.MouseUpEventHandler += sceneclick;
             scene.MouseUpEventHandler += sceneclick;
             btnsceneback.MouseUpEventHandler += sceneclick;
            #region ----- 安防模式------
            ///安防模式
            var securityRowLayout = new RowLayout
            {
                Height = Application.GetRealHeight(180),
                //BackgroundColor = 0xff323232,
                Y = sceneRowLayout.Bottom,
            };
            middle.AddChidren(securityRowLayout);
            var security = new Button
            {
                Width = Application.GetRealWidth(400),
                TextID = MyInternationalizationString.securitymode,
                //Text = "安防模式",
                TextSize = 16,
                TextAlignment = TextAlignment.CenterLeft,
                X = Application.GetRealWidth(40),
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
            };
            securityRowLayout.AddChidren(security);
            var btnsecurityback = new Button
            {
                Width = Application.GetRealWidth(110),
                Height = Application.GetRealHeight(110),
                UnSelectedImagePath = "ZigeeLogic/next.png",
                SelectedImagePath = "ZigeeLogic/NextSelecte.png",
                X = Application.GetRealWidth(1080 - 140),//550
                Gravity = Gravity.CenterVertical,
            };
            securityRowLayout.AddChidren(btnsecurityback);
            EventHandler<MouseEventArgs> securityclick = (sender, e) => {
                var securityMode = new SecurityMode();
                UserView.HomePage.Instance.AddChidren(securityMode);
                UserView.HomePage.Instance.PageIndex += 1;
                securityMode.Show();
            };
            securityRowLayout.MouseUpEventHandler += securityclick;
            security.MouseUpEventHandler += securityclick;
            btnsecurityback.MouseUpEventHandler += securityclick;
            #endregion
            #region ----- 已有自动化------
            ///已有自动化
            var existenceRowLayout = new RowLayout
            {
                Height = Application.GetRealHeight(180),
                //BackgroundColor = 0xff323232,
                Y = securityRowLayout.Bottom,
                Y = sceneRowLayout.Bottom,
            };
            //middle.AddChidren(existenceRowLayout);
            middle.AddChidren(existenceRowLayout);
            var existence = new Button
            {
@@ -244,16 +187,59 @@
            existenceRowLayout.MouseUpEventHandler += existenceclick;
            existence.MouseUpEventHandler += existenceclick;
            btnexistenceback.MouseUpEventHandler += existenceclick;
            #endregion
            #region ----- 延时------
            ///安防模式
            var securityRowLayout = new RowLayout
            {
                Height = Application.GetRealHeight(180),
                //BackgroundColor = 0xff323232,
                Y = existenceRowLayout.Bottom,
            };
            middle.AddChidren(securityRowLayout);
            var security = new Button
            {
                Width = Application.GetRealWidth(400),
                TextID = MyInternationalizationString.securitymode,
                //Text = "安防模式",
                TextSize = 16,
                TextAlignment = TextAlignment.CenterLeft,
                X = Application.GetRealWidth(40),
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
            };
            securityRowLayout.AddChidren(security);
            var btnsecurityback = new Button
            {
                Width = Application.GetRealWidth(110),
                Height = Application.GetRealHeight(110),
                UnSelectedImagePath = "ZigeeLogic/next.png",
                SelectedImagePath = "ZigeeLogic/NextSelecte.png",
                X = Application.GetRealWidth(1080 - 140),//550
                Gravity = Gravity.CenterVertical,
            };
            securityRowLayout.AddChidren(btnsecurityback);
            EventHandler<MouseEventArgs>securityclick = (sender, e) => {
                var securityMode = new SecurityMode();
                UserView.HomePage.Instance.AddChidren(securityMode);
                UserView.HomePage.Instance.PageIndex += 1;
                securityMode.Show();
            };
            securityRowLayout.MouseUpEventHandler += securityclick;
            security.MouseUpEventHandler += securityclick;
            btnsecurityback.MouseUpEventHandler += securityclick;
            var delayedRowLayout = new RowLayout
            {
                Height = Application.GetRealHeight(180),
                //BackgroundColor = 0xff323232,
                Y = securityRowLayout.Bottom,
                Y=securityRowLayout.Bottom,
            };
            //middle.AddChidren(delayedRowLayout);
           middle.AddChidren(delayedRowLayout);
            var delayed = new Button
            {
@@ -290,10 +276,10 @@
            delayedRowLayout.MouseUpEventHandler += delayedclick;
            delayed.MouseUpEventHandler += delayedclick;
            btndelayedback.MouseUpEventHandler += delayedclick;
            #endregion
        }
        public static void DelayTimeView(Dictionary<string, object> delayactionsInfo = null)
        public static  void DelayTimeView(Dictionary<string, object> delayactionsInfo=null)
        {
            var listValues = new List<string>();
            for (int i = 0; i < 60; i++)