| | |
| | | light.DeviceStatusReport = common.DeviceStatusReport; |
| | | light.OnOffStatus = light.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(light.OnOffStatus == 1); |
| | | row.IsSelected = light.OnOffStatus == 1; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | light.LastDateTime = DateTime.Now; |
| | | } |
| | |
| | | { |
| | | deviceUI.CommonDevice.IsOnline = 1; |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(true); |
| | | } |
| | | break; |
| | | |
| | |
| | | airSwitch.DeviceStatusReport = common.DeviceStatusReport; |
| | | airSwitch.OnOffStatus = airSwitch.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(airSwitch.OnOffStatus == 1); |
| | | row.IsSelected = airSwitch.OnOffStatus == 1; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | airSwitch.LastDateTime = DateTime.Now; |
| | | } |
| | |
| | | { |
| | | deviceUI.CommonDevice.IsOnline = 1; |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(true); |
| | | } |
| | | break; |
| | | case DeviceType.WindowCoveringDevice: |
| | |
| | | rollerShade.DeviceStatusReport = common.DeviceStatusReport; |
| | | rollerShade.WcdCurrentPositionLiftPercentage = common.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | row.SetStatuText($"{Language.StringByID(R.MyInternationalizationString.Current)} { deviceUI.GetDeviceStatu()}"); |
| | | row.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage != 0; |
| | | rollerShade.LastDateTime = DateTime.Now; |
| | | } |
| | | } |
| | |
| | | { |
| | | deviceUI.CommonDevice.IsOnline = 1; |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionForWinRow; |
| | | row.SetStatu(true); |
| | | } |
| | | break; |
| | | |
| | |
| | | } |
| | | } |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(ac.currentSystemMode != 0); |
| | | row.IsSelected = ac.currentSystemMode != 0; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(ac.currentSystemMode != 0); |
| | | row.IsSelected = ac.currentSystemMode != 0; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | } |
| | | |
| | |
| | | var ac = deviceUI.CommonDevice as ZigBee.Device.AC; |
| | | ac.IsOnline = 1; |
| | | ac.LastDateTime = DateTime.Now; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(true); |
| | | } |
| | | break; |
| | | case DeviceType.DimmableLight: |
| | |
| | | dimmableLight.DeviceStatusReport = common.DeviceStatusReport; |
| | | dimmableLight.OnOffStatus = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(dimmableLight.OnOffStatus == 1); |
| | | row.IsSelected = dimmableLight.OnOffStatus == 1; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | dimmableLight.LastDateTime = DateTime.Now; |
| | | } |
| | |
| | | dimmableLight.DeviceStatusReport = common.DeviceStatusReport; |
| | | dimmableLight.Level = dimmableLight.DeviceStatusReport.AttriBute[0].AttriButeData; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(dimmableLight.OnOffStatus == 1); |
| | | row.IsSelected = dimmableLight.OnOffStatus == 1; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | dimmableLight.LastDateTime = DateTime.Now; |
| | | } |
| | |
| | | { |
| | | deviceUI.CommonDevice.IsOnline = 1; |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(true); |
| | | } |
| | | break; |
| | | } |
| | |
| | | { |
| | | case DeviceType.OnOffOutput: |
| | | deviceUI.CommonDevice.IsOnline = common.IsOnline; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.SetStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | break; |
| | | |
| | | case DeviceType.AirSwitch: |
| | | deviceUI.CommonDevice.IsOnline = common.IsOnline; |
| | | var row1 = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row1.SetStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | break; |
| | | |
| | | case DeviceType.WindowCoveringDevice: |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | deviceUI.CommonDevice.IsOnline = common.IsOnline; |
| | | var row2 = rowLayout.GetChildren(0) as CategoryFunctionForWinRow; |
| | | row2.SetStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | break; |
| | | |
| | | case DeviceType.DimmableLight: |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | deviceUI.CommonDevice.IsOnline = common.IsOnline; |
| | | var row3 = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row3.SetStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | break; |
| | | |
| | | case DeviceType.Thermostat: |
| | | deviceUI.CommonDevice.LastDateTime = DateTime.Now; |
| | | deviceUI.CommonDevice.IsOnline = common.IsOnline; |
| | | var row5 = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row5.SetStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | System.Console.WriteLine($"分类设备状态-Error:{ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | | else if (typeTag == "IASInfoReport") |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | for (int i = 0; deviceListScrolView != null && i < deviceListScrolView.ChildrenCount; i++) |
| | | { |
| | | var rowLayout = deviceListScrolView.GetChildren(i) as RowLayout; |
| | | var deviceUI = rowLayout.Tag as DeviceUI; |
| | | if (deviceUI == null || deviceUI.CommonDevice == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr || deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint) |
| | | { |
| | | continue; |
| | | } |
| | | switch (deviceUI.CommonDevice.Type) |
| | | { |
| | | case DeviceType.IASZone: |
| | | //开关功能 |
| | | var ias = common as IASZone; |
| | | var iAS = deviceUI.CommonDevice as ZigBee.Device.IASZone; |
| | | iAS.iASInfo = ias.iASInfo; |
| | | var row = rowLayout.GetChildren(0) as CategoryFunctionRow; |
| | | row.IsSelected = iAS.iASInfo?.Alarm1 == 1; |
| | | row.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | iAS.LastDateTime = DateTime.Now; |
| | | break; |
| | | } |
| | | } |
| | |
| | | typeIdDic.Clear(); |
| | | foreach (var device in devList) |
| | | { |
| | | var info = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice> { device.CommonDevice }); |
| | | var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device.CommonDevice); |
| | | if (info.BeloneType == DeviceBeloneType.A干接点 || info.BeloneType == DeviceBeloneType.A中继器) |
| | | { |
| | | continue; |
| | |
| | | deviceListScrolView = new VerticalScrolViewLayout |
| | | { |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | Y = Application.GetRealHeight(35+275), |
| | | Y = Application.GetRealHeight(35+279), |
| | | Width = Application.GetRealWidth(1028), |
| | | Height = Application.GetRealHeight(939), |
| | | Height = Application.GetRealHeight(942), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | functionSceneBodyView.AddChidren(deviceListScrolView); |
| | |
| | | }; |
| | | string imgPath = string.Empty; |
| | | string imgSeletedPath = string.Empty; |
| | | Common.LocalDevice.Current.GetDeviceBeloneIcon(deviceType.Value, ref imgPath, ref imgSeletedPath); |
| | | Common.LocalDevice.Current.GetDeviceObjectIcon(deviceType.Value, ref imgPath, ref imgSeletedPath); |
| | | functionTypeIMG.Init(imgPath, imgSeletedPath); |
| | | functionTypeIMG.SetTitle(deviceType.Key); |
| | | typeRowLayout.AddChidren(functionTypeIMG); |
| | |
| | | { |
| | | if (e2) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.CommonDevice); |
| | | deviceListScrolView.RemoveViewByTag((delSender as Button).Tag); |
| | | sameTypeList.Remove(deviceUI); |
| | | if (sameTypeList.Count == 0) |
| | | if(curRoom.IsLove) |
| | | { |
| | | RefreshBodyView(); |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName); |
| | | deviceListScrolView.RemoveViewByTag((delSender as Button).Tag); |
| | | sameTypeList.Remove(deviceUI); |
| | | } |
| | | else |
| | | { |
| | | Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.CommonDevice); |
| | | deviceListScrolView.RemoveViewByTag((delSender as Button).Tag); |
| | | sameTypeList.Remove(deviceUI); |
| | | } |
| | | //if (sameTypeList.Count == 0) |
| | | //{ |
| | | // RefreshBodyView(); |
| | | //} |
| | | } |
| | | }; |
| | | }; |
| | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | deviceRow.SetOnLineStatu(light.IsOnline == 1); |
| | | //deviceRow.SetOnLineStatu(light.IsOnline == 1); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.SetStatu(light.OnOffStatus == 1); |
| | | deviceRow.IsSelected = light.OnOffStatus == 1; |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | | deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) => |
| | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | deviceRow.SetOnLineStatu(airSwitch.IsOnline == 1); |
| | | deviceRow.SetStatu(airSwitch.OnOffStatus == 1); |
| | | //deviceRow.SetOnLineStatu(airSwitch.IsOnline == 1); |
| | | deviceRow.IsSelected = airSwitch.OnOffStatus == 1; |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | |
| | | sendedControlCommand = false; |
| | | zbGateway.ReportAction += UpdateDeviceControllStatu; |
| | | AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice); |
| | | |
| | | (send2 as Button).IsSelected = !(send2 as Button).IsSelected; |
| | | deviceRow.IsSelected = (send2 as Button).IsSelected; |
| | | if ((send2 as Button).IsSelected) |
| | | { |
| | | airSwitch.SwitchControl(1); |
| | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | deviceRow.SetOnLineStatu(dimmableLight.IsOnline == 1); |
| | | //deviceRow.SetOnLineStatu(dimmableLight.IsOnline == 1); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.SetStatu(dimmableLight.OnOffStatus == 1); |
| | | deviceRow.IsSelected = dimmableLight.OnOffStatus == 1; |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | | deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) => |
| | |
| | | sendedControlCommand = false; |
| | | zbGateway.ReportAction += UpdateDeviceControllStatu; |
| | | AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice); |
| | | |
| | | (send2 as Button).IsSelected = !(send2 as Button).IsSelected; |
| | | deviceRow.IsSelected = (send2 as Button).IsSelected; |
| | | if ((send2 as Button).IsSelected) |
| | | { |
| | | dimmableLight.SwitchControl(1); |
| | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | deviceRow.SetOnLineStatu(ac.IsOnline == 1); |
| | | //deviceRow.SetOnLineStatu(ac.IsOnline == 1); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.SetStatu(ac.currentSystemMode != 1); |
| | | deviceRow.IsSelected = ac.currentSystemMode != 1; |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | | deviceRow.SwitchBtn.MouseUpEventHandler += (send2, e2) => |
| | |
| | | AddZbGateway(zbGatewayList, zbGateway, commonDeviceList, deviceUI.CommonDevice); |
| | | |
| | | (send2 as Button).IsSelected = !(send2 as Button).IsSelected; |
| | | deviceRow.IsSelected = (send2 as Button).IsSelected; |
| | | if ((send2 as Button).IsSelected) |
| | | { |
| | | ac.Open(); |
| | |
| | | var deviceRow = new CategoryFunctionForWinRow(0, 35); |
| | | deviceRow.Init(deviceUI); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | deviceRow.SetOnLineStatu(rollerShade.IsOnline == 1); |
| | | //deviceRow.SetOnLineStatu(rollerShade.IsOnline == 1); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.SetStatu(rollerShade.WcdCurrentPositionLiftPercentage != 0); |
| | | deviceRow.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage != 0; |
| | | deviceRow.SetRollerShadeIcon(rollerShade.WcdType); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | deviceRow.SetOnLineStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | //deviceRow.SetOnLineStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.HideSwitchBtn(true); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | |
| | | HomePage.Instance.PageIndex += 1; |
| | | userDoorLockPage.Show(); |
| | | }; |
| | | |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | | Tag = deviceUI |
| | | }; |
| | | var delBtn = new Device.CommonForm.RowLayoutDeleteButton() |
| | | { |
| | | Tag = deviceUI |
| | | }; |
| | | if (curRoom.IsSharedRoom == false) |
| | | { |
| | | deviceTypeRowLayout.AddRightView(editBtn); |
| | | editBtn.MouseUpEventHandler += deviceDetailHandler; |
| | | deviceTypeRowLayout.AddRightView(delBtn); |
| | | delBtn.MouseUpEventHandler += delEvent; |
| | | } |
| | | } |
| | | else if (deviceUI.CommonDevice.Type == DeviceType.IASZone) |
| | | { |
| | | var deviceTypeRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(129 + 35), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Tag = deviceUI |
| | | }; |
| | | deviceListScrolView.AddChidren(deviceTypeRowLayout); |
| | | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.IsSelected = (deviceUI.CommonDevice as IASZone).iASInfo?.Alarm1 == 1; |
| | | deviceRow.HideSwitchBtn(true); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | | |
| | | var editBtn = new CommonForm.RowLayoutEditButton() |
| | | { |
| | |
| | | var deviceRow = new CategoryFunctionRow(0, 35); |
| | | deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath); |
| | | deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName); |
| | | deviceRow.SetOnLineStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | //deviceRow.SetOnLineStatu(deviceUI.CommonDevice.IsOnline == 1); |
| | | deviceRow.SetStatuText(deviceUI.GetDeviceStatu()); |
| | | deviceRow.HideSwitchBtn(true); |
| | | deviceTypeRowLayout.AddChidren(deviceRow); |
| | |
| | | }; |
| | | functionSceneAutoBodyView.AddChidren(functionSceneBodyView); |
| | | |
| | | Button curBtn = new Button(); |
| | | RoomButton curBtn = new RoomButton(0,0); |
| | | foreach (var room in Common.Room.CurrentRoom.GetRoomsByCurrentFloorIdAppendLoveRoom()) |
| | | { |
| | | var row = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(187 + 50), |
| | | Width = Application.GetRealWidth(255), |
| | | Height = Application.GetRealHeight(167) |
| | | }; |
| | | roomFL.AddChidren(row); |
| | | |
| | | var roomBtn = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(187), |
| | | Height = Application.GetRealHeight(78), |
| | | Radius = (uint)Application.GetRealHeight(78 / 2), |
| | | Gravity = Gravity.Center, |
| | | Text = room.Name, |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | BackgroundColor = ZigbeeColor.Current.GXCButtonUnSelectedColor3, |
| | | SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor, |
| | | BorderColor = ZigbeeColor.Current.GXCBorderUnSelectedColor, |
| | | BorderWidth = 1 |
| | | }; |
| | | RoomButton roomBtn = new RoomButton(0, 0); |
| | | roomBtn.Gravity = Gravity.Center; |
| | | roomBtn.Init(); |
| | | roomBtn.SetTitle(room.Name); |
| | | row.AddChidren(roomBtn); |
| | | roomBtn.SetViewShadow(true,5); |
| | | |
| | | if (room.IsLove) |
| | | { |
| | | roomBtn.IsSelected = true; |
| | | this.curRoom = room; |
| | | curBtn = roomBtn; |
| | | |
| | | if(sceneBtn.IsSelected) |
| | | { |
| | | RefreshScene(room); |
| | |
| | | { |
| | | RefreshFunction(room); |
| | | } |
| | | |
| | | } |
| | | roomBtn.MouseUpEventHandler += (sender, e) => |
| | | roomBtn.ButtonClickEvent += (sender, e) => |
| | | { |
| | | if ((sender as Button) == curBtn) |
| | | if (sender == curBtn) |
| | | { |
| | | return; |
| | | } |
| | | (sender as Button).IsSelected = true; |
| | | sender.IsSelected = true; |
| | | curBtn.IsSelected = false; |
| | | curBtn = sender as Button; |
| | | curBtn = sender; |
| | | this.curRoom = room; |
| | | if (sceneBtn.IsSelected) |
| | | { |
| | |
| | | /// <param name="room"></param> |
| | | public void RefreshScene(Common.Room room) |
| | | { |
| | | RefreshData(room); |
| | | functionSceneBodyView.RemoveAll(); |
| | | var sceneList = room.SceneUIList; |
| | | if (sceneList.Count == 0) |
| | | { |
| | | ShowNoSceneTip(); |
| | |
| | | /// </summary> |
| | | private void ShowAutotion() |
| | | {
|
| | |
|
| | | functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
|
| | | // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
|
| | | |
| | | var bjFrameLayout = new FrameLayout |
| | | { |
| | |
| | | var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout |
| | | { |
| | | Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | //BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,/ |
| | | X = Application.GetRealWidth(58), |
| | | //Radius = (uint)Application.GetRealHeight(50), |
| | | Y = scenehorizontalScrol.Bottom, |
| | | }; |
| | | functionSceneAutoBodyView.AddChidren(logicScrolView); |
| | | logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | |
| | | bool no = false; |
| | | recommendswitchBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | int Yheight = 0; |
| | |
| | | scenehorizontalScrol.RemoveAll(); |
| | | if (recommendswitchBtn.IsSelected) |
| | | { |
| | | no = true; |
| | | scenehorizontalScrol.Height = Application.GetRealHeight(246); |
| | | Yheight = 20; |
| | | for (int i = 1; i < 4; i++) |
| | |
| | | } |
| | | else |
| | | { |
| | | no = false; |
| | | scenehorizontalScrol.Height = Application.GetRealHeight(0); |
| | | Yheight = 0; |
| | | } |
| | | logicScrolView.Y = scenehorizontalScrol.Bottom + Yheight; |
| | | logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight; |
| | | Automationview(logicScrolView); |
| | | Automationview(logicScrolView,no); |
| | | }; |
| | | logicScrolView.BeginHeaderRefreshingAction += () => |
| | | { |
| | | //重新刷新logic列表 |
| | | Common.Logic.LogicList.Clear(); |
| | | Read(logicScrolView); |
| | | Read(logicScrolView,no); |
| | | //关闭刷新View; |
| | | logicScrolView.EndHeaderRefreshing(); |
| | | }; |
| | | |
| | | Read(logicScrolView); |
| | | Read(logicScrolView,no); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 读取自动化列表数据; |
| | | /// </summary> |
| | | /// <param name="logicScrolView"></param> |
| | | private async void Read(VerticalRefreshLayout logicScrolView) |
| | | private async void Read(VerticalRefreshLayout logicScrolView,bool no) |
| | | { |
| | | CommonPage.Loading.Start(); |
| | | if (Common.Logic.LogicList.Count == 0) |
| | |
| | | } |
| | | } |
| | | //自动化 |
| | | Automationview(logicScrolView); |
| | | Automationview(logicScrolView,no); |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 加载自动化列表界面 |
| | | /// </summary> |
| | | /// <param name="refresview">Refresview.</param> |
| | | private async void Automationview(VerticalRefreshLayout refresview) |
| | | private async void Automationview(VerticalRefreshLayout refresview,bool no) |
| | | { |
| | | refresview.RemoveAll(); |
| | | if (Common.Logic.LogicList.Count == 0&&no==false) |
| | | { |
| | | //就是为了显示引导添加图标; |
| | | refresview.BackgroundColor = 0x00000000; |
| | | var noFrameLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(434+ 200+32+160), |
| | | //BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | refresview.AddChidren(noFrameLayout); |
| | | |
| | | |
| | | var noIconBtn = new Button |
| | | { |
| | | Y=Application.GetRealHeight(160), |
| | | Width = Application.GetMinRealAverage(756), |
| | | Height = Application.GetMinRealAverage(434), |
| | | UnSelectedImagePath = "Item/NoFunction.png", |
| | | X = Application.GetRealWidth(104), |
| | | }; |
| | | noFrameLayout.AddChidren(noIconBtn); |
| | | |
| | | var noTextBtn = new Button() |
| | | { |
| | | Y = noIconBtn.Bottom, |
| | | Height = Application.GetRealHeight(200)+Application.GetRealHeight(32), |
| | | Width = Application.GetRealWidth(700), |
| | | //Gravity = Gravity.CenterHorizontal, |
| | | Text = Language.StringByID(MyInternationalizationString.automationaddtext).Replace("{\\r\\n}", "\r\n"), |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsMoreLines = true, |
| | | X = Application.GetRealWidth(190-58), |
| | | }; |
| | | noFrameLayout.AddChidren(noTextBtn); |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | if (Common.Logic.LogicList.Count == 0 && no == true) |
| | | { |
| | | ///改变滑动view的颜色; |
| | | refresview.BackgroundColor = 0x00000000; |
| | | } |
| | | else |
| | | { |
| | | refresview.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; |
| | | } |
| | | } |
| | | foreach (var logic in Common.Logic.LogicList) |
| | | { |
| | | |
| | |
| | | var logicCommunalPage = new Logic.LogicCommunalPage(); |
| | | HomePage.Instance.AddChidren(logicCommunalPage); |
| | | HomePage.Instance.PageIndex += 1; |
| | | logicCommunalPage.Show(() => { logicnameBtn.Text = logic.LogicName; Automationview(refresview); }); |
| | | logicCommunalPage.Show(() => { logicnameBtn.Text = logic.LogicName; Automationview(refresview,no); }); |
| | | |
| | | }; |
| | | |
| | |
| | | if (e1) |
| | | { |
| | | Common.Logic.LogicList.Remove(logic); |
| | | Automationview(refresview); |
| | | Automationview(refresview,no); |
| | | Logic.Send.DelLogic(logic.LogicId); |
| | | } |
| | | }; |