| | |
| | | { |
| | | |
| | | #region 控件列表 |
| | | FrameLayout bodyView; |
| | | static ClassificationPage bodyView; |
| | | #region 顶部控件 |
| | | /// <summary> |
| | | /// 房间分页 |
| | |
| | | /// <summary> |
| | | /// 楼层选择下拉图标 |
| | | /// </summary> |
| | | Button btnFoorDownIcon; |
| | | Button btnFloorDownIcon; |
| | | /// <summary> |
| | | /// 楼层显示 |
| | | /// </summary> |
| | | Button btnFoor; |
| | | Button btnFloor; |
| | | /// <summary> |
| | | /// 显示方式切换按钮 |
| | | /// </summary> |
| | |
| | | /// 房间列表区域 |
| | | /// </summary> |
| | | VerticalScrolViewLayout roomListView; |
| | | /// <summary> |
| | | /// 房间区域集合 |
| | | /// </summary> |
| | | List<FrameLayout> roomViewList; |
| | | #endregion |
| | | |
| | | #region 功能区域 |
| | |
| | | /// <summary> |
| | | /// 楼层选择下拉图标 |
| | | /// </summary> |
| | | btnFoorDownIcon = new Button() |
| | | btnFloorDownIcon = new Button() |
| | | { |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | |
| | | Y = Application.GetRealHeight(18), |
| | | UnSelectedImagePath = "Public/DownIcon.png", |
| | | }; |
| | | roomFloorChangeView.AddChidren(btnFoorDownIcon); |
| | | roomFloorChangeView.AddChidren(btnFloorDownIcon); |
| | | /// <summary> |
| | | /// 楼层显示 |
| | | /// </summary> |
| | | btnFoor = new Button() |
| | | btnFloor = new Button() |
| | | { |
| | | X = btnFoorDownIcon.Right, |
| | | X = btnFloorDownIcon.Right, |
| | | Y = Application.GetRealHeight(18), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetMinRealAverage(16), |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = UserConfig.Instance.CurFoor, |
| | | }; |
| | | roomFloorChangeView.AddChidren(btnFoor); |
| | | roomFloorChangeView.AddChidren(btnFloor); |
| | | /// <summary> |
| | | /// 显示方式切换按钮 |
| | | /// </summary> |
| | |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | roomPageView.AddChidren(roomListView); |
| | | /// <summary> |
| | | /// 房间区域集合 |
| | | /// </summary> |
| | | roomViewList = new List<FrameLayout>(); |
| | | |
| | | foreach (var room in DB_ResidenceData.residenceData.rooms) |
| | | { |
| | |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 1, |
| | | Tag = room.sid, |
| | | }; |
| | | roomListView.AddChidren(roomView); |
| | | |
| | |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | roomView.AddChidren(btnFloorAndRoomName); |
| | | |
| | | |
| | | #region 环境数据 |
| | | var environmentalView = new FrameLayout() |
| | |
| | | Y = Application.GetRealHeight(126), |
| | | Width = Application.GetMinRealAverage(58), |
| | | Height = Application.GetMinRealAverage(58), |
| | | UnSelectedImagePath = "", |
| | | SelectedImagePath = "Classification/Room/AllCloseIcon.png", |
| | | UnSelectedImagePath = "Classification/Room/AllCloseIcon.png", |
| | | Tag = "AllClose" |
| | | }; |
| | | roomView.AddChidren(btnAllClose); |
| | | #if DEBUG |
| | | btnAllClose.IsSelected = true; |
| | | #endif |
| | | |
| | | LoadEvent_CloseAllFunction(btnAllClose, room); |
| | | |
| | | var btn = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(20), |
| | | }; |
| | | roomListView.AddChidren(btn); |
| | | |
| | | |
| | | roomViewList.Add(roomView); |
| | | |
| | | roomViewbgColor.MouseUpEventHandler += (sender, e) => { |
| | | var view = new RoomPage(room); |
| | |
| | | roomListView.AddChidren(new Button() { Height = Application.GetRealHeight(20) });//太高视图,将导航了遮挡的部分完整显示 |
| | | #endregion |
| | | |
| | | LoadDialog_ChangeFloor(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | Height = Application.GetRealWidth(161), |
| | | Radius = (uint)Application.GetRealHeight(6), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Tag = item + "_View", |
| | | Y = index % 2 == 1 ? lastY2 : lastY1 |
| | | }; |
| | | //高度稍高的view |
| | |
| | | |
| | | |
| | | int functionCount = 0; |
| | | int functionOnCount = 0; |
| | | switch (item) |
| | | { |
| | | case "Light": |
| | | case FunctionCategory.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; |
| | | Button btnLightPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | |
| | | }; |
| | | functionView.AddChidren(btnLightPower); |
| | | btnLightPower.MouseUpEventHandler = (sender, e) => { |
| | | LoadEvent_LightsPower(btnLightPower); |
| | | LoadEvent_SwitchFunction(btnLightPower,item); |
| | | }; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | var skipView = new FunctionPage(); |
| | |
| | | }; |
| | | #endregion |
| | | break; |
| | | case "AC": |
| | | case FunctionCategory.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; |
| | | Button btnAcPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | |
| | | }; |
| | | functionView.AddChidren(btnAcPower); |
| | | btnAcPower.MouseUpEventHandler = (sender, e) => { |
| | | LoadEvent_LightsPower(btnAcPower); |
| | | LoadEvent_SwitchFunction(btnAcPower, item); |
| | | }; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { |
| | | var skipView = new FunctionPage(); |
| | |
| | | }; |
| | | #endregion |
| | | break; |
| | | case "Curtain": |
| | | case FunctionCategory.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; |
| | | Button btnClose; |
| | | btnClose = new Button() |
| | | { |
| | |
| | | }; |
| | | #endregion |
| | | break; |
| | | case "FloorHeating": |
| | | case FunctionCategory.FloorHeating: |
| | | btnName.TextID = StringId.FloorHeating; |
| | | break; |
| | | case "DoorLock": |
| | | case FunctionCategory.DoorLock: |
| | | btnName.TextID = StringId.DoorLock; |
| | | break; |
| | | case "Electric": |
| | | case FunctionCategory.Electric: |
| | | btnName.TextID = StringId.Electric; |
| | | break; |
| | | case "EnergyMonitoring": |
| | | case FunctionCategory.EnergyMonitoring: |
| | | btnName.TextID = StringId.EnergyMonitoring; |
| | | break; |
| | | case "Environmental": |
| | | case FunctionCategory.Environmental: |
| | | btnName.TextID = StringId.Environmental; |
| | | break; |
| | | case "FreshAir": |
| | | case FunctionCategory.FreshAir: |
| | | btnName.TextID = StringId.FreshAir; |
| | | break; |
| | | case "Music": |
| | | case FunctionCategory.Music: |
| | | btnName.TextID = StringId.Music; |
| | | break; |
| | | case "Panel": |
| | | case FunctionCategory.Panel: |
| | | btnName.TextID = StringId.Panel; |
| | | break; |
| | | case "SecurityMonitoring": |
| | | case FunctionCategory.SecurityMonitoring: |
| | | btnName.TextID = StringId.SecurityMonitoring; |
| | | break; |
| | | case "Sensor": |
| | | case FunctionCategory.Sensor: |
| | | btnName.TextID = StringId.Sensor; |
| | | break; |
| | | case "VideoIntercom": |
| | | case FunctionCategory.VideoIntercom: |
| | | btnName.TextID = StringId.VideoIntercom; |
| | | break; |
| | | |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = "0/" + functionCount.ToString() |
| | | Text = functionOnCount + "/" + functionCount, |
| | | Tag = item + "_onCount" |
| | | }; |
| | | functionView.AddChidren(btnFunctionCount); |
| | | |
| | |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | |
| | | #region 切换楼层 |
| | | /// <summary> |
| | | /// 住宅列表点击事件 |
| | | /// </summary> |
| | | void LoadDialog_ChangeFloor() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | var dialog = new Dialog(); |
| | | var dialogBody = new FrameLayout(); |
| | | dialog.AddChidren(dialogBody); |
| | | dialogBody.MouseUpEventHandler += (sender1, e1) => { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | var dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(100), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(190), |
| | | BackgroundImagePath = "PersonalCenter/HomeListbg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | X = Application.GetRealWidth(8), |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(44 * 4), |
| | | }; |
| | | dispalyView.AddChidren(contentView); |
| | | |
| | | List<string> chooseList = new List<string>(); |
| | | chooseList.Add(Language.StringByID(StringId.All)); |
| | | chooseList.AddRange(DB_ResidenceData.residenceData.floors); |
| | | |
| | | foreach (var floor in chooseList) |
| | | { |
| | | if (floor != Language.StringByID(StringId.All)) |
| | | { |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(112), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS.CSS_Color.BackgroundColor |
| | | }); |
| | | } |
| | | var btnHomeName = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(112), |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS.CSS_Color.MainColor, |
| | | Text = floor, |
| | | TextSize = CSS.CSS_FontSize.SubheadingFontSize, |
| | | IsSelected = btnFloor.Text == floor, |
| | | IsMoreLines = true, |
| | | Tag = floor |
| | | }; |
| | | contentView.AddChidren(btnHomeName); |
| | | |
| | | btnHomeName.MouseUpEventHandler += (senderH, en) => |
| | | { |
| | | dialog.Close(); |
| | | |
| | | btnFloor.Text = floor; |
| | | UserConfig.Instance.SaveUserConfig(); |
| | | }; |
| | | } |
| | | |
| | | dialog.Show(); |
| | | }; |
| | | |
| | | btnFloor.MouseUpEventHandler = eventHandler; |
| | | btnFloorDownIcon.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | void LoadEvent_ChangeFloorDisplay() |
| | | { |
| | | |
| | | } |
| | | #endregion |
| | | } |
| | | } |