From 404cdc88627f942df7944af04ee05b9d527752d6 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 30 九月 2019 13:22:40 +0800
Subject: [PATCH] 合并了徐梅的按键面板绑定
---
ZigbeeApp/Shared/Phone/UserCenter/Safety/AddSceneAlarmTargetListForm.cs | 120 +++++++++++++++++++++++++++++++++--------------------------
1 files changed, 67 insertions(+), 53 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AddSceneAlarmTargetListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AddSceneAlarmTargetListForm.cs
index 2b7cdbd..6516847 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AddSceneAlarmTargetListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AddSceneAlarmTargetListForm.cs
@@ -8,20 +8,22 @@
/// <summary>
/// 娣诲姞鍦烘櫙鐨勫垪琛ㄧ晫闈�
/// </summary>
- public class AddSceneAlarmTargetListForm : UserCenterCommonForm
+ public class AddSceneAlarmTargetListForm : EditorCommonForm
{
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
/// <summary>
/// 鍒楄〃鎺т欢
/// </summary>
- private VerticalScrolViewLayout listView = null;
+ private VerticalListControl listView = null;
/// <summary>
/// 闃插尯ID(杩欎釜涓滆タ浼间箮鏄敮涓�鐨�)
/// </summary>
private int zoonID = 0;
- /// <summary>
- /// 鏈湴瀛樺湪鐨勫満鏅�
- /// </summary>
- private List<Common.SceneRoomUI> listScene = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
/// <summary>
/// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
@@ -31,70 +33,83 @@
public void ShowForm(int i_zoonID, List<Common.SceneRoomUI> i_listScene)
{
this.zoonID = i_zoonID;
- this.listScene = i_listScene;
//璁剧疆澶撮儴淇℃伅
base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uScence));
- //瀹屾垚
- var btnfinish = new TopLayoutFinshView();
- topFrameLayout.AddChidren(btnfinish);
- btnfinish.MouseUpEventHandler += (sender, e) =>
- {
- //淇濆瓨鍦烘櫙鍒板畨闃�
- this.SaveSceneToSafety();
- };
-
//鍒濆鍖栦腑閮ㄤ俊鎭�
- this.InitMiddleFrame();
+ this.InitMiddleFrame(i_listScene);
}
/// <summary>
/// 鍒濆鍖栦腑閮ㄤ俊鎭�
/// </summary>
- private void InitMiddleFrame()
+ /// <param name="listScene">鐜板瓨鐨勫満鏅�</param>
+ private void InitMiddleFrame(List<Common.SceneRoomUI> listScene)
{
- //鍦烘櫙鍒楄〃
- var btnTitle = new TitleViewControl();
- btnTitle.TextColor = UserCenterColor.Current.TextGrayColor;
- btnTitle.Y = Application.GetRealHeight(60);
- btnTitle.Text = Language.StringByID(R.MyInternationalizationString.uScence) + Language.StringByID(R.MyInternationalizationString.uList);
- bodyFrameLayout.AddChidren(btnTitle);
+ //娓呯┖bodyFrame
+ this.ClearBodyFrame();
- this.listView = new VerticalScrolViewLayout();
- this.listView.Y = btnTitle.Bottom;
- this.listView.Height = bodyFrameLayout.Height - btnTitle.Bottom;
- bodyFrameLayout.AddChidren(this.listView);
+ //瀹屾垚
+ var btnfinish = new BottomClickButton();
+ btnfinish.TextID = R.MyInternationalizationString.uFinish;
+ bodyFrameLayout.AddChidren(btnfinish);
+ btnfinish.ButtonClickEvent += (sender, e) =>
+ {
+ //淇濆瓨鍦烘櫙鍒板畨闃�
+ this.SaveSceneToSafety();
+ };
+
+ this.listView = new VerticalListControl(29);
+ listView.Y = Application.GetRealHeight(-6);
+ listView.Height = btnfinish.Y - ControlCommonResourse.BottomButtonAndListViewSpace + Application.GetRealHeight(6);
+ listView.BackgroundColor = UserCenterColor.Current.White;
+ bodyFrameLayout.AddChidren(listView);
new System.Threading.Thread(() =>
{
//鑾峰彇鏈湴瀹夐槻鐨勫満鏅�
- Dictionary<int, string> dicScene = Common.LocalSafeguard.Current.GetLocalSceneByZoneID(this.zoonID);
- foreach (var scene in this.listScene)
+ Dictionary<int, string> dicScene = HdlSafeguardLogic.Current.GetLocalSceneByZoneID(this.zoonID);
+ if (this.Parent == null)
{
- //濡傛灉瀹夐槻閲岄潰宸茬粡娣诲姞鏈夛紝鍒欎笉鍐嶆樉绀�
- if (dicScene.ContainsKey(scene.sceneUI.Id) == true)
- {
- continue;
- }
- Application.RunOnMainThread(() =>
- {
- //娣诲姞鍦烘櫙琛�
- this.AddSceneRowLayout(scene);
- });
+ return;
}
+ Application.RunOnMainThread(() =>
+ {
+ int count = listScene.Count - 1;
+ for (int i = 0; i < listScene.Count; i++)
+ {
+ //濡傛灉瀹夐槻閲岄潰宸茬粡娣诲姞鏈夛紝鍒欎笉鍐嶆樉绀�
+ if (dicScene.ContainsKey(listScene[i].sceneUI.Id) == true)
+ {
+ continue;
+ }
+ var row = new SceneSimpleSelectControl(listScene[i].sceneUI, listView.rowSpace / 2);
+ listView.AddChidren(row);
+ row.InitControl();
+ if (i != count)
+ {
+ //搴曠嚎
+ row.AddBottomLine();
+ }
+ }
+ if (listView.ChildrenCount > 0)
+ {
+ int realHeight = (listView.GetChildren(listView.ChildrenCount - 1).Height) * listView.ChildrenCount + Application.GetRealHeight(23);
+ if (realHeight < listView.Height)
+ {
+ //璋冩暣鐪熷疄楂樺害
+ listView.Height = realHeight;
+ }
+ }
+ });
})
{ IsBackground = true }.Start();
}
- /// <summary>
- /// 娣诲姞鍦烘櫙琛�
- /// </summary>
- /// <param name="i_Scene"></param>
- private void AddSceneRowLayout(Common.SceneRoomUI i_Scene)
- {
- var row = new SceneSelectRow(this.listView, i_Scene);
- }
+ #endregion
+
+ #region 鈻� 淇濆瓨鍦烘櫙___________________________
/// <summary>
/// 淇濆瓨鍦烘櫙鍒板畨闃�
@@ -110,14 +125,14 @@
{
break;
}
- var row = (SceneSelectRow)myView;
+ var row = (SceneSimpleSelectControl)myView;
if (row.IsSelected == false)
{
continue;
}
var actionObj = new Safeguard.AlarmActionObj();
actionObj.Type = 1;
- actionObj.ScenesId = row.sceneRoomUI.sceneUI.Id;
+ actionObj.ScenesId = row.Scene.Id;
listAction.Add(actionObj);
}
if (listAction.Count == 0)
@@ -134,7 +149,7 @@
this.ShowProgressBar();
//娣诲姞鎶ヨ鐩爣鍒板畨闃�
- bool success = await Common.LocalSafeguard.Current.AddAlarmTagetToSafety(this.zoonID, listAction);
+ bool success = await HdlSafeguardLogic.Current.AddAlarmTagetToSafety(this.zoonID, listAction);
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
@@ -142,12 +157,11 @@
{
Application.RunOnMainThread(() =>
{
- //鍒锋柊涓�瑙堢敾闈�
- this.LoadFormMethodByName("AlarmTargetSettionForm", "SetMiddleInfo");
//鍏抽棴鑷韩
this.CloseForm();
});
}
}
+ #endregion
}
}
--
Gitblit v1.8.0