From 38ca58ae790dc71e50070b54345455988a4a64a3 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 27 八月 2021 11:24:52 +0800
Subject: [PATCH] 2021-8-27-01
---
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs | 135 +++++---------------------------------------
1 files changed, 17 insertions(+), 118 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs
index 484c1fa..fea62b3 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs
@@ -24,7 +24,7 @@
this.AddChidren(topView.FLayoutView());
topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
{
-
+
this.RemoveFromParent();
};
@@ -56,7 +56,7 @@
FrameLayout frameLayout = new FrameLayout
{
Y = Application.GetRealHeight(64 + 84),
- Height = Application.GetRealHeight(667 - 64 - 84),
+ Height = Application.GetRealHeight(667 - 64 - 84-104),
Width = Application.GetRealWidth(TextSize.view375),
};
this.AddChidren(frameLayout);
@@ -71,7 +71,7 @@
};
this.AddChidren(saveLayout);
saveLayout.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
-
+ //鏆傛椂闅愯棌鎺掑簭鍔熻兘
Button paixuBtn = new Button
{
Width = Application.GetRealWidth(375 - 16 * 2),
@@ -82,7 +82,7 @@
TextSize = TextSize.text14,
TextColor = CSS.CSS_Color.textTipColor,
};
- saveLayout.AddChidren(paixuBtn);
+ //saveLayout.AddChidren(paixuBtn);
Button saveBtn = new Button
{
@@ -140,20 +140,13 @@
//淇濆瓨鐐瑰嚮浜嬩欢
saveBtn.MouseUpEventHandler += (sender, e) =>
{
- //绉婚櫎褰撳墠鐣岄潰
+ //绉婚櫎褰撳墠鐣岄潰
this.RemoveFromParent();
//鍙兘涔嬪墠宸茬粡瀛樺湪璇ョ晫闈�
- for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--)
- {
- var view = MainPage.BasePageView.GetChildren(i);
- if (view.GetType() == typeof(AddControlComplete))
- {
- view.RemoveFromParent();
- }
- }
+ PirMethod.RemoveView("AddControlComplete");
AddControlComplete addControlComplete = new AddControlComplete();
MainPage.BasePageView.AddChidren(addControlComplete);
- addControlComplete.Show(control,false);
+ addControlComplete.Show(control, false);
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
};
#endregion
@@ -166,113 +159,19 @@
void RefreshView(VerticalScrolViewLayout vv, bool if_bool, Control control)
{
vv.RemoveAll();
- //瀹氫箟涓�涓彉閲忚褰曡鏁�
- int sum = 0;
- if (control.status.Count % 3 == 0)
+ View.Buttons buttons = new View.Buttons();
+ buttons.AddButton2(vv, control.status, (obj) =>
{
- sum = control.status.Count / 3;
- }
- else
- {
- sum = control.status.Count / 3 + 1;
- }
- //璁$畻鍔犺浇鍑烘潵鐨勬暟鎹渶瑕佺殑楂樺害
- int h = 16 + sum * (16 + 44) + 104 + 76;
- int line = 0;
- //鎸夐挳鐨勭埗鎺т欢
- var FLayout = new FrameLayout
- {
- Height = Application.GetRealWidth(h),
- };
- vv.AddChidren(FLayout);
- for (int i = 1, j = 0; i <= control.status.Count; i++, j++)
- {
- var nameObj = control.status[i - 1];
- //鎸夐挳
- var buttonNameBtn = new Button
+ PirMethod.ThreadSend(control, (responsePackNew) =>
{
-
- Y = Application.GetRealHeight(16 + line * (16 + 44)),
- X = Application.GetRealWidth(16 + (16 + 104) * j),
- Width = Application.GetRealWidth(104),
- Height = Application.GetRealHeight(44),
- Text = nameObj.value,
- TextSize = TextSize.text16,
- TextColor = CSS.CSS_Color.textColor,
- TextAlignment = TextAlignment.Center,
- Radius = (uint)Application.GetRealHeight(18),
- BorderWidth = 1,
- BorderColor = CSS.CSS_Color.textCancelColor,
- };
- FLayout.AddChidren(buttonNameBtn);
- //鍒犻櫎鍥炬爣
- var delIconBtn = new Button
- {
- UnSelectedImagePath = "PirIcon/delbuton.png",
- Y = Application.GetRealHeight(12 + line * (16 + 44)),
- X = Application.GetRealWidth((16 + 92) + (104 + 16) * j),
- Width = Application.GetRealWidth(16),
- Height = Application.GetRealWidth(16),
- Tag = nameObj,
- };
- if (if_bool)
- {
- FLayout.AddChidren(delIconBtn);
- }
- //鍒犻櫎鍥炬爣鐨勭偣鍑讳簨浠�
- delIconBtn.MouseUpEventHandler += (sender, e) =>
- {
- var obj = delIconBtn.Tag as Entity.AttributesStatus;
- //鍔犺浇log
- Loading loading = new Loading();
- this.AddChidren(loading);
- HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
- loading.Start();
- new System.Threading.Thread(() =>
+ var buttonObj = control.status.Find((c) => c.value == obj.value);
+ if (buttonObj != null)
{
- try
- {
- //鍙戦�佹寜閿垹闄わ紱
- responsePackNew = PirSend.CodeRemove(obj, control.deviceId);
- }
- catch { }
- finally
- {
- Application.RunOnMainThread(() =>
- {
- loading.Hide();
- if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
- {
- ///杩欓噷锛氱洃鍚琈TTP鎺ㄩ�佷笅鏉ヤ富棰橈紝鎵嶇煡閬撴槸鍚︽坊鍔犳垚鍔�
- var buttonObj = control.status.Find((c) => c.value == obj.value);
- if (buttonObj != null)
- {
- control.status.Remove(buttonObj);
- }
- RefreshView(vv, true, control);
- }
- else {
- Method method = new Method();
- method.ErrorShow(responsePackNew,"");
- }
-
- });
- }
-
- })
- { IsBackground = true }.Start();
-
-
- };
- if (i % 3 == 0)
- {
- //婊′竴琛岄噸缃甹=0鍊�;
- j = -1;
- line += 1;
- }
-
- }
-
+ control.status.Remove(buttonObj);
+ }
+ RefreshView(vv, true, control);
+ }, "鍒犻櫎鎸夐敭", "fram", this, null, obj);
+ }, if_bool);
}
}
}
--
Gitblit v1.8.0