HDL-ON_Android/Application.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
HDL-ON_Android/Resources/Resource.designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs | 补丁 | 查看 | 原始文档 | blame | 历史 | |
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
HDL-ON_Android/Application.cs
@@ -33,7 +33,6 @@ public override void OnCreate() { //注册未处理异常事件 Com.Chteam.Agent.BuglyAgentHelper.Init(this.ApplicationContext, "cb89f20750"); if (Shared.Application.Activity != null) { @@ -47,6 +46,7 @@ initAll(); } /// <summary> /// 所有初始化全部在这个方法实现 /// </summary> @@ -60,7 +60,8 @@ //隐藏虚拟按键 BaseActivity.IsHideVirualButtons = true; //实现安卓返回按键 BaseActivity.BackKeyAction = () => { BaseActivity.BackKeyAction = () => { try { var result = MainPage.LoadEvent_BackAction(); @@ -173,6 +174,7 @@ /// <param name="activity"></param> void GetJPushRegistrationID(BaseActivity activity) { try { //保存获取的极光服务器上的注册ID到本地文件 HDL-ON_Android/Resources/Resource.designer.cs
Diff too large HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs
@@ -159,7 +159,7 @@ var view = MainPage.BasePageView.GetChildren(i); if (view.GetType() == typeof(AddControl)) { new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai)); //new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiachenggong)); view.RemoveFromParent(); } HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs
@@ -154,11 +154,13 @@ if (bool_library) { this.RemoveFromParent(); RefreshView(); } else { Method method = new Method(); method.AddControl(this, (controlDevice) => { method.AddControl(this, (controlDevice) => { AddButton addButton = new AddButton(); MainPage.BasePageView.AddChidren(addButton); addButton.Show(controlDevice); @@ -171,6 +173,17 @@ { //移除所有界面 MainPage.BasePageView.RemoveViewByTag("PirView"); RefreshView(); }; #endregion } /// <summary> /// 刷新红外宝主界面 /// </summary> void RefreshView() { //移除红外宝根界面 MainPage.BasePageView.RemoveViewByTag("PirMain"); //重新加载界面 @@ -178,9 +191,6 @@ MainPage.BasePageView.AddChidren(page); page.Show(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; #endregion } } } HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
@@ -108,7 +108,7 @@ X = Application.GetRealWidth(136), Width = Application.GetRealWidth(104), Height = Application.GetRealHeight(17), Text = "(1/20)", Text = $"(1/{libraryList.Count})", TextSize = TextSize.text12, TextColor = CSS.CSS_Color.textCancelColor, }; @@ -160,7 +160,7 @@ { if (index>1) { index--; sumBtn.Text = "(" + index.ToString() + "/20)"; sumBtn.Text = $"({index.ToString()}/{libraryList.Count})"; } code = 1; GetBtnText(testBtn, code, spk); @@ -168,10 +168,10 @@ //右 rightIconBtn.MouseUpEventHandler += (sender, e) => { if (index < 20) if (index < libraryList.Count) { index++; sumBtn.Text = "(" + index.ToString() + "/20)"; sumBtn.Text = $"({index.ToString()}/{libraryList.Count})"; } code = 1; GetBtnText(testBtn, code, spk); @@ -192,12 +192,12 @@ //控制失败 failedBtn.MouseUpEventHandler += (sender, e) => { if (index < 20) if (index < libraryList.Count) { //先加 index++; //更新文本 sumBtn.Text = "(" + index.ToString() + "/20)"; sumBtn.Text = $"({index.ToString()}/{libraryList.Count})"; } code = 1; //更新状态 @@ -214,7 +214,7 @@ GetBtnText(testBtn, code, spk); if (if_bool) { var library = libraryList[index]; var library = libraryList[index-1]; var control = GetControl(spk, testBtn.TextID, library); Method method = new Method(); //发送库添加遥控器命令 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs
@@ -9,12 +9,13 @@ public class Method { /// <summary> /// 程序主入口 /// 红外宝程序主入口 /// </summary> /// <param name="frame"></param> /// <param name="function"></param> public void MainView(FrameLayout frame, Entity.Function function,Action action) { Pir pirDevice = new Pir(); if (function != null) {//数据转换 @@ -32,7 +33,8 @@ MainPage.BasePageView.AddChidren(page); page.Show(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; page.BackAction += () => { PirMain.BackAction += () => { action?.Invoke(); }; }); @@ -212,24 +214,9 @@ if (pirJosn != null) { /* 项目“HDL-ON_iOS”的未合并的更改 在此之前: if (null == Pir.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId)) 在此之后: if (null == list.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId)) */ if (null == PirDevice.Pir.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId)) { /* 项目“HDL-ON_iOS”的未合并的更改 在此之前: Pir.pirDeviceList.Add(pirJosn); 在此之后: list.pirDeviceList.Add(pirJosn); */ PirDevice.Pir.pirDeviceList.Add(pirJosn); } } } @@ -286,7 +273,7 @@ var pirDevice = Pir.pirDeviceList[i]; try { var responsePackNew = PirSend.ControlList(pirDevice); var responsePackNew = PirSend.ControlList(pirDevice.deviceId); if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") { var jArray = JArray.Parse(responsePackNew.Data.ToString()); @@ -333,18 +320,7 @@ /// <param name="action">回调函数</param> public static void GetControlList(FrameLayout frame ,Action action, Pir pirDevice) { Loading loading = new Loading(); frame.AddChidren(loading); loading.Start(); new System.Threading.Thread(() => { try { try { var responsePackNew = PirSend.ControlList(pirDevice); if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") ThreadSend(new Control { deviceId = pirDevice.deviceId }, (responsePackNew) => { var jArray = JArray.Parse(responsePackNew.Data.ToString()); for (int a = 0; a < jArray.Count; a++) @@ -355,33 +331,14 @@ var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(str); if (pirJosn != null) { if (null == pirDevice.FunctioList.Find((c) => c.sid == pirJosn.sid)) if (null == pirDevice.FunctioList.Find((c) => c.deviceId == pirJosn.deviceId)) { pirDevice.FunctioList.Add(pirJosn); } } } } } catch { } } catch { } finally { Application.RunOnMainThread(() => { loading.Hide(); action(); }); } }) { IsBackground = true }.Start(); }, "获取遥控器列表", "frame", frame, null); } /// <summary> @@ -392,37 +349,12 @@ /// <param name="action">回调函数</param> public void GetControl(FrameLayout frame, Control control, Action<Entity.Function> action) { Entity.Function function = null; //加载log Loading loading = new Loading(); frame.AddChidren(loading); loading.Start(); new System.Threading.Thread(() => ThreadSend(control, (responsePackNew) => { try { // 获取设备详情通过(spk,sid) var responsePackNew = PirSend.GetinfoBySid(control); if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") { //var str = Newtonsoft.Json.JsonConvert.SerializeObject(responsePackNew.Data.ToString()); function = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(responsePackNew.Data.ToString()); } } catch { } finally { Application.RunOnMainThread(() => { loading.Hide(); var function = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(responsePackNew.Data.ToString()); action(function); }); }, "获取设备详情", "frame", frame, null); } }) { IsBackground = true }.Start(); } /// <summary> /// 发送命令线程 /// </summary> @@ -460,8 +392,18 @@ responsePackNew = PirSend.DeviceRename(control.deviceId, control.name); } else if (str == "删除按键") { else if (str == "删除按键") { // responsePackNew = PirSend.CodeRemove(control.deviceId, control.name); } else if (str == "获取设备详情") { // 获取设备详情通过(spk,sid) responsePackNew = PirSend.GetinfoBySid(control); } else if (str == "获取遥控器列表") { responsePackNew = PirSend.ControlList(control.deviceId); } } catch { } @@ -519,7 +461,7 @@ str = buttondata; } if (!string.IsNullOrEmpty(controldata)) if (!string.IsNullOrEmpty(str)) { try { HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
@@ -14,7 +14,11 @@ /// <summary> /// 回调 /// </summary> public Action BackAction; public static Action BackAction; /// <summary> /// /// </summary> Button addDevice; /// <summary> /// 临时储存设备类型列表 /// </summary> @@ -26,9 +30,12 @@ topView.topNameBtn.TextID = StringId.hongwaiyaokong; topView.topIconBtn.Visible = true; this.AddChidren(topView.FLayoutView()); topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { BackAction(); this.RemoveFromParent(); }; BackAction = null; this.RemoveFromParent(); }; FrameLayout middFLayout = new FrameLayout(); middFLayout.Y = Application.GetRealHeight(64); @@ -38,19 +45,22 @@ VerticalRefreshLayout vv = new VerticalRefreshLayout(); middFLayout.AddChidren(vv); //加号图标 Button addDevice = new Button addDevice = new Button { Y = Application.GetRealHeight(480), X = Application.GetRealWidth(293), Width = Application.GetRealWidth(82), Height = Application.GetRealWidth(84), UnSelectedImagePath = "PirIcon/add.png", }; Visible=false, }; middFLayout.AddChidren(addDevice); if (Pir.currPir.FunctioList.Count < 10) { //10个遥控器就会隐藏添加图标 middFLayout.AddChidren(addDevice); // middFLayout.AddChidren(addDevice); addDevice.Visible = true; } vv.BeginHeaderRefreshingAction += () => @@ -77,7 +87,7 @@ MainPage.BasePageView.AddChidren(setPir); setPir.Show(() => { BackAction(); //BackAction(); ////刷新界面 UIView(vv); }); @@ -267,7 +277,12 @@ Pir.currPir.FunctioList.Remove(Function); } UIView(vv); if (Pir.currPir.FunctioList.Count < 10) { //10个遥控器就会隐藏添加图标 // middFLayout.AddChidren(addDevice); addDevice.Visible = true; } }, "删除", "dialog", null, dialog); }, () => { }, false); HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs
@@ -79,9 +79,9 @@ /// <summary> /// 获取遥控器列表 /// </summary> public static ResponsePackNew ControlList(Pir pir) public static ResponsePackNew ControlList(string deviceId) { var jObject = new JObject { { "homeId", HomeId }, { "deviceId", pir.deviceId } }; var jObject = new JObject { { "homeId", HomeId }, { "deviceId", deviceId} }; var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_List); return responsePackNew; }