From ef63c84b3b408fea661f84d3f9ecc237787af250 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 09 十二月 2019 11:10:07 +0800
Subject: [PATCH] 2019-12-09-1
---
ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs | 61 ++++++++++++++++--------------
1 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs b/ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs
old mode 100644
new mode 100755
index 4df2296..c0d9db5
--- a/ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Room/AddRoomSelectPicByLocal.cs
@@ -9,6 +9,10 @@
{
BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
}
+ public override void RemoveFromParent()
+ {
+ base.RemoveFromParent();
+ }
public void Show()
{
ShowPic();
@@ -21,7 +25,7 @@
var title = new Button()
{
TextAlignment = TextAlignment.Center,
- TextID = R.MyInternationalizationString.SelectPic,
+ //TextID = R.MyInternationalizationString.SelectPic,
TextSize = 20,
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
Width = Application.GetRealWidth(500),
@@ -46,40 +50,39 @@
};
this.AddChidren(midFl);
- for (int i = 0; i < 25; i++)
+
+ int k = 0;
+ for (int j = 0; j < 3; j++)
{
- var RoomRowView = new FrameLayout()
+ var itemView = new FrameLayout()
{
- Height = Application.GetRealHeight(600),
- Width = Application.GetRealWidth(CommonPage.AppRealWidth - CommonPage.XLeft * 2),
- Gravity=Gravity.CenterHorizontal,
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
- Radius = CommonPage.BigFormRadius,
+ Height = Application.GetRealHeight(311 + CommonPage.XLeft)
};
- midFl.AddChidren(RoomRowView);
-
- var backGroundBtn = new Button()
+ midFl.AddChidren(itemView);
+ for (int i = 0; i < 2; i++)
{
- Y = Application.GetRealHeight(50),
- Width = Application.GetMinRealAverage(CommonPage.AppRealWidth - CommonPage.XLeft * 2),
- Height = Application.GetMinRealAverage(550),
- UnSelectedImagePath = "Room/r" + (i).ToString() + ".png",
- Radius = CommonPage.BigFormRadius,
- Gravity=Gravity.CenterHorizontal
- };
- RoomRowView.AddChidren(backGroundBtn);
-
- backGroundBtn.MouseUpEventHandler += (sender, e) =>
- {
- if (AddRoom.room.BackgroundImageType == 1 || AddRoom.room.BackgroundImageType == 2)
+ var icon = new Button()
{
- AddRoom.OldBackgroundImagePath = AddRoom.room.BackgroundImage;
- }
- //AddRoom.room.BackgroundImage = backGroundBtn.UnSelectedImagePath;
- action?.Invoke(backGroundBtn.UnSelectedImagePath);
- this.RemoveFromParent();
- };
+ X = Application.GetRealWidth(CommonPage.XLeft + i * (467 + 32)),
+ Width = Application.GetMinRealAverage(467),
+ Height = Application.GetMinRealAverage(311),
+ Gravity = Gravity.CenterVertical,
+ UnSelectedImagePath = $"RoomIcon/{k}.JPG",
+ };
+ itemView.AddChidren(icon);
+ icon.SetViewShadow(true);
+ k++;
+
+ EventHandler<MouseEventArgs> selectIcon = (sender, e) =>
+ {
+ action?.Invoke(icon.UnSelectedImagePath);
+ action = null;
+ this.RemoveFromParent();
+ };
+ icon.MouseUpEventHandler += selectIcon;
+ }
}
+
#endregion
}
}
--
Gitblit v1.8.0