From 528c105b3aea0e6e00477365f16f57c1e3d7eb1c Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期四, 24 十月 2019 15:31:28 +0800
Subject: [PATCH] 2019-10-24-3

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs |  133 ++++++++++++++++++++++----------------------
 1 files changed, 66 insertions(+), 67 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
old mode 100755
new mode 100644
index 9548ee7..b7eea61
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/FunctionSetting.cs
@@ -96,6 +96,12 @@
 
             for (int i = 0; i < 7; i++)
             {
+                var bottomRowLayout = new FrameLayout()
+                {
+                    Height = Application.GetRealHeight(58),
+                };
+                bottomFrameLayout2.AddChidren(bottomRowLayout);
+
                 var btnName = new Button()
                 {
                     Width = Application.GetRealWidth(233),
@@ -105,7 +111,7 @@
                     TextAlignment = TextAlignment.CenterLeft,
                     TextSize = 12,
                 };
-                bottomFrameLayout2.AddChidren(btnName);
+                bottomRowLayout.AddChidren(btnName);
 
                 var btnNextFrameLayout = new FrameLayout()
                 {
@@ -113,12 +119,12 @@
                     Height = Application.GetRealHeight(58),
                     X = Application.GetRealWidth(861 + 58),
                 };
-                bottomFrameLayout2.AddChidren(btnNextFrameLayout);
+                bottomRowLayout.AddChidren(btnNextFrameLayout);
 
                 var btnNext = new Button()
                 {
-                    Width = Application.GetRealWidth(60),
-                    Height = Application.GetRealHeight(60),
+                    Width = Application.GetRealWidth(58),
+                    Height = Application.GetRealHeight(58),
                 };
                 btnNextFrameLayout.AddChidren(btnNext);
 
@@ -134,25 +140,20 @@
 
                 if (i == 0)
                 {
-                    btnName.Y = Application.GetRealHeight(204);
-                    btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceName) + ":";
-
+                    bottomRowLayout.Y = Application.GetRealHeight(204);
+                    btnName.Text = Language.StringByID(R.MyInternationalizationString.DeviceRemarkXm) + ":";
                     btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58);
-                    btnNextFrameLayout.Y = btnName.Y;
                     btnNextFrameLayout.X = btnName.Right;
-
                     btnNext.TextAlignment = TextAlignment.CenterLeft;
                     btnNext.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
-                    btnNext.Text = "鏅鸿兘闂ㄩ攣";
-
+                    btnNext.Text = doorLock.DeviceName;
                     btnLine.Visible = true;
                     btnLine.Y = Application.GetRealHeight(308);
                 }
                 else if (i == 1)
                 {
-                    btnName.Y = Application.GetRealHeight(343);
+                    bottomRowLayout.Y = Application.GetRealHeight(343);
                     btnName.Text = Language.StringByID(R.MyInternationalizationString.BelongZone) + ":";
-
                     var btnArea = new Button()
                     {
                         Width = Application.GetRealWidth(789 - 109 - 58),
@@ -163,25 +164,16 @@
                         Text = "涓�妤硷紝瀹㈠巺",
                         TextAlignment = TextAlignment.CenterLeft,
                     };
-                    bottomFrameLayout2.AddChidren(btnArea);
-
-                    btnNextFrameLayout.Y = btnName.Y;
+                    bottomRowLayout.AddChidren(btnArea);
                     btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
-
                     btnLine.Visible = true;
                     btnLine.Y = Application.GetRealHeight(446);
-
-                    btnNext.MouseDownEventHandler += (sender, e) =>
-                    {
-
-                    };
                 }
                 else if (i == 2)
                 {
-                    btnName.Y = Application.GetRealHeight(481);
+                    bottomRowLayout.Y = Application.GetRealHeight(481);
                     btnName.Text = Language.StringByID(R.MyInternationalizationString.BelongModel) + ":";
                     btnNextFrameLayout.Width = btnNext.Width = Application.GetRealWidth(789 - 58);
-                    btnNextFrameLayout.Y = btnName.Y;
                     btnNextFrameLayout.X = btnName.Right;
 
                     btnNext.TextAlignment = TextAlignment.CenterLeft;
@@ -194,10 +186,9 @@
                 }
                 else if (i == 3)
                 {
-                    btnName.Y = Application.GetRealHeight(585 + 35);
+                    bottomRowLayout.Y = Application.GetRealHeight(585 + 35);
                     btnName.Text = Language.StringByID(R.MyInternationalizationString.TemporaryPassword);
 
-                    btnNextFrameLayout.Y = btnName.Y;
                     btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
 
                     btnLine.Visible = true;
@@ -205,18 +196,14 @@
                 }
                 else if (i == 4)
                 {
-                    btnName.Y = Application.GetRealHeight(723 + 35);
+                    bottomRowLayout.Y = Application.GetRealHeight(723 + 35);
                     btnName.Text = Language.StringByID(R.MyInternationalizationString.RemotelyUnlock);
-
-                    btnNextFrameLayout.Y = btnName.Y;
                     btnNext.Width = Application.GetRealWidth(104);
                     btnNext.Height = Application.GetRealHeight(63);
                     btnNext.UnSelectedImagePath = "DoorLock/Switch.png";
                     btnNext.SelectedImagePath = "DoorLock/SwitchOn.png";
-
                     btnLine.Visible = true;
                     btnLine.Y = Application.GetRealHeight(723 + 127);
-
                     if (ZigBee.Device.DoorLock.RemoteUnlockPassword == "")
                     {
                         btnNext.IsSelected = false;
@@ -225,8 +212,38 @@
                     {
                         btnNext.IsSelected = true;
                     }
-
-                    EventHandler<MouseEventArgs> eHandlerRemotelyUnlock = (sender, e) =>
+                }
+                else if (i == 5)
+                {
+                    bottomRowLayout.Y = Application.GetRealHeight(861 + 35);
+                    btnName.Text = Language.StringByID(R.MyInternationalizationString.DoorLockTime);
+                    btnNextFrameLayout.Y = btnName.Y;
+                    btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
+                    btnLine.Visible = true;
+                    btnLine.Y = Application.GetRealHeight(861 + 127);
+                }
+                else if (i == 6)
+                {
+                    bottomRowLayout.Y = Application.GetRealHeight(999 + 35);
+                    btnName.Text = Language.StringByID(R.MyInternationalizationString.Shared);
+                    btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
+                    btnLine.Visible = true;
+                    btnLine.Y = Application.GetRealHeight(999 + 127);
+                }
+                int currentIndex = i;
+                EventHandler<MouseEventArgs> eHandler = (sender, e) =>
+                {
+                    if (currentIndex == 1)
+                    {
+                    }
+                    else if (currentIndex == 3)
+                    {
+                        var temporaryPassword = new Shared.Phone.UserCenter.DoorLock.TemporaryPassword(doorLock);
+                        Shared.Phone.UserView.HomePage.Instance.AddChidren(temporaryPassword);
+                        Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+                        temporaryPassword.Show();
+                    }
+                    else if (currentIndex == 4)
                     {
                         btnNext.IsSelected = !btnNext.IsSelected;
                         if (btnNext.IsSelected)
@@ -236,44 +253,26 @@
                                 RemotePasswordDialog(doorLock, btnNext);
                             }
                         }
-                        return;
-                    };
-                    btnNext.MouseDownEventHandler += eHandlerRemotelyUnlock;
-                    btnName.MouseDownEventHandler += eHandlerRemotelyUnlock;
-                    btnNextFrameLayout.MouseDownEventHandler += eHandlerRemotelyUnlock;
-                }
-                else if (i == 5)
-                {
-                    btnName.Y = Application.GetRealHeight(861 + 35);
-                    btnName.Text = Language.StringByID(R.MyInternationalizationString.DoorLockTime);
-
-                    btnNextFrameLayout.Y = btnName.Y;
-                    btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
-
-                    btnLine.Visible = true;
-                    btnLine.Y = Application.GetRealHeight(861 + 127);
-                    EventHandler<MouseEventArgs> eHandlerDoorLockTime = (sender, e) =>
+                        else
+                        {
+                            ZigBee.Device.DoorLock.RemoteUnlockPassword = "";
+                        }
+                    }
+                    else if (currentIndex == 5)
                     {
-                        var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "InValidTime");
+                        var tempPage = new Shared.Phone.UserCenter.DoorLock.TimeSettignPage(doorLock, "DoorLockTime");
                         Shared.Phone.UserView.HomePage.Instance.AddChidren(tempPage);
                         Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                         tempPage.Show();
-                    };
-                    btnNext.MouseDownEventHandler += eHandlerDoorLockTime;
-                    btnName.MouseDownEventHandler += eHandlerDoorLockTime;
-                    btnNextFrameLayout.MouseDownEventHandler += eHandlerDoorLockTime;
-                }
-                else if (i == 6)
-                {
-                    btnName.Y = Application.GetRealHeight(999 + 35);
-                    btnName.Text = Language.StringByID(R.MyInternationalizationString.Shared);
-
-                    btnNextFrameLayout.Y = btnName.Y;
-                    btnNext.UnSelectedImagePath = "DoorLock/RightIcon.png";
-
-                    btnLine.Visible = true;
-                    btnLine.Y = Application.GetRealHeight(999 + 127);
-                }
+                    }
+                    else if (currentIndex == 6)
+                    {
+                    }
+                };
+                bottomRowLayout.MouseDownEventHandler += eHandler;
+                btnNext.MouseDownEventHandler += eHandler;
+                btnName.MouseDownEventHandler += eHandler;
+                btnNextFrameLayout.MouseDownEventHandler += eHandler;
                 #endregion
             }
         }

--
Gitblit v1.8.0