From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3
---
ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDeviceChange.cs | 86 ++++++++++++++++++++++++++++---------------
1 files changed, 56 insertions(+), 30 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDeviceChange.cs b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDeviceChange.cs
index e9168d3..58014c3 100755
--- a/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDeviceChange.cs
+++ b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDeviceChange.cs
@@ -30,7 +30,12 @@
/// </summary>
private FrameLayout TipLayout = null;
- private List<string> TabList = new List<string>() { Language.StringByID(R.MyInternationalizationString.uLight), Language.StringByID(R.MyInternationalizationString.uDeviceBelongId100) };
+ private List<string> TabList = new List<string>()
+ {
+ Language.StringByID(R.MyInternationalizationString.uLight),
+ Language.StringByID(R.MyInternationalizationString.uDeviceBelongId100),
+ Language.StringByID(R.MyInternationalizationString.AC)
+ };
private int CurrentSelectIndex = 0;
private int imageWith = 683;
@@ -174,8 +179,9 @@
Button button = new Button();
tab_layout.AddChidren(button);
button.Width = Application.GetRealWidth(250);
+ button.Height= Application.GetRealWidth(250);
button.Text = TabList[i];
- button.X = ControlCommonResourse.XXLeft / 2 + i * button.Width;
+ button.X = HdlControlResourse.XXLeft / 2 + i * button.Width;
button.AddTag("Index", i);
Buttons.Add(button);
@@ -251,6 +257,23 @@
}
}
break;
+ case 2: // 绌鸿皟
+ {
+ int n = 0;
+ for (int i = 0; i < CurrentRoom.DeviceList.Count; i++)
+ {
+ SmartSound.Device device = CurrentRoom.DeviceList[i];
+ //
+ if (device.DeviceType == 7)
+ {
+ var deviceRowLayout = new DeviceRowLayout(this, device, n);
+ DeviceListView.AddChidren(deviceRowLayout);
+ deviceRowLayout.InitControl();
+ n++;
+ }
+ }
+ }
+ break;
}
if (DeviceListView.ChildrenCount > 5)
@@ -285,9 +308,9 @@
//鐢熸垚涓�涓脊绐楃敾闈�
var dialogForm = new DialogInputControl();
//缂栬緫浣忓畢
- dialogForm.SetTitleText("鑷畾涔夊敜閱掕瘝");
+ dialogForm.SetTitleText("鑷畾涔夋樀绉�");
//璇疯緭鍏ヤ綇瀹呭悕绉�
- dialogForm.SetTipText("璇疯緭鍏ュ敜閱掕瘝");
+ dialogForm.SetTipText("璇疯緭鍏ユ樀绉�");
dialogForm.Text = scene.NicksName;
//鎸変笅纭鎸夐挳
@@ -316,9 +339,9 @@
//鐢熸垚涓�涓脊绐楃敾闈�
var dialogForm = new DialogInputControl();
//缂栬緫浣忓畢
- dialogForm.SetTitleText("鑷畾涔夊敜閱掕瘝");
+ dialogForm.SetTitleText("鑷畾涔夋樀绉�");
//璇疯緭鍏ヤ綇瀹呭悕绉�
- dialogForm.SetTipText("璇疯緭鍏ュ敜閱掕瘝");
+ dialogForm.SetTipText("璇疯緭鍏ユ樀绉�");
dialogForm.Text = device.NicksName;
//鎸変笅纭鎸夐挳
@@ -344,20 +367,22 @@
/// </summary>
private void ShowSceneDelectDialog(SmartSound.Scene scene)
{
- this.ShowMassage(ShowMsgType.Confirm, "纭鍒犻櫎璇ユ帶鍒跺唴瀹癸紵", async () =>
- {
- try
+ this.ShowMassage(ShowMsgType.Confirm, "纭鍒犻櫎璇ユ帶鍒跺唴瀹癸紵", () =>
+ {
+ HdlThreadLogic.Current.RunThread(async () =>
{
+ this.ShowProgressBar();
CurrentRoom.SceneList.Remove(scene);
- LoadSceneView();
string json = await postBatchEdit();
- }
- catch (Exception e)
- {
- string sss = e.Message;
- }
- }, Language.StringByID(R.MyInternationalizationString.OkMsg));
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ LoadSceneView();
+ this.CloseProgressBar();
+ });
+ });
+
+ }, Language.StringByID(R.MyInternationalizationString.OkMsg));
}
/// <summary>
@@ -365,20 +390,21 @@
/// </summary>
private void ShowDeviceDelectDialog(SmartSound.Device device)
{
- this.ShowMassage(ShowMsgType.Confirm, "纭鍒犻櫎璇ユ帶鍒跺唴瀹癸紵", async () =>
+ this.ShowMassage(ShowMsgType.Confirm, "纭鍒犻櫎璇ユ帶鍒跺唴瀹癸紵", () =>
{
- try
- {
- //DeviceListView.RemoveAt(index);
- CurrentRoom.DeviceList.Remove(device);
- RefreshFunctionListView();
- string json = await postBatchEdit();
- }
- catch (Exception e)
+ HdlThreadLogic.Current.RunThread(async () =>
{
- string sss = e.Message;
- }
+ this.ShowProgressBar();
+ CurrentRoom.DeviceList.Remove(device);
+ string json = await postBatchEdit();
+
+ HdlThreadLogic.Current.RunMainInThread(() =>
+ {
+ RefreshFunctionListView();
+ this.CloseProgressBar();
+ });
+ });
}, Language.StringByID(R.MyInternationalizationString.OkMsg));
}
@@ -446,7 +472,7 @@
// 鎻愪氦鏁版嵁鑷虫湇鍔″櫒
string url = "https://developer.hdlcontrol.com/zigbeespeakerservice/BatchEdit";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(SmartSound.getInstantiate());
- string response_str = await MyHttpWebResponse.PostWebRequest(url, json, Encoding.UTF8);
+ string response_str = MyHttpWebResponse.PostWebRequest(url, json, Encoding.UTF8);
return response_str;
}
@@ -489,7 +515,7 @@
btnCaption = frameTable.AddLeftCaption(remark, 2000);
var nicknameIcon = frameTable.AddRightArrow();//58
- nicknameIcon.TextSize = 17;
+ nicknameIcon.TextSize = 14;
nicknameIcon.SelectedImagePath = "SmartSound/Nickname.png";
nicknameIcon.UnSelectedImagePath = "SmartSound/Nickname.png";
@@ -555,7 +581,7 @@
btnCaption = frameTable.AddLeftCaption(remark, 2000);
var nicknameIcon = frameTable.AddRightArrow();//58
- nicknameIcon.TextSize = 17;
+ nicknameIcon.TextSize = 14;
nicknameIcon.SelectedImagePath = "SmartSound/Nickname.png";
nicknameIcon.UnSelectedImagePath = "SmartSound/Nickname.png";
--
Gitblit v1.8.0