From 66a9965c44ecc32a6696abca876ab9d1cd091584 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 28 二月 2020 15:25:13 +0800
Subject: [PATCH] 2020.2.28
---
ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs | 40 +++++++++++++++++++---------------------
1 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs b/ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs
index c789c3e..fb9e247 100644
--- a/ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs
@@ -29,6 +29,10 @@
/// </summary>
private Button floorBtn;
/// <summary>
+ /// 褰撳墠妤煎眰id
+ /// </summary>
+ private string curFloorId;
+ /// <summary>
/// 閫夋嫨妤煎眰
/// </summary>
private Button selectFloorBtn;
@@ -128,9 +132,12 @@
{
var floors = new SelectFloor();
AddChidren(floors);
+ floors.changeFloor = false;
+ floors.CurFloorId = curFloorId;
floors.Init(580, 184, Direction.Right);
floors.FloorAction += (floorId) =>
{
+ curFloorId = floorId;
floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId);
RefreshBodyView(floorId);
};
@@ -194,30 +201,21 @@
};
bodyFrameLayout.AddChidren(functionSceneBodyView);
- Button curBtn = new Button();
+ RoomButton curBtn = new RoomButton(0,0);
+
foreach (var room in Common.Room.CurrentRoom.GetRoomsByFloorIdAppendLoveRoom(floorId))
{
var row = new FrameLayout()
{
- Width = Application.GetRealWidth(187 + 50),
- Height = Application.GetRealHeight(204),
+ Width = Application.GetRealWidth(255),
+ Height = Application.GetRealHeight(167)
};
roomFL.AddChidren(row);
- var roomBtn = new Button()
- {
- Width = Application.GetRealWidth(187),
- Height = Application.GetRealHeight(78),
- 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
- };
+ RoomButton roomBtn = new RoomButton(0, 0);
+ roomBtn.Gravity = Gravity.Center;
+ roomBtn.Init();
+ roomBtn.SetTitle(room.Name);
row.AddChidren(roomBtn);
if (room.IsLove)
@@ -227,15 +225,15 @@
RefreshScene(room);
}
- roomBtn.MouseUpEventHandler += (sender, e) =>
+ roomBtn.ButtonClickEvent += (sender, e) =>
{
- if ((sender as Button) == curBtn)
+ if (sender == curBtn)
{
return;
}
- (sender as Button).IsSelected = true;
+ sender.IsSelected = true;
curBtn.IsSelected = false;
- curBtn = sender as Button;
+ curBtn = sender;
RefreshScene(room);
};
--
Gitblit v1.8.0