| | |
| | | /// <summary> |
| | | /// low_High |
| | | /// </summary> |
| | | private const int low_High= 127; |
| | | private const int low_High = 127; |
| | | /// <summary> |
| | | /// 功能 |
| | | /// </summary> |
| | |
| | | { |
| | | foreach (var floor in Config.Instance.Home.FloorDics) |
| | | { |
| | | Config.Instance.Home.CurrentFloorId=floor.Key; |
| | | Config.Instance.Home.CurrentFloorId = floor.Key; |
| | | break; |
| | | } |
| | | } |
| | |
| | | /// <param name="selectedBtn">选中那个界面 0--功能 1--场景 2--自动化 </param> |
| | | public void Show(int selectedBtn = 1) |
| | | { |
| | | |
| | | |
| | | ZbGateway.StatusList.Add(this); |
| | | RemoveAll(); |
| | | |
| | |
| | | |
| | | var roomFL = new HorizontalScrolViewLayout() |
| | | { |
| | | X= Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | Y = functionSceneAutoBG.Bottom, |
| | | Height = Application.GetRealHeight(167), |
| | | Width=Application.GetRealWidth(CommonPage.AppRealWidth-CommonFormResouce.X_Left), |
| | | Width = Application.GetRealWidth(CommonPage.AppRealWidth - CommonFormResouce.X_Left), |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor |
| | | }; |
| | | midFL.AddChidren(roomFL); |
| | | |
| | | Button curBtn = new Button(); |
| | | for(int i=0;i<Config.Instance.Home.RoomFilePathList.Count;i++) |
| | | for (int i = 0; i < Config.Instance.Home.RoomFilePathList.Count; i++) |
| | | { |
| | | var roomFilePath = Config.Instance.Home.RoomFilePathList[i]; |
| | | var room = Shared.Common.Room.GetRoomByFilePath(roomFilePath); |
| | |
| | | } |
| | | var row = new RowLayout() |
| | | { |
| | | Width = Application.GetRealWidth(187+50), |
| | | Width = Application.GetRealWidth(187 + 50), |
| | | Height = Application.GetRealHeight(167), |
| | | LineColor= ZigbeeColor.Current.GXCGrayBackgroundColor |
| | | LineColor = ZigbeeColor.Current.GXCGrayBackgroundColor |
| | | }; |
| | | roomFL.AddChidren(row); |
| | | |
| | |
| | | { |
| | | Width = Application.GetRealWidth(187), |
| | | Height = Application.GetRealHeight(78), |
| | | Radius=(uint)Application.GetRealHeight(78/2), |
| | | 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 |
| | | 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 |
| | | }; |
| | | row.AddChidren(roomBtn); |
| | | if (Shared.Common.Room.CurrentRoom==null) { |
| | | if (Shared.Common.Room.CurrentRoom == null) |
| | | { |
| | | continue; |
| | | } |
| | | if(Shared.Common.Room.CurrentRoom.FileName==roomFilePath) |
| | | if (Shared.Common.Room.CurrentRoom.FileName == roomFilePath) |
| | | { |
| | | roomBtn.IsSelected = true; |
| | | curBtn = roomBtn; |
| | |
| | | Shared.Common.Room.CurrentRoom = room; |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | //功能和场景bodyView |
| | | functionSceneBodyView = new FrameLayout() |
| | |
| | | addBtn.MouseUpEventHandler += AddBtn_MouseUpEventHandler; |
| | | |
| | | selectFloorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler; |
| | | floorBtn.MouseUpEventHandler+= SelectedFloor_MouseUpEventHandler; |
| | | floorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler; |
| | | |
| | | } |
| | | |
| | |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void SelectedFloor_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | var floors = new SelectFloor (); |
| | | var floors = new SelectFloor(); |
| | | AddChidren(floors); |
| | | floors.Init(599,357); |
| | | floors.Init(599, 357); |
| | | floors.FloorAction += (floorName) => |
| | | { |
| | | floorBtn.Text = floorName; |
| | |
| | | { |
| | | functionTypeScrowView = new HorizontalScrolViewLayout |
| | | { |
| | | X=Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | Height = Application.GetRealHeight(279), |
| | | Width = Application.GetRealWidth(1028), |
| | | BackgroundColor=ZigbeeColor.Current.GXCBackgroundColor |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | functionSceneBodyView.AddChidren(functionTypeScrowView); |
| | | |
| | |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | Y = functionTypeScrowView.Bottom + Application.GetRealHeight(50), |
| | | Width = Application.GetRealWidth(1028), |
| | | Height = functionSceneBodyView.Height - Application.GetRealHeight(279+50) - 1, |
| | | Height = functionSceneBodyView.Height - Application.GetRealHeight(279 + 50) - 1, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | |
| | | }; |
| | | functionSceneBodyView.AddChidren(deviceListScrolView); |
| | | tempFunctionTypeBtn = new FunctionButton(); |
| | | |
| | | |
| | | foreach (var deviceType in Common.Room.AllRoomDeviceTypeList) |
| | | { |
| | | typeRowLayout = new RowLayout() |
| | |
| | | tempFunctionTypeBtn.IsSelected = false; |
| | | tempFunctionTypeBtn = (typeSender as Button).Parent as FunctionButton; |
| | | ((typeSender as Button).Parent as FunctionButton).IsSelected = true; |
| | | |
| | | |
| | | deviceListScrolView.RemoveAll(); |
| | | |
| | | var sameTypeList = new List<DeviceUI> { }; |
| | |
| | | |
| | | var deviceTypeRowLayout = new RowLayout() |
| | | { |
| | | Height = Application.GetRealHeight(127+35), |
| | | Height = Application.GetRealHeight(127 + 35), |
| | | LineColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Tag = deviceUI |
| | | }; |
| | |
| | | }; |
| | | deviceTypeRowLayout.AddRightView(delBtn); |
| | | delBtn.MouseUpEventHandler += delEvent; |
| | | |
| | | |
| | | } |
| | | else if (deviceUI.CommonDevice.Type == ZigBee.Device.DeviceType.Thermostat) |
| | | { |
| | |
| | | deviceTypeRowLayout.AddRightView(delBtn); |
| | | delBtn.MouseUpEventHandler += delEvent; |
| | | |
| | | |
| | | |
| | | deviceRow.SwitchBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | zbGateway = deviceUI.CommonDevice.Gateway; |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | var noFunction = new Button() |
| | | { |
| | | Y=Application.GetRealHeight(320), |
| | | Width=Application.GetMinRealAverage(757), |
| | | Y = Application.GetRealHeight(320), |
| | | Width = Application.GetMinRealAverage(757), |
| | | Height = Application.GetMinRealAverage(435), |
| | | UnSelectedImagePath="Item/NoFunction.png", |
| | | UnSelectedImagePath = "Item/NoFunction.png", |
| | | Gravity = Gravity.CenterHorizontal |
| | | }; |
| | | functionSceneBodyView.AddChidren(noFunction); |
| | |
| | | //Text = "没有功能 \n 请在个人中心中--设备管理处添加", |
| | | TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsMoreLines=true |
| | | IsMoreLines = true |
| | | }; |
| | | functionSceneBodyView.AddChidren(noFunctionTip); |
| | | } |
| | |
| | | { |
| | | var sceneScrolView = new VerticalScrolViewLayout |
| | | { |
| | | Y=Application.GetRealHeight(58) |
| | | Y = Application.GetRealHeight(58) |
| | | }; |
| | | functionSceneBodyView.AddChidren(sceneScrolView); |
| | | foreach (var sceneRoomUI in sceneList) |
| | |
| | | |
| | | var sceneImg = new Button() |
| | | { |
| | | X=Application.GetRealWidth(179), |
| | | Width=Application.GetMinReal(844), |
| | | Height=Application.GetMinReal(400), |
| | | X = Application.GetRealWidth(179), |
| | | Width = Application.GetMinReal(844), |
| | | Height = Application.GetMinReal(400), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = sceneRoomUI.sceneUI.IconPath, |
| | | Radius = (uint)Application.GetRealHeight(CommonFormResouce.BigFormRadius) |
| | |
| | | |
| | | var leftFL = new FrameLayout |
| | | { |
| | | X=Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | X = Application.GetRealWidth(CommonFormResouce.X_Left), |
| | | Width = Application.GetRealWidth(251), |
| | | Height = Application.GetRealHeight(282), |
| | | Gravity=Gravity.CenterVertical, |
| | | Gravity = Gravity.CenterVertical, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor2 |
| | | }; |
| | | sceneRowLayout.AddChidren(leftFL); |
| | | |
| | | var collectionBtn = new Button |
| | | { |
| | | X=Application.GetRealWidth(23), |
| | | Y=Application.GetRealHeight(23), |
| | | Width=Application.GetMinRealAverage(65), |
| | | Height=Application.GetMinRealAverage(65), |
| | | UnSelectedImagePath="Item/Collection.png", |
| | | SelectedImagePath="Item/CollectionSelected.png" |
| | | X = Application.GetRealWidth(23), |
| | | Y = Application.GetRealHeight(23), |
| | | Width = Application.GetMinRealAverage(65), |
| | | Height = Application.GetMinRealAverage(65), |
| | | UnSelectedImagePath = "Item/Collection.png", |
| | | SelectedImagePath = "Item/CollectionSelected.png" |
| | | }; |
| | | leftFL.AddChidren(collectionBtn); |
| | | |
| | |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | Text = sceneRoomUI.sceneUI.Name, |
| | | Gravity = Gravity.Center, |
| | | IsMoreLines=true |
| | | IsMoreLines = true |
| | | }; |
| | | leftFL.AddChidren(sceneNameBtn); |
| | | |
| | |
| | | //编辑 |
| | | var settingBtn = new Device.CommonForm.RowLayoutEditButton() |
| | | { |
| | | TextID=R.MyInternationalizationString.Setting, |
| | | TextID = R.MyInternationalizationString.Setting, |
| | | Tag = sceneRoomUI.sceneUI.SceneDelayTime |
| | | }; |
| | | //删除 |
| | |
| | | var tip = new CustomAlert { }; |
| | | AddChidren(tip); |
| | | tip.Show(Language.StringByID(R.MyInternationalizationString.ConfirmDelete)); |
| | | |
| | | |
| | | //var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP), Language.StringByID(R.MyInternationalizationString.ConfirmDelete), Language.StringByID(R.MyInternationalizationString.Cancel), Language.StringByID(R.MyInternationalizationString.Confrim)); |
| | | //alert.Show(); |
| | | tip.ResultEventHandler += async (e1) => |