| | |
| | | /// </summary> |
| | | public static void MainShow() |
| | | { |
| | | |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | //获取自动化列表 |
| | | GetLogicList(); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | |
| | | automationPage.RemoveAll(); |
| | | VerticalRefreshLayout vv = new VerticalRefreshLayout(); |
| | | vv.Height = Application.GetRealHeight(667 - 64 - 49);//模拟高度 |
| | | automationPage.AddChidren(vv); |
| | | vv.BeginHeaderRefreshingAction += () => |
| | | { |
| | | //清除之前自动化列表; |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | //强制更新自动化列表; |
| | | Logic.LogicList.Clear(); |
| | | //获取自动列表 |
| | | //获取自动化列表 |
| | | GetLogicList(); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //刷新自动化界面 |
| | | MainShow(); |
| | | //关闭刷新View; |
| | | vv.EndHeaderRefreshing(); |
| | | |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | |
| | | |
| | | }; |
| | | //获取自动化列表 |
| | | GetLogicList(); |
| | | |
| | | for (int i = Logic.LogicList.Count - 1; i >= 0; i--)//降序排列 |
| | | //for (int i = 0; i < Logic.LogicList.Count; i++) |
| | | { |
| | | var currLogic = Logic.LogicList[i]; |
| | | ///上下间隔12像素 |
| | |
| | | |
| | | GetSelectIcon(logicView.frameLayout, currLogic); |
| | | if (i == 0)//降序排列 |
| | | //if (Logic.LogicList.Count - 1 == i) |
| | | { |
| | | ///最后一个距离最底部12,界面显示效果作用; |
| | | vv.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12) }); |
| | | vv.AddChidren(new FrameLayout { Height = Application.GetRealHeight(20) }); |
| | | } |
| | | if (currLogic.enable == "true") |
| | | { |
| | |
| | | }; |
| | | automationPage.AddChidren(btnTipNotText); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 按+跳转到逻辑界面的方法 |
| | |
| | | //自动化列表为0才去获取自动化列表; |
| | | return; |
| | | } |
| | | List<string> logicIdList = new List<string>(); |
| | | var logicIdList = new List<string>(); |
| | | //获取逻辑ID列表 |
| | | var idStr = Send.Current.GetLogicIdList(); |
| | | if (idStr != null) |
| | | var dateList = Send.Current.GetLogicIdList(); |
| | | if (dateList != null) |
| | | { |
| | | var date = Newtonsoft.Json.JsonConvert.SerializeObject(idStr.Data); |
| | | var dateList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<LogicData>>(date); |
| | | for (int i = 0; i < dateList.Count; i++) |
| | | { |
| | | //添加逻辑ID |
| | |
| | | } |
| | | } |
| | | //获取自动化列表 |
| | | var logicListStr = Send.Current.GetLogic(logicIdList); |
| | | if (logicListStr != null) |
| | | var logicList = Send.Current.GetLogic(logicIdList); |
| | | if (logicList != null) |
| | | { |
| | | var logicList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Logic>>(logicListStr.Data.ToString()); |
| | | for (int j = 0; j < logicList.Count; j++) |
| | | { |
| | | var logic = logicList[j]; |
| | | if (logic != null) |
| | | { |
| | | //查找是否已经存在该逻辑 |
| | | //去重 |
| | | var if_logic = Logic.LogicList.Find((c) => c.userLogicId == logic.userLogicId); |
| | | if (if_logic == null) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | class LogicData |
| | | public class LogicIdData |
| | | { |
| | | /// <summary> |
| | | /// 云端唯一id |