From a4d29f9f72452ccae2f607e6ad31cad493822da4 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 06 五月 2020 11:36:47 +0800
Subject: [PATCH] 2020-05-06-1
---
ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs | 69 ++++++++++++++++------------------
1 files changed, 32 insertions(+), 37 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
old mode 100644
new mode 100755
index b6fe64a..3b5ffb5
--- a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
@@ -28,11 +28,7 @@
public VerticalScrolViewLayout middle = new VerticalScrolViewLayout
{
Width = Application.GetRealWidth(1080),
- Height = Application.GetRealHeight(1920 - 260 - 200 - 184),
- BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
- };
- public FrameLayout saveframeLayout = new FrameLayout {
- Height = Application.GetRealHeight(260),
+ Height = Application.GetRealHeight(Method.H - 260 - 200 - 184),
BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
};
@@ -70,7 +66,8 @@
#endregion
///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
- if (Common.Room.Lists.Count == 0)
+ var listAllRoom = UserCenter.HdlRoomLogic.Current.GetAllListRooms();
+ if (listAllRoom.Count == 0)
{
return;
}
@@ -78,23 +75,10 @@
this.AddChidren(roomhorizontalScrol);
middle.Y = roomhorizontalScrol.Bottom;
this.AddChidren(middle);
- saveframeLayout.Y = middle.Bottom;
- this.AddChidren(saveframeLayout);
-
- var btnsave = new Button
- {
- X = Application.GetRealWidth(85),
- Height = Application.GetRealHeight(130),
- Width = Application.GetRealWidth(910),
- Radius = (uint)Application.GetRealHeight(60),
- BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
- TextID = MyInternationalizationString.Save,
- TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
- TextSize = 16,
- };
- saveframeLayout.AddChidren(btnsave);
-
- btnsave.MouseUpEventHandler += (sender2, e2) =>
+ LogicView.SaveView saveView = new LogicView.SaveView();
+ saveView.frameLayout.Y = middle.Bottom;
+ this.AddChidren(saveView.Show());
+ saveView.clickviewBtn.MouseUpEventHandler += (sender2, e2) =>
{
if (clickTag == "no" || tempScene == null)
{
@@ -182,8 +166,8 @@
var btnfoolricon = new Button
{
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
UnSelectedImagePath = "Floor/Floor.png",
Gravity = Gravity.CenterVertical,
};
@@ -284,7 +268,7 @@
roomTextButton.IsSelected = false;
roomTextButton = roomnameBtn;
roomnameBtn.IsSelected = true;
- SceneView(room.SceneUIList);
+ SceneView(room.ListSceneId);
}
@@ -302,7 +286,7 @@
roomTextButton.IsSelected = false;
roomTextButton = roomnameBtn;
roomnameBtn.IsSelected = true;
- SceneView(room.SceneUIList);
+ SceneView(room.ListSceneId);
};
roomnameBtn.MouseUpEventHandler += roomclick;
roombjBtn.MouseUpEventHandler += roomclick;
@@ -313,11 +297,16 @@
/// 鏄剧ず鎵�鏈夌殑鍦烘櫙鐨勬柟娉�
/// </summary>
/// <param name="scenelist"></param>
- void SceneView(List<SceneUI>scenelist)
+ void SceneView(List<int>scenelist)
{
middle.RemoveAll();
- foreach (var scene in scenelist)
+ foreach (var sceneId in scenelist)
{
+ var scene = UserCenter.HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId);
+ if (scene == null)
+ {
+ continue;
+ }
var sceneFramelayout = new FrameLayout
{
Height = Application.GetRealHeight(160),
@@ -325,11 +314,10 @@
};
middle.AddChidren(sceneFramelayout);
-
var sceneIconBtn = new Button
{
- Width = Application.GetRealWidth(81),
- Height = Application.GetRealHeight(81),
+ Width = Application.GetMinRealAverage(81),
+ Height = Application.GetMinRealAverage(81),
X = Application.GetRealWidth(58),
Y = Application.GetRealHeight(55),
UnSelectedImagePath = "ZigeeLogic/scene.png",
@@ -343,8 +331,7 @@
Width = Application.GetRealWidth(850),
Height = Application.GetRealHeight(130),
X = Application.GetRealWidth(176 + 10),
- LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-
+ LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
};
sceneFramelayout.AddChidren(sceneRow);
@@ -360,15 +347,23 @@
var selectedBtn = new Button
{
- Width = Application.GetRealWidth(58),
- Height = Application.GetRealHeight(58),
+ Width = Application.GetMinRealAverage(60),
+ Height = Application.GetMinRealAverage(60),
X = Application.GetRealWidth(789),
UnSelectedImagePath = "ZigeeLogic/selected.png",
Visible = false,
Gravity = Gravity.CenterVertical,
};
sceneRow.AddChidren(selectedBtn);
-
+ var lineBtn = new Button
+ {
+ Y = sceneFramelayout.Height - 1,
+ Width = Application.GetRealWidth(850),
+ Height = 1,
+ X = Application.GetRealWidth(176 + 10),
+ BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+ };
+ sceneFramelayout.AddChidren(lineBtn);
EventHandler<MouseEventArgs> sceneclick = (sender, e) =>
{
tempScene = scene;
--
Gitblit v1.8.0