| | |
| | | { |
| | | bodyView = this; |
| | | roomsShowed = new List<Room>(); |
| | | roomsShowed.AddRange(DB_ResidenceData.residenceData.rooms); |
| | | roomsShowed.AddRange(DB_ResidenceData.rooms); |
| | | } |
| | | |
| | | public void LoadPage() |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = OnAppConfig.Instance.CurFoor, |
| | | Text = DB_ResidenceData.residenceData.CurFoor, |
| | | }; |
| | | roomFloorChangeView.AddChidren(btnFloor); |
| | | /// <summary> |
| | |
| | | { |
| | | Y = roomFloorChangeView.Bottom, |
| | | Height = Application.GetRealHeight(497 + 10 + 30), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | //BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | roomPageView.AddChidren(roomListView); |
| | | LoadRoomRows(); |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(184), |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 1, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | Tag = room.sid, |
| | | }; |
| | | roomListView.AddChidren(roomView); |
| | | |
| | | var roomViewbg = new Button() |
| | | var roomViewbg = new ImageView() |
| | | { |
| | | UnSelectedImagePath = room.backgroundImage, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(184), |
| | | ImagePath = room.backgroundImage, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | roomView.AddChidren(roomViewbg); |
| | | |
| | | var roomViewbgColor = new Button() |
| | | { |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BackgroundColor = 0x19333333, |
| | | }; |
| | | roomView.AddChidren(roomViewbgColor); |
| | |
| | | Y = Application.GetRealHeight(12 - 2), |
| | | Width = Application.GetRealWidth(266), |
| | | Height = Application.GetRealHeight(22 + 2 + 2), |
| | | Text = room.floor + " " + room.name, |
| | | Text = room.floorName + room.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | |
| | | }; |
| | | roomListView.AddChidren(btn); |
| | | |
| | | roomViewbgColor.MouseUpEventHandler += (sender, e) => { |
| | | roomViewbgColor.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var view = new RoomPage(room); |
| | | MainPage.BasePageView.AddChidren(view); |
| | | view.LoadPage(); |
| | |
| | | Y = Application.GetRealHeight(16), |
| | | Height = Application.GetRealHeight(667 - 64 - 49 + 20), |
| | | }; |
| | | |
| | | if (DB_ResidenceData.residenceData.functionTypeList.Count > 4) |
| | | { |
| | | functionContentView.Height += Application.GetRealHeight((220 * (DB_ResidenceData.residenceData.functionTypeList.Count - 4 - 2) / 2) + 20); |
| | | } |
| | | functionsPageView.AddChidren(functionContentView); |
| | | |
| | | |
| | | int index = 0; |
| | | List<int> specialList = new List<int>() { 1, 2, 5, 6, 9, 10, 13, 14, 17, 18, 21, 22 }; |
| | |
| | | var lastY1 = Application.GetRealWidth(16); |
| | | var lastY2 = Application.GetRealWidth(16); |
| | | |
| | | var functionCategoryCount = 0; |
| | | |
| | | foreach (var item in DB_ResidenceData.residenceData.functionTypeList) |
| | | { |
| | | int functionCount = 0; |
| | | int functionOnCount = 0; |
| | | switch (item) |
| | | { |
| | | case ShowFunction.Light: |
| | | #region Light |
| | | functionCount = DB_ResidenceData.functionList.lights.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.lights.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | #endregion |
| | | break; |
| | | case ShowFunction.AC: |
| | | #region AC |
| | | functionCount = DB_ResidenceData.functionList.aCs.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.aCs.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | #endregion |
| | | break; |
| | | case ShowFunction.Curtain: |
| | | #region Curtain |
| | | functionCount = DB_ResidenceData.functionList.curtains.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.curtains.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | #endregion |
| | | break; |
| | | case ShowFunction.FloorHeating: |
| | | #region 地热 |
| | | functionCount = DB_ResidenceData.functionList.floorHeatings.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.floorHeatings.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | #endregion |
| | | break; |
| | | case ShowFunction.DoorLock: |
| | | break; |
| | | case ShowFunction.Electric: |
| | | #region 电器 |
| | | functionCount = DB_ResidenceData.functionList.electricals.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.electricals.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | #endregion |
| | | break; |
| | | case ShowFunction.EnergyMonitoring: |
| | | break; |
| | | case ShowFunction.Environmental: |
| | | #region 环境数据 |
| | | functionCount = DB_ResidenceData.functionList.sensorsEnvironmentalScience.Count; |
| | | #endregion |
| | | break; |
| | | case ShowFunction.FreshAir: |
| | | break; |
| | | case ShowFunction.Music: |
| | | functionCount = Music.A31MusicModel.A31MusicModelList.Count; |
| | | functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | break; |
| | | case ShowFunction.Panel: |
| | | break; |
| | | case ShowFunction.SecurityMonitoring: |
| | | break; |
| | | case ShowFunction.Sensor: |
| | | break; |
| | | case ShowFunction.VideoIntercom: |
| | | break; |
| | | |
| | | } |
| | | |
| | | if (functionCount == 0 && item != ShowFunction.Music) |
| | | { |
| | | continue; |
| | | } |
| | | functionCategoryCount++; |
| | | |
| | | FrameLayout functionView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(161), |
| | | Radius = (uint)Application.GetRealHeight(6), |
| | | Radius = (uint)Application.GetRealWidth(6), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Tag = item + "_View", |
| | | Y = index % 2 == 1 ? lastY2 : lastY1 |
| | |
| | | functionView.AddChidren(btnName); |
| | | |
| | | |
| | | int functionCount = 0; |
| | | int functionOnCount = 0; |
| | | switch (item) |
| | | { |
| | | case ShowFunction.Light: |
| | | #region Light |
| | | btnName.TextID = StringId.Lights; |
| | | functionCount = DB_ResidenceData.residenceData.functionList.lights.Count; |
| | | functionOnCount = DB_ResidenceData.residenceData.functionList.lights.FindAll((obj) => obj.on_off == "on" ).Count; |
| | | functionCount = DB_ResidenceData.functionList.lights.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.lights.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | Button btnLightPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | |
| | | Height = Application.GetRealWidth(32), |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | IsSelected = functionCount == functionOnCount |
| | | IsSelected = functionOnCount > 0, |
| | | Tag = item + "_AllControl", |
| | | }; |
| | | functionView.AddChidren(btnLightPower); |
| | | btnLightPower.MouseUpEventHandler = (sender, e) => { |
| | | LoadEvent_SwitchFunction(btnLightPower,item); |
| | | |
| | | btnLightPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEvent_SwitchFunction(btnLightPower, item); |
| | | }; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(StringId.Lights); |
| | |
| | | case ShowFunction.AC: |
| | | #region AC |
| | | btnName.TextID = StringId.AC; |
| | | functionCount = DB_ResidenceData.residenceData.functionList.aCs.Count; |
| | | functionOnCount = DB_ResidenceData.residenceData.functionList.aCs.FindAll((obj) => obj.on_off == "on" ).Count; |
| | | functionCount = DB_ResidenceData.functionList.aCs.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.aCs.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | Button btnAcPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | |
| | | Height = Application.GetRealWidth(32), |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | IsSelected = functionCount == functionOnCount |
| | | Tag = item + "_AllControl", |
| | | IsSelected = functionOnCount > 0, |
| | | }; |
| | | functionView.AddChidren(btnAcPower); |
| | | btnAcPower.MouseUpEventHandler = (sender, e) => { |
| | | btnAcPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEvent_SwitchFunction(btnAcPower, item); |
| | | }; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(StringId.AC); |
| | |
| | | case ShowFunction.Curtain: |
| | | #region Curtain |
| | | btnName.TextID = StringId.Curtain; |
| | | functionCount = DB_ResidenceData.residenceData.functionList.curtains.Count; |
| | | functionOnCount = DB_ResidenceData.residenceData.functionList.curtains.FindAll((obj) => obj.on_off == "on").Count; |
| | | functionCount = DB_ResidenceData.functionList.curtains.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.curtains.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | Button btnClose; |
| | | btnClose = new Button() |
| | | { |
| | |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", |
| | | IsSelected = functionCount == functionOnCount |
| | | Tag = item + "_AllControl", |
| | | IsSelected = functionOnCount > 0 |
| | | }; |
| | | functionView.AddChidren(btnClose); |
| | | |
| | |
| | | functionView.AddChidren(btnOpen); |
| | | LoadEvent_CurtainSwitch(btnClose, btnOpen); |
| | | |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(StringId.Curtain); |
| | |
| | | case ShowFunction.FloorHeating: |
| | | #region 地热 |
| | | btnName.TextID = StringId.FloorHeating; |
| | | functionCount = DB_ResidenceData.residenceData.functionList.floorHeatings.Count; |
| | | functionOnCount = DB_ResidenceData.residenceData.functionList.floorHeatings.FindAll((obj) => obj.on_off == "on").Count; |
| | | functionCount = DB_ResidenceData.functionList.floorHeatings.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.floorHeatings.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | Button btnFhPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | |
| | | Height = Application.GetRealWidth(32), |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | IsSelected = functionCount == functionOnCount |
| | | Tag = item + "_AllControl", |
| | | IsSelected = functionOnCount > 0 |
| | | }; |
| | | functionView.AddChidren(btnFhPower); |
| | | btnFhPower.MouseUpEventHandler = (sender, e) => { |
| | | btnFhPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEvent_SwitchFunction(btnFhPower, item); |
| | | }; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(StringId.FloorHeating); |
| | |
| | | case ShowFunction.Electric: |
| | | #region 电器 |
| | | btnName.TextID = StringId.Electric; |
| | | functionCount = DB_ResidenceData.residenceData.functionList.electricals.Count; |
| | | functionOnCount = DB_ResidenceData.residenceData.functionList.electricals.FindAll((obj) => obj.on_off == "on").Count; |
| | | functionCount = DB_ResidenceData.functionList.electricals.Count; |
| | | functionOnCount = DB_ResidenceData.functionList.electricals.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | Button btnElectricPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | |
| | | Height = Application.GetRealWidth(32), |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | IsSelected = functionCount == functionOnCount |
| | | Tag = item + "_AllControl", |
| | | IsSelected = functionOnCount > 0, |
| | | }; |
| | | functionView.AddChidren(btnElectricPower); |
| | | btnElectricPower.MouseUpEventHandler = (sender, e) => { |
| | | btnElectricPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadEvent_SwitchFunction(btnElectricPower, item); |
| | | }; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(StringId.Electric); |
| | |
| | | case ShowFunction.Environmental: |
| | | #region 环境数据 |
| | | btnName.TextID = StringId.EnvironmentalData; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new EnvironmentalSciencePage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(); |
| | |
| | | break; |
| | | case ShowFunction.Music: |
| | | btnName.TextID = StringId.Music; |
| | | functionCount = Music.A31MusicModel.A31MusicModelList.Count; |
| | | functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.trait_on_off.value.ToString() == "on").Count; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var musicMain = new Music.MusicMain(); |
| | |
| | | break; |
| | | |
| | | } |
| | | if (item != ShowFunction.Environmental) |
| | | if (item != ShowFunction.Environmental && functionCount != 0) |
| | | { |
| | | Button btnFunctionCount = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | X = Application.GetRealWidth(16)+ Application.GetRealWidth(7 * functionCount.ToString().Length), |
| | | Y = btnName.Bottom, |
| | | Width = Application.GetRealWidth(120), |
| | | Height = Application.GetRealHeight(24), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = functionOnCount + "/" + functionCount, |
| | | Tag = item + "_onCount" |
| | | Text = "/" + functionCount, |
| | | }; |
| | | functionView.AddChidren(btnFunctionCount); |
| | | Button btnOpenCount = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = btnName.Bottom, |
| | | Width = Application.GetRealWidth(12 * functionCount.ToString().Length), |
| | | Height = Application.GetRealHeight(24), |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = functionOnCount.ToString(), |
| | | Tag = item + "_onCount", |
| | | BorderWidth = 0, |
| | | }; |
| | | functionView.AddChidren(btnOpenCount); |
| | | } |
| | | index++; |
| | | } |
| | | |
| | | if (functionCategoryCount> 4) |
| | | { |
| | | functionContentView.Height += Application.GetRealHeight((220 * (functionCategoryCount - 4 - 2) / 2) + 20); |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | void LoadDialog_ChangeFloor() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | var dialog = new Dialog(); |
| | | var dialogBody = new FrameLayout(); |
| | | dialog.AddChidren(dialogBody); |
| | | dialogBody.MouseUpEventHandler += (sender1, e1) => { |
| | | dialogBody.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(203), |
| | | BackgroundImagePath = "PersonalCenter/HomeListbg.png", |
| | | Height = Application.GetRealHeight(110), |
| | | BackgroundImagePath = "PersonalCenter/HomeList1bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | |
| | | X = Application.GetRealWidth(8), |
| | | Y = Application.GetRealHeight(15), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(45 * 4), |
| | | Height = Application.GetRealHeight(45 * 2), |
| | | ScrollEnabled = false |
| | | }; |
| | | dispalyView.AddChidren(contentView); |
| | | |
| | | if (DB_ResidenceData.residenceData.floors.Count < 2) |
| | | { |
| | | } |
| | | else if (DB_ResidenceData.residenceData.floors.Count < 3) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(155), |
| | | BackgroundImagePath = "PersonalCenter/HomeList2bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 3); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else if (DB_ResidenceData.residenceData.floors.Count < 4) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(200), |
| | | BackgroundImagePath = "PersonalCenter/HomeList3bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 4); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(245), |
| | | BackgroundImagePath = "PersonalCenter/HomeList4bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 5); |
| | | contentView.ScrollEnabled = true; |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | |
| | | |
| | | List<string> chooseList = new List<string>(); |
| | | chooseList.Add(Language.StringByID(StringId.All)); |
| | |
| | | roomsShowed.Clear(); |
| | | if (floor == Language.StringByID(StringId.All)) |
| | | { |
| | | roomsShowed.AddRange(DB_ResidenceData.residenceData.rooms); |
| | | roomsShowed.AddRange(DB_ResidenceData.rooms); |
| | | } |
| | | else |
| | | { |
| | | foreach (var room in DB_ResidenceData.residenceData.rooms) |
| | | foreach (var room in DB_ResidenceData.rooms) |
| | | { |
| | | if (room.floor == floor) |
| | | if (room.floorName == floor) |
| | | { |
| | | roomsShowed.Add(room); |
| | | } |