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/SelectFloor.cs | 75 +++++++++++++++++++++++++------------
1 files changed, 50 insertions(+), 25 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs b/ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs
index 2d66ac5..69c0b29 100644
--- a/ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/SelectFloor.cs
@@ -22,7 +22,7 @@
/// <summary>
/// Init
/// </summary>
- public void Init(int x,int y,CommonForm.Direction direction=CommonForm.Direction.Left)
+ public void Init(int x, int y, CommonForm.Direction direction = CommonForm.Direction.Left)
{
dialogBackground = new Dialog
{
@@ -44,35 +44,30 @@
X = Application.GetRealWidth(x),
Y = Application.GetRealHeight(y),
Width = Application.GetMinRealAverage(449),
- Height = Application.GetMinRealAverage(783),
- UnSelectedImagePath="Item/SelectFloor_Left.png"
+ Height = Application.GetMinRealAverage(773),
+ UnSelectedImagePath = "Floor/SelectFloor_Left_4.png"
};
dialog.AddChidren(bg);
- if (direction == CommonForm.Direction.Right)
- {
- bg.UnSelectedImagePath = "Item/SelectFloor_Right.png";
- }
var backgroundFL = new FrameLayout
{
- X = Application.GetRealWidth(x+10),
- Y = Application.GetRealHeight(y+23),
- Width = Application.GetMinRealAverage(449-20),
- Height = Application.GetMinRealAverage(783-23-10),
- BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
+ X = Application.GetRealWidth(x),
+ Y = Application.GetRealHeight(y + 23),
+ Width = Application.GetMinRealAverage(449),
+ Height = Application.GetMinRealAverage(773 - 23)
};
dialog.AddChidren(backgroundFL);
var tip = new Button
{
X = Application.GetRealWidth(80),
- Width = Application.GetRealWidth(350),
- Height = Application.GetRealHeight(150),
+ Width = Application.GetMinRealAverage(350),
+ Height = Application.GetMinRealAverage(150),
TextColor = ZigbeeColor.Current.GXCTextBlackColor,
TextAlignment = TextAlignment.CenterLeft,
TextID = R.MyInternationalizationString.SelectFloor,
- TextSize=16,
- IsBold=true
+ TextSize = 14,
+ IsBold = true
};
backgroundFL.AddChidren(tip);
@@ -80,12 +75,40 @@
{
Y = tip.Bottom,
Width = Application.GetMinRealAverage(449),
- Height = Application.GetMinRealAverage(600)
+ Height = Application.GetMinRealAverage(600),
+ VerticalScrollBarEnabled = false
};
backgroundFL.AddChidren(floorLayout);
- if (Config.Instance.Home.FloorDics.Count > 0)
+ var floorCount = Config.Instance.Home.FloorDics.Count;
+
+ if (floorCount > 0)
{
+ string directStr = string.Empty;
+ if (direction == CommonForm.Direction.Right)
+ {
+ directStr = "Right";
+ }
+ else
+ {
+ directStr = "Left";
+ }
+
+ if (floorCount > 5)
+ {
+ bg.UnSelectedImagePath = $"Floor/SelectFloor_{directStr}_5.png";
+ bg.Height = Application.GetMinRealAverage(150*6+23);
+ backgroundFL.Height = Application.GetMinRealAverage(150 * 6);
+ floorLayout.Height = Application.GetMinRealAverage(150 * 5);
+ }
+ else
+ {
+ bg.UnSelectedImagePath = $"Floor/SelectFloor_{directStr}_{floorCount}.png";
+ bg.Height = Application.GetMinRealAverage(150 * (floorCount + 1)+23);
+ backgroundFL.Height = Application.GetMinRealAverage(150 * (floorCount + 1));
+ floorLayout.Height = Application.GetMinRealAverage(150 * floorCount);
+ }
+
foreach (var floor in Config.Instance.Home.FloorDics)
{
AddFloor(floorLayout, floor);
@@ -97,14 +120,16 @@
/// AddFloor
/// </summary>
/// <param name="verticalScrolView"></param>
- private void AddFloor(VerticalScrolViewLayout verticalScrolView, KeyValuePair<string, string> floor)
+ private void AddFloor(VerticalScrolViewLayout verticalScrolView, KeyValuePair<string, string> floor,bool isLast=false)
{
var frow = new CommonForm.LeftIconButtonRow(449, 150);
+ frow.Width = Application.GetMinRealAverage(449);
+ frow.Height = Application.GetMinRealAverage(150);
frow.Tag = floor.Key;
frow.Init("Floor/Floor.png", "Floor/FloorSelected.png", floor.Value);
verticalScrolView.AddChidren(frow);
- if(string.IsNullOrEmpty(CurFloorId))
+ if (string.IsNullOrEmpty(CurFloorId))
{
if (Config.Instance.Home.CurrentFloorId == floor.Key)
{
@@ -127,18 +152,18 @@
/// </summary>
/// <param name="sender"></param>
/// <param name="mouseEventArgs"></param>
- private void SelectFloor_MouseUpEvent(object sender,MouseEventArgs mouseEventArgs)
+ private void SelectFloor_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs)
{
(sender as CommonForm.LeftIconButtonRow).IsSelected = true;
- if(changeFloor)
+ if (changeFloor)
{
Config.Instance.Home.CurrentFloorId = (sender as CommonForm.LeftIconButtonRow).Tag.ToString();
- Config.Instance.Home.Save();
- Common.Room.RefreshRoomListView();
+ Config.Instance.Home.Save(false);
+ Common.Room.CurrentRoom.RefreshRoomListView();
}
RemoveView();
FloorAction?.Invoke((sender as CommonForm.LeftIconButtonRow).Tag.ToString());
-
+
}
/// <summary>
--
Gitblit v1.8.0