From a4924de3136289d10cabbf2f61a228387d44ded7 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 07 十一月 2019 13:48:36 +0800
Subject: [PATCH] Merge branch 'dev-tzy' into DEV_GXC

---
 ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs |  134 +++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 118 insertions(+), 16 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
index a4366b0..2cbca49 100644
--- a/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/CategoryAddScene.cs
@@ -452,27 +452,128 @@
             //閫夋嫨鑳屾櫙鍥�
             EventHandler<MouseEventArgs> backGroundIMGHander = (sender, e) =>
             {
-                if (curRoom == null)
-                {
-                    RoomCommon.ShowTipNoRoom();
-                    return;
-                }
-                if (curRoom.IsSharedRoom)
+                if (curRoom != null && curRoom.IsSharedRoom)
                 {
                     RoomCommon.ShowTipRoomIsShared();
                     return;
                 }
 
-                var localPic = new CategorySceneSelectImgByLocal();
-                Shared.Phone.UserView.HomePage.Instance.AddChidren(localPic);
-                Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
-                localPic.Show();
-                localPic.action = (imgPath) =>
+                int selectRow_Height = 150;
+                int selectRow_Width = 1034;
+                var selectFL = new FrameLayout()
                 {
-                    IconPathType = 0;
-                    backGround.UnSelectedImagePath = imgPath;
+                    BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor
+                };
+                AddChidren(selectFL);
+
+                var itemFL = new FrameLayout()
+                {
+                    Y = Application.GetRealHeight(1276),
+                    Height = Application.GetRealHeight(450),
+                    Width = Application.GetRealWidth(selectRow_Width),
+                    Gravity = Gravity.CenterHorizontal,
+                    Radius = (uint)Application.GetRealHeight(17),
+                    BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor
+                };
+                selectFL.AddChidren(itemFL);
+                itemFL.Animate = Animate.DownToUp;
+
+                var selectLocalPicture = new Button()
+                {
+                    Height = Application.GetRealHeight(selectRow_Height) - 1,
+                    TextID = R.MyInternationalizationString.LocalPicture,
+                    TextColor = ZigbeeColor.Current.GXCTextSelectedColor4
+                };
+                itemFL.AddChidren(selectLocalPicture);
+                var selectLocalLine = new Button()
+                {
+                    Y = selectLocalPicture.Bottom,
+                    Height = 1,
+                    BackgroundColor = ZigbeeColor.Current.GXCLineColor
+                };
+                itemFL.AddChidren(selectLocalLine);
+
+                var selectPhotographBtn = new Button()
+                {
+                    Y = selectLocalLine.Bottom,
+                    Height = Application.GetRealHeight(selectRow_Height) - 1,
+                    TextID = R.MyInternationalizationString.Photograph,
+                    TextColor = ZigbeeColor.Current.GXCTextSelectedColor4
+                };
+                itemFL.AddChidren(selectPhotographBtn);
+                var selectPhotographLine = new Button()
+                {
+                    Y = selectPhotographBtn.Bottom,
+                    Height = 1,
+                    BackgroundColor = ZigbeeColor.Current.GXCLineColor,
+                };
+                itemFL.AddChidren(selectPhotographLine);
+
+                var selectAblumsBtn = new Button()
+                {
+                    Y = selectPhotographLine.Bottom,
+                    Height = Application.GetRealHeight(selectRow_Height) - 1,
+                    TextID = R.MyInternationalizationString.MyAblums,
+                    TextColor = ZigbeeColor.Current.GXCTextSelectedColor4
+                };
+                itemFL.AddChidren(selectAblumsBtn);
+
+                var cancelBtn = new Button()
+                {
+                    Y = Application.GetRealHeight(1742),
+                    Height = Application.GetRealHeight(selectRow_Height),
+                    Width = Application.GetRealWidth(selectRow_Width),
+                    Gravity = Gravity.CenterHorizontal,
+                    TextID = R.MyInternationalizationString.Cancel,
+                    TextColor = ZigbeeColor.Current.GXCTextSelectedColor4,
+                    BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor,
+                    Radius = (uint)Application.GetRealHeight(17)
+                };
+                selectFL.AddChidren(cancelBtn);
+
+                selectLocalPicture.MouseUpEventHandler += (send, ee) =>
+                {
+                    selectFL.RemoveFromParent();
+                    var localPic = new CategorySceneSelectImgByLocal();
+                    Shared.Phone.UserView.HomePage.Instance.AddChidren(localPic);
+                    Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
+                    localPic.Show();
+                    localPic.action = (imgPath) =>
+                    {
+                        IconPathType = 0;
+                        backGround.UnSelectedImagePath = imgPath;
+                    };
+                };
+                selectPhotographBtn.MouseUpEventHandler += (send, ee) =>
+                {
+                    selectFL.RemoveFromParent();
+                    IconPathType = 1;
+                    //閫氳繃鐩告満鎷嶇収瑁佸壀
+                    CropImage.TakePicture((imagePath) =>
+                    {
+                        Console.WriteLine("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath);
+                    }, "HDLPIC");
+                };
+               
+                selectAblumsBtn.MouseUpEventHandler += (send, ee) =>
+                {
+                    selectFL.RemoveFromParent();
+                    IconPathType = 2;
+                    //浠庣浉鍐岄�夋嫨鍥剧墖瑁佸壀
+                    CropImage.SelectPicture((imagePath) =>
+                    {
+                        Console.WriteLine("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath);
+                    }, "HDLPIC");
                 };
 
+                cancelBtn.MouseUpEventHandler += (send, ee) =>
+                {
+                    selectFL.RemoveFromParent();
+                };
+                selectFL.MouseUpEventHandler += (send, ee) =>
+                {
+                    selectFL.RemoveFromParent();
+                };
             };
             backGround.MouseUpEventHandler += backGroundIMGHander;
 
@@ -561,6 +662,7 @@
                     BackgroundColor = ZigbeeColor.Current.GXCTextWhiteColor
                 };
                 selectFL.AddChidren(itemFL);
+                itemFL.Animate = Animate.DownToUp;
 
                 var selectedFunctionBtn = new Button()
                 {
@@ -737,7 +839,8 @@
                             {
 
                             }
-                            
+                            modifySceneUI.IconPath = backGround.UnSelectedImagePath;
+
                             CommonPage.Loading.Start();
                             var memberDataList = new List<ZigBee.Device.Scene.AddSceneMemberData>();
                             for (int i = 0; i < sceneTargetDevicesList.Count; i++)
@@ -835,6 +938,7 @@
                             {
                                 if (modifyRoom != curRoom)
                                 {
+                                   
                                     modifyRoom.SceneUIList.Remove(modifySceneUI);
                                     modifyRoom.SceneUIFilePathList.Remove(modifySceneUI.FileName);
                                     curRoom.SceneUIList.Add(modifySceneUI);
@@ -969,7 +1073,5 @@
         }
 
         #endregion
-
-
     }
 }

--
Gitblit v1.8.0