From 587c36e27131f2d028fcabc13b296a8de7470034 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期三, 08 一月 2020 08:59:19 +0800
Subject: [PATCH] 2019.1.8
---
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs | 52 ++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 44 insertions(+), 8 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
index 584adc1..194554c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -26,9 +26,10 @@
/// 鏋勯�犲嚱鏁�
/// </summary>
/// <param name="doorLock"></param>
- public AddScenePage(ZigBee.Device.Panel key)
+ public AddScenePage(ZigBee.Device.Panel key, List<ScenesListInfo> gwScenesList)
{
this.currentKey = key;
+ gwCurScenesList = gwScenesList;
}
#region 鈼� 鍙橀噺鐢虫槑__________________________
@@ -46,6 +47,7 @@
Button btnFloorText;
Dictionary<string, string> dicFloor;//妤煎眰鍒楄〃
List<SceneUI> currentKeyAllRoomSceneList = new List<SceneUI>();
+ public List<ScenesListInfo> gwCurScenesList = new List<ScenesListInfo>();//缃戝叧涓殑鍦烘櫙鍒楄〃
#endregion
/// <summary>
@@ -67,7 +69,6 @@
var btnAddFrameLayout = new FrameLayout
{
X = Application.GetRealWidth(830),
- Width = Application.GetRealWidth(200),
};
this.titleFrameLayout.AddChidren(btnAddFrameLayout);
@@ -77,7 +78,8 @@
X = Application.GetRealWidth(15),
Text = Language.StringByID(R.MyInternationalizationString.FirstFloor),
TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
- TextSize = 15,
+ TextSize = 14,
+ IsBold =true,
TextAlignment = TextAlignment.CenterRight,
};
btnAddFrameLayout.AddChidren(btnFloorText);
@@ -95,6 +97,14 @@
{
SideslipFramelayout();
};
+ if (Common.Config.Instance.Home.FloorDics.Count == 0)
+ {
+ btnAddFrameLayout.Width = 0;
+ }
+ else
+ {
+ btnAddFrameLayout.Width = Application.GetRealWidth(200);
+ }
MidFrameLayoutContent(btnFloorText);
}
@@ -136,6 +146,7 @@
TextID = R.MyInternationalizationString.Save,
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
+ IsBold =true,
TextSize = 16,
};
bottomFrameLayout.AddChidren(btnFinifh);
@@ -194,7 +205,7 @@
Shared.Common.Room curRoom = roomList[0];
int index = 0;
RefreshRoomList(curRoom, ref index);
- RefreshSceneList(roomList[index]);
+ //RefreshSceneList(roomList[index]);
if (curRoom.SceneUIList.Count == 0)
{
@@ -551,7 +562,14 @@
}
Button oldScene = null;
int curIndex = 0;
- foreach (var scene in curRoom.SceneUIList)
+ var currentSceneUIList = GetMatchSceneUIList(curRoom);
+ if (currentSceneUIList.Count == 0)
+ {
+ btnFinifh.Enable = false;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
+ return;
+ }
+ foreach (var scene in currentSceneUIList)
{
#region 缁戝畾琛║I鏄撅紙鏃犳暟鎹鐞嗭級
var rowLayout = new FrameLayout()
@@ -567,8 +585,8 @@
Y = Application.GetMinRealAverage(46),
Width = Application.GetMinRealAverage(81),
Height = Application.GetMinRealAverage(81),
- UnSelectedImagePath = "Scene/SceneIcon.png"
- };
+ UnSelectedImagePath = "Scene/SceneIcon.png",// scene.IconPath,
+ };
rowLayout.AddChidren(devicePic);
var btnBindName = new Button()
@@ -577,6 +595,7 @@
X = devicePic.Right + Application.GetRealWidth(20),
TextColor = Shared.Common.ZigbeeColor.Current.TextBlack,
TextAlignment = TextAlignment.CenterLeft,
+ TextSize =15,
};
rowLayout.AddChidren(btnBindName);
@@ -734,8 +753,9 @@
Height = Application.GetRealHeight(58),
X = Application.GetRealWidth(81),
Y = Application.GetRealHeight(81),
- TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
+ TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
TextSize = 14,
+ IsBold = true,
TextAlignment = TextAlignment.CenterLeft,
TextID = R.MyInternationalizationString.SelectFloor,
};
@@ -786,6 +806,7 @@
if (currentKey.currentSelectFloorId == floorId)
{
btnAllMethod.IsSelected = true;
+ btnAllMethod.IsBold = true;
btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
}
@@ -813,6 +834,7 @@
oldbuttonText = btnMethodText;
btnMethodText.IsSelected = true;
oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ oldbuttonText.IsBold = true;
}
//鑾峰彇妤煎眰瀵瑰簲鐨勬埧闂�
@@ -880,6 +902,20 @@
}
return currentKeyAllRoomSceneList;
}
+ //鑾峰彇缃戝叧涓瓨鍦ㄧ殑鏈湴鍦烘櫙鍒楄〃
+ List<SceneUI> GetMatchSceneUIList(Shared.Common.Room curRoom)
+ {
+ var tempSceneUIList = new List<SceneUI>();
+ foreach (var scene in curRoom.SceneUIList)
+ {
+ var gwSc = gwCurScenesList.Find(obj => (obj.ScenesId == scene.Id));
+ if (gwSc != null)
+ {
+ tempSceneUIList.Add(scene);
+ }
+ }
+ return tempSceneUIList;
+ }
public void DeviceInfoChange(CommonDevice common, string typeTag)
{
--
Gitblit v1.8.0