| | |
| | | using System; |
| | | using Shared.Common; |
| | | using Shared.Phone.Device.Category; |
| | | using Shared.Phone.Device.CommonForm; |
| | | |
| | | namespace Shared.Phone.Device.Room |
| | |
| | | /// </summary> |
| | | private FrameLayout bodyFrameLayout; |
| | | |
| | | private Button floorBtn; |
| | | |
| | | private FrameLayout itemView; |
| | | |
| | | #endregion |
| | | |
| | | |
| | |
| | | public override void RemoveFromParent() |
| | | { |
| | | //更新界面 |
| | | action?.Invoke(); |
| | | //action?.Invoke(); |
| | | base.RemoveFromParent(); |
| | | } |
| | | /// <summary> |
| | |
| | | RemoveFromParent(); |
| | | }; |
| | | |
| | | var addRoomItemBtn = new Device.CommonForm.SelectedStatuButton() |
| | | floorBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(1080 - 150), |
| | | Width = Application.GetMinRealAverage(100), |
| | | Height = Application.GetMinRealAverage(100), |
| | | X = Application.GetRealWidth(750), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(60), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "Item/Add.png", |
| | | SelectedImagePath = "Item/AddSelected.png" |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | }; |
| | | top.AddChidren(addRoomItemBtn); |
| | | |
| | | addRoomItemBtn.MouseUpEventHandler += (sender, e) => |
| | | var selectFloorBtn = new Button() |
| | | { |
| | | var addRoom = new AddRoom(); |
| | | UserView.HomePage.Instance.AddChidren(addRoom); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addRoom.action = () => |
| | | { |
| | | Show(); |
| | | }; |
| | | AddRoom.OldBackgroundImagePath = string.Empty; |
| | | addRoom.Show(""); |
| | | X = Application.GetRealWidth(950), |
| | | Width = Application.GetMinRealAverage(69), |
| | | Height = Application.GetMinRealAverage(69), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "Item/Drop_Down.png" |
| | | }; |
| | | |
| | | floorBtn.Text = Config.Instance.Home.GetCurrentFloorName(); |
| | | top.topView.AddChidren(floorBtn); |
| | | top.topView.AddChidren(selectFloorBtn); |
| | | selectFloorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler; |
| | | floorBtn.MouseUpEventHandler += SelectedFloor_MouseUpEventHandler; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 选择楼层 |
| | | /// </summary> |
| | | /// <param name="sender">Sender.</param> |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void SelectedFloor_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | var floors = new SelectFloor(); |
| | | AddChidren(floors); |
| | | floors.Init(599, 161); |
| | | floors.FloorAction += (floorName) => |
| | | { |
| | | floorBtn.Text = floorName; |
| | | }; |
| | | } |
| | | /// <summary> |
| | | /// AddBodyView |
| | | /// </summary> |
| | | public void AddBodyView() |
| | | { |
| | | RemoveAll(); |
| | | bodyFrameLayout = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(184), |
| | |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor, |
| | | }; |
| | | AddChidren(bodyFrameLayout); |
| | | |
| | | var roomScrolView = new VerticalScrolViewLayout { }; |
| | | bodyFrameLayout.AddChidren(roomScrolView); |
| | | for (int i = 0; i < Shared.Common.Room.Lists.Count; i++) |
| | | { |
| | | var room = Shared.Common.Room.Lists[i]; |
| | | int xx = 43 + i % 2 * (20 + 487); |
| | | int yy = 0; |
| | | |
| | | if (i == 0 || i == 1) |
| | | { |
| | | if (i % 2 == 0) |
| | | { |
| | | itemView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(354 + 58), |
| | | Tag = room |
| | | }; |
| | | roomScrolView.AddChidren(itemView); |
| | | } |
| | | yy = 58; |
| | | } |
| | | else if (i % 2 == 0) |
| | | { |
| | | itemView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(354), |
| | | Tag = room |
| | | }; |
| | | roomScrolView.AddChidren(itemView); |
| | | } |
| | | |
| | | var roomView = new RoomMainView(xx, yy); |
| | | itemView.AddChidren(roomView); |
| | | roomView.Init(); |
| | | roomView.SetRoomName(room.Name); |
| | | roomView.SetRoomIcon(room.BackgroundImage); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | void RoomPage() |
| | | { |
| | | RemoveAll(); |
| | | #region topview |
| | | var topBGView = new FrameLayout()
{
Height = Application.GetRealHeight(CommonPage.Navigation_Height),
BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor
};
AddChidren(topBGView); |
| | | var topView = new FrameLayout()
{
Y = Application.GetRealHeight(CommonPage.NavigationTitle_Y),
Height = Application.GetRealHeight(CommonPage.Navigation_Height - CommonPage.NavigationTitle_Y),
BackgroundColor = ZigbeeColor.Current.GXCTopViewBackgroundColor,
}; |
| | | AddChidren(topView);
|
| | | var title = new Button() |
| | | { |
| | | TextAlignment = TextAlignment.Center, |
| | | TextID=R.MyInternationalizationString.RoomList, |
| | | TextSize = 20, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | Width = Application.GetRealWidth(CommonPage.AppRealWidth - 500), |
| | | Gravity = Gravity.CenterHorizontal |
| | | }; |
| | | topView.AddChidren(title); |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | |
| | | var back = new Device.CommonForm.BackButton() { };
topView.AddChidren(back); |
| | | return; |
| | | |
| | | |
| | | back.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | this.RemoveFromParent(); |
| | | }; |
| | | |
| | | var addRoomItemBtn = new Device.CommonForm.SelectedStatuButton() |
| | | { |
| | | Width = Application.GetMinRealAverage(100), |
| | | Height = Application.GetMinRealAverage(100), |
| | | UnSelectedImagePath = "Item/Add.png", |
| | | SelectedImagePath="Item/AddSelected.png", |
| | | X = Application.GetRealWidth(1080 - 150), |
| | | Gravity = Gravity.CenterVertical |
| | | }; |
| | | topView.AddChidren(addRoomItemBtn); |
| | | |
| | | //Action action = RoomPage; |
| | | |
| | | addRoomItemBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //AddOrUpdateRoom(action); |
| | | var addRoom = new AddRoom(); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addRoom); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addRoom.action = () => |
| | | { |
| | | Show(); |
| | | }; |
| | | AddRoom.OldBackgroundImagePath = string.Empty; |
| | | addRoom.Show(""); |
| | | }; |
| | | #endregion |
| | | |
| | | var middleHomePage = new FrameLayout() |
| | | { |
| | | Width = LayoutParams.MatchParent, |
| | | Height = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.Navigation_Height), |
| | | Y = topView.Bottom, |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | }; |
| | | this.AddChidren(middleHomePage); |
| | | |
| | | var RoomBodyView = new VerticalScrolViewLayout() |
| | | { |
| | | Height = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.Navigation_Height), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | }; |
| | | middleHomePage.AddChidren(RoomBodyView); |
| | | |
| | | |
| | | |
| | | foreach (var roomFilePath in Config.Instance.Home.RoomFilePathList) |