From fdf2472a13873ab3570e3c82de50896b8f5ac1cb Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期五, 18 十月 2019 17:34:53 +0800
Subject: [PATCH] 2019-10-18-2
---
ZigbeeApp/Shared/Phone/Device/Category/Category.cs | 101 +++++++++++++++++++++++++-------------------------
1 files changed, 51 insertions(+), 50 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
index e634aee..edec647 100644
--- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -22,7 +22,7 @@
/// <summary>
/// low_High
/// </summary>
- private const int low_High= 127;
+ private const int low_High = 127;
/// <summary>
/// 鍔熻兘
/// </summary>
@@ -547,7 +547,7 @@
{
foreach (var floor in Config.Instance.Home.FloorDics)
{
- Config.Instance.Home.CurrentFloorId=floor.Key;
+ Config.Instance.Home.CurrentFloorId = floor.Key;
break;
}
}
@@ -561,7 +561,7 @@
/// <param name="selectedBtn">閫変腑閭d釜鐣岄潰 0--鍔熻兘 1--鍦烘櫙 2--鑷姩鍖� </param>
public void Show(int selectedBtn = 1)
{
-
+
ZbGateway.StatusList.Add(this);
RemoveAll();
@@ -664,16 +664,16 @@
var roomFL = new HorizontalScrolViewLayout()
{
- X= Application.GetRealWidth(CommonFormResouce.X_Left),
+ X = Application.GetRealWidth(CommonFormResouce.X_Left),
Y = functionSceneAutoBG.Bottom,
Height = Application.GetRealHeight(167),
- Width=Application.GetRealWidth(CommonPage.AppRealWidth-CommonFormResouce.X_Left),
+ Width = Application.GetRealWidth(CommonPage.AppRealWidth - CommonFormResouce.X_Left),
BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor
};
midFL.AddChidren(roomFL);
Button curBtn = new Button();
- for(int i=0;i<Config.Instance.Home.RoomFilePathList.Count;i++)
+ for (int i = 0; i < Config.Instance.Home.RoomFilePathList.Count; i++)
{
var roomFilePath = Config.Instance.Home.RoomFilePathList[i];
var room = Shared.Common.Room.GetRoomByFilePath(roomFilePath);
@@ -683,9 +683,9 @@
}
var row = new RowLayout()
{
- Width = Application.GetRealWidth(187+50),
+ Width = Application.GetRealWidth(187 + 50),
Height = Application.GetRealHeight(167),
- LineColor= ZigbeeColor.Current.GXCGrayBackgroundColor
+ LineColor = ZigbeeColor.Current.GXCGrayBackgroundColor
};
roomFL.AddChidren(row);
@@ -693,21 +693,22 @@
{
Width = Application.GetRealWidth(187),
Height = Application.GetRealHeight(78),
- Radius=(uint)Application.GetRealHeight(78/2),
+ Radius = (uint)Application.GetRealHeight(78 / 2),
Gravity = Gravity.Center,
- Text=room.Name,
- TextColor=ZigbeeColor.Current.GXCTextGrayColor,
- SelectedTextColor=ZigbeeColor.Current.GXCTextWhiteColor,
- BackgroundColor=ZigbeeColor.Current.GXCButtonUnSelectedColor3,
- SelectedBackgroundColor=ZigbeeColor.Current.GXCButtonSelectedColor,
- BorderColor=ZigbeeColor.Current.GXCBorderUnSelectedColor,
- BorderWidth=1
+ Text = room.Name,
+ TextColor = ZigbeeColor.Current.GXCTextGrayColor,
+ SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor,
+ BackgroundColor = ZigbeeColor.Current.GXCButtonUnSelectedColor3,
+ SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor,
+ BorderColor = ZigbeeColor.Current.GXCBorderUnSelectedColor,
+ BorderWidth = 1
};
row.AddChidren(roomBtn);
- if (Shared.Common.Room.CurrentRoom==null) {
+ if (Shared.Common.Room.CurrentRoom == null)
+ {
continue;
}
- if(Shared.Common.Room.CurrentRoom.FileName==roomFilePath)
+ if (Shared.Common.Room.CurrentRoom.FileName == roomFilePath)
{
roomBtn.IsSelected = true;
curBtn = roomBtn;
@@ -725,7 +726,7 @@
Shared.Common.Room.CurrentRoom = room;
};
}
-
+
//鍔熻兘鍜屽満鏅痓odyView
functionSceneBodyView = new FrameLayout()
@@ -776,7 +777,7 @@
addBtn.MouseUpEventHandler += AddBtn_MouseUpEventHandler;
selectFloorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler;
- floorBtn.MouseUpEventHandler+= SelectedFloor_MouseUpEventHandler;
+ floorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler;
}
@@ -787,9 +788,9 @@
/// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
private void SelectedFloor_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs)
{
- var floors = new SelectFloor ();
+ var floors = new SelectFloor();
AddChidren(floors);
- floors.Init(599,357);
+ floors.Init(599, 357);
floors.FloorAction += (floorName) =>
{
floorBtn.Text = floorName;
@@ -941,10 +942,10 @@
{
functionTypeScrowView = new HorizontalScrolViewLayout
{
- X=Application.GetRealWidth(CommonFormResouce.X_Left),
+ X = Application.GetRealWidth(CommonFormResouce.X_Left),
Height = Application.GetRealHeight(279),
Width = Application.GetRealWidth(1028),
- BackgroundColor=ZigbeeColor.Current.GXCBackgroundColor
+ BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
};
functionSceneBodyView.AddChidren(functionTypeScrowView);
@@ -953,13 +954,13 @@
X = Application.GetRealWidth(CommonFormResouce.X_Left),
Y = functionTypeScrowView.Bottom + Application.GetRealHeight(50),
Width = Application.GetRealWidth(1028),
- Height = functionSceneBodyView.Height - Application.GetRealHeight(279+50) - 1,
+ Height = functionSceneBodyView.Height - Application.GetRealHeight(279 + 50) - 1,
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
};
functionSceneBodyView.AddChidren(deviceListScrolView);
tempFunctionTypeBtn = new FunctionButton();
-
+
foreach (var deviceType in Common.Room.AllRoomDeviceTypeList)
{
typeRowLayout = new RowLayout()
@@ -1003,7 +1004,7 @@
tempFunctionTypeBtn.IsSelected = false;
tempFunctionTypeBtn = (typeSender as Button).Parent as FunctionButton;
((typeSender as Button).Parent as FunctionButton).IsSelected = true;
-
+
deviceListScrolView.RemoveAll();
var sameTypeList = new List<DeviceUI> { };
@@ -1081,7 +1082,7 @@
var deviceTypeRowLayout = new RowLayout()
{
- Height = Application.GetRealHeight(127+35),
+ Height = Application.GetRealHeight(127 + 35),
LineColor = ZigbeeColor.Current.GXCBackgroundColor,
Tag = deviceUI
};
@@ -1315,7 +1316,7 @@
};
deviceTypeRowLayout.AddRightView(delBtn);
delBtn.MouseUpEventHandler += delEvent;
-
+
}
else if (deviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.Thermostat)
{
@@ -1470,7 +1471,7 @@
deviceTypeRowLayout.AddRightView(delBtn);
delBtn.MouseUpEventHandler += delEvent;
-
+
deviceRow.SwitchBtn.MouseUpEventHandler += (sender, e) =>
{
zbGateway = deviceUI.CommonDevice.Gateway;
@@ -1505,7 +1506,7 @@
}
else
{
-
+
}
}
}
@@ -1517,10 +1518,10 @@
{
var noFunction = new Button()
{
- Y=Application.GetRealHeight(320),
- Width=Application.GetMinRealAverage(757),
+ Y = Application.GetRealHeight(320),
+ Width = Application.GetMinRealAverage(757),
Height = Application.GetMinRealAverage(435),
- UnSelectedImagePath="Item/NoFunction.png",
+ UnSelectedImagePath = "Item/NoFunction.png",
Gravity = Gravity.CenterHorizontal
};
functionSceneBodyView.AddChidren(noFunction);
@@ -1535,7 +1536,7 @@
//Text = "娌℃湁鍔熻兘 \n 璇峰湪涓汉涓績涓�--璁惧绠$悊澶勬坊鍔�",
TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
TextAlignment = TextAlignment.Center,
- IsMoreLines=true
+ IsMoreLines = true
};
functionSceneBodyView.AddChidren(noFunctionTip);
}
@@ -1565,7 +1566,7 @@
{
var sceneScrolView = new VerticalScrolViewLayout
{
- Y=Application.GetRealHeight(58)
+ Y = Application.GetRealHeight(58)
};
functionSceneBodyView.AddChidren(sceneScrolView);
foreach (var sceneRoomUI in sceneList)
@@ -1590,9 +1591,9 @@
var sceneImg = new Button()
{
- X=Application.GetRealWidth(179),
- Width=Application.GetMinReal(844),
- Height=Application.GetMinReal(400),
+ X = Application.GetRealWidth(179),
+ Width = Application.GetMinReal(844),
+ Height = Application.GetMinReal(400),
Gravity = Gravity.CenterVertical,
UnSelectedImagePath = sceneRoomUI.sceneUI.IconPath,
Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius)
@@ -1601,22 +1602,22 @@
var leftFL = new FrameLayout
{
- X=Application.GetRealWidth(CommonFormResouce.X_Left),
+ X = Application.GetRealWidth(CommonFormResouce.X_Left),
Width = Application.GetRealWidth(251),
Height = Application.GetRealHeight(282),
- Gravity=Gravity.CenterVertical,
+ Gravity = Gravity.CenterVertical,
BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor2
};
sceneRowLayout.AddChidren(leftFL);
var collectionBtn = new Button
{
- X=Application.GetRealWidth(23),
- Y=Application.GetRealHeight(23),
- Width=Application.GetMinRealAverage(65),
- Height=Application.GetMinRealAverage(65),
- UnSelectedImagePath="Item/Collection.png",
- SelectedImagePath="Item/CollectionSelected.png"
+ X = Application.GetRealWidth(23),
+ Y = Application.GetRealHeight(23),
+ Width = Application.GetMinRealAverage(65),
+ Height = Application.GetMinRealAverage(65),
+ UnSelectedImagePath = "Item/Collection.png",
+ SelectedImagePath = "Item/CollectionSelected.png"
};
leftFL.AddChidren(collectionBtn);
@@ -1627,7 +1628,7 @@
TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
Text = sceneRoomUI.sceneUI.Name,
Gravity = Gravity.Center,
- IsMoreLines=true
+ IsMoreLines = true
};
leftFL.AddChidren(sceneNameBtn);
@@ -1642,7 +1643,7 @@
//缂栬緫
var settingBtn = new Device.CommonForm.RowLayoutEditButton()
{
- TextID=R.MyInternationalizationString.Setting,
+ TextID = R.MyInternationalizationString.Setting,
Tag = sceneRoomUI.sceneUI.SceneDelayTime
};
//鍒犻櫎
@@ -1696,7 +1697,7 @@
var tip = new CustomAlert { };
AddChidren(tip);
tip.Show(Language.StringByID(R.MyInternationalizationString.ConfirmDelete));
-
+
//var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.ConfirmDelete), Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim));
//alert.Show();
tip.ResultEventHandler += async (e1) =>
--
Gitblit v1.8.0