From eb424d24e39bab4a245725f35deab3f234ea0f13 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 13 十二月 2019 10:48:50 +0800
Subject: [PATCH] 2019.12.13
---
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs | 109 +++++++++++++++++-------------------------------------
1 files changed, 35 insertions(+), 74 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
index 6c5273b..e6e56e9 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -1,6 +1,5 @@
锘縰sing System;
using System.Collections.Generic;
-using Java.Util;
using Microsoft.AppCenter.Crashes;
using Shared.Common;
using Shared.Phone.Device.Light;
@@ -115,13 +114,14 @@
midVerticalScrolViewLayout = new VerticalScrolViewLayout()
{
Y = btnMidTopLayout.Bottom,
+ Height = Application.GetRealHeight(1145),
};
this.midFrameLayout.AddChidren(midVerticalScrolViewLayout);
var bottomFrameLayout = new FrameLayout()
{
Width = LayoutParams.MatchParent,
- Height = Application.GetRealHeight(1737 - 1472),
+ Height = Application.GetRealHeight(127),
Y = Application.GetRealHeight(1472),
};
this.midFrameLayout.AddChidren(bottomFrameLayout);
@@ -129,9 +129,8 @@
btnFinifh = new Button()
{
Width = Application.GetRealWidth(907),
- Height = Application.GetRealHeight(127),
Gravity = Gravity.CenterHorizontal,
- Radius = (uint)Application.GetRealHeight(120) / 2,
+ Radius = (uint)Application.GetRealHeight(127) / 2,
TextID = R.MyInternationalizationString.Save,
BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
@@ -201,14 +200,13 @@
}
else
{
- var btn = new Button()
- {
- Gravity = Gravity.Center,
- };
- this.midFrameLayout.AddChidren(btn);
Application.RunOnMainThread(() =>
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btn);
+ var myTip = new Tip();
+ myTip.Direction = AMPopTipDirection.None;
+ myTip.CloseTime = 2;
+ myTip.Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime);
+ myTip.Show(Common.CommonPage.Instance);
});
}
}
@@ -218,7 +216,12 @@
{
Application.RunOnMainThread(() =>
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh);
+ var myTip = new Tip();
+ myTip.Direction = AMPopTipDirection.None;
+ myTip.CloseTime = 2;
+ myTip.Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode);
+ myTip.Show(Common.CommonPage.Instance);
+ //new Tip() { Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(btnFinifh);
btnFinifh.Enable = true;
btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
});
@@ -365,8 +368,12 @@
#endregion
}
- // 鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀�
- void RefreshRoomList(Shared.Common.Room curRoom, Button btnFinish, ref int index2)
+ /// <summary>
+ /// 鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀�
+ /// </summary>
+ /// <param name="gateway">Gateway.</param>
+ /// <param name="key">Key.</param>
+ void RefreshRoomList(Shared.Common.Room curRoom, Button btnChooseKeyMode, ref int index2)
{
if (roomList.Count == 0)
{
@@ -387,7 +394,7 @@
continue;
}
- //濡傛灉鎴块棿涓病鏈夎澶囷紝鍒欎笉鏄剧ず
+ //濡傛灉鎴块棿涓病鏈夊満鏅紝鍒欎笉鏄剧ず
if (room.SceneUIList.Count == 0)
{
continue;
@@ -406,6 +413,7 @@
Height = Application.GetRealHeight(78),
Width = Application.GetRealWidth(187),
Y = Application.GetRealHeight(58),
+ X = Application.GetRealWidth(58),
Radius = (uint)Application.GetMinRealAverage(78 / 2),
BorderColor = Shared.Common.ZigbeeColor.Current.XMOrange,
BorderWidth = 1,
@@ -422,15 +430,10 @@
TextSize = 12,
TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
Gravity = Gravity.Center,
- //SelectedImagePath = "BindPic/BindRoomColorOn.png",
- //UnSelectedImagePath = "BindPic/BindRoomColor.png",
};
btnRoomFrameLayout.AddChidren(btnRoom);
-
btnRoom.IsSelected = false;
-
- //榛樿閫変腑姣忎釜妤煎眰鐨勭涓�涓埧闂�
if (index == 0)
{
btnRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
@@ -440,48 +443,6 @@
curentOldRoom = btnRoom;
curentOldRoomFrameLayout = btnRoomFrameLayout;
}
-
- //璁板綍涔嬪墠閫変腑鐨勬埧闂�
- //if (currentKey.RoomId == "")
- //{
- // if (i == index)
- // {
- // btnRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
- // btnRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
- // btnRoomFrameLayout.BorderWidth = 0;
- // btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite;
- // curentOldRoom = btnRoom;
- // curentOldRoomFrameLayout = btnRoomFrameLayout;
- // }
- // else
- // {
- // btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
- // btnRoom.IsSelected = false;
- // btnRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout;
- // btnRoomFrameLayout.BorderWidth = 1;
- // }
- //}
- //else
- //{
- // if (currentKey.RoomId == room.Id)
- // {
- // btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMWhite;
- // btnRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
- // btnRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
- // btnRoomFrameLayout.BorderWidth = 0;
- // curentOldRoom = btnRoom;
- // curentOldRoomFrameLayout = btnRoomFrameLayout;
- // curRoom = room;
- // index2 = i;
- // }
- // else
- // {
- // btnRoom.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3;
- // btnRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout;
- // btnRoomFrameLayout.BorderWidth = 1;
- // }
- //}
-
EventHandler<MouseEventArgs> eHandlerRoom = (sender, e) =>
{
if (!btnRoom.IsSelected)
@@ -496,17 +457,17 @@
curentOldRoom.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
curRoom = room;
currentKey.RoomId = room.Id;
+ RefreshSceneList(curRoom);
if (curRoom.SceneUIList.Count == 0)
{
- btnFinish.Enable = false;
- btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
+ btnChooseKeyMode.Enable = false;
+ btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
}
else
{
- btnFinish.Enable = true;
- btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ btnChooseKeyMode.Enable = true;
+ btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
}
- RefreshSceneList(curRoom);
}
if (btnRoomFrameLayout.BorderWidth == 1)
@@ -521,17 +482,17 @@
curentOldRoomFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange;
curRoom = room;
currentKey.RoomId = room.Id;
+ RefreshSceneList(curRoom);
if (curRoom.SceneUIList.Count == 0)
{
- btnFinish.Enable = false;
- btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
+ btnChooseKeyMode.Enable = false;
+ btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
}
else
{
- btnFinish.Enable = true;
- btnFinish.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ btnChooseKeyMode.Enable = true;
+ btnChooseKeyMode.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
}
- RefreshSceneList(curRoom);
}
};
btnRoom.MouseUpEventHandler += eHandlerRoom;
@@ -543,10 +504,10 @@
X = btnRoom.Right,
};
btnHorizontalScrolViewLayout.AddChidren(btnEmpty);
+ index++;
}
-
- BindInfo.FinishDisplay(roomTempList, btnFinish);
- index++;
+ BindInfo.FinishDisplay(roomTempList, btnChooseKeyMode);
+ RefreshSceneList(curRoom);
}
//鎸夐敭缁戝畾鍦烘櫙琛ㄦ樉绀�
--
Gitblit v1.8.0