| | |
| | | using System; |
| | | using Shared.Common; |
| | | using Shared.Phone.Device.CommonForm; |
| | | |
| | | namespace Shared.Phone.Device.Room |
| | | { |
| | | |
| | | public class RoomManagement : FrameLayout |
| | | { |
| | | public Action action; |
| | | |
| | | #region ◆ 变量____________________________ |
| | | /// <summary> |
| | | /// bodyFrameLayout |
| | | /// </summary> |
| | | private FrameLayout bodyFrameLayout; |
| | | |
| | | #endregion |
| | | |
| | | |
| | | public Action action; |
| | | |
| | | |
| | | public override void RemoveFromParent() |
| | | { |
| | | //更新界面 |
| | | action?.Invoke(); |
| | | base.RemoveFromParent(); |
| | | } |
| | | /// <summary> |
| | | /// 房间管理 |
| | | /// </summary> |
| | | public void Show() |
| | | { |
| | | RoomPage(); |
| | | AddTop(); |
| | | |
| | | AddBodyView(); |
| | | } |
| | | public override void RemoveFromParent() |
| | | |
| | | #region Add____________________________________ |
| | | |
| | | /// <summary> |
| | | /// AddTop |
| | | /// </summary> |
| | | public void AddTop() |
| | | { |
| | | //更新界面 |
| | | action(); |
| | | base.RemoveFromParent(); |
| | | var top = new TopFrameLayout(); |
| | | AddChidren(top); |
| | | top.InitTopview(); |
| | | top.SetTopTitle(R.MyInternationalizationString.RoomList); |
| | | top.backButton.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | RemoveFromParent(); |
| | | }; |
| | | |
| | | var addRoomItemBtn = new Device.CommonForm.SelectedStatuButton() |
| | | { |
| | | X = Application.GetRealWidth(1080 - 150), |
| | | Width = Application.GetMinRealAverage(100), |
| | | Height = Application.GetMinRealAverage(100), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "Item/Add.png", |
| | | SelectedImagePath = "Item/AddSelected.png" |
| | | }; |
| | | top.AddChidren(addRoomItemBtn); |
| | | |
| | | addRoomItemBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var addRoom = new AddRoom(); |
| | | UserView.HomePage.Instance.AddChidren(addRoom); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addRoom.action = () => |
| | | { |
| | | Show(); |
| | | }; |
| | | AddRoom.OldBackgroundImagePath = string.Empty; |
| | | addRoom.Show(""); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// AddBodyView |
| | | /// </summary> |
| | | public void AddBodyView() |
| | | { |
| | | RemoveAll(); |
| | | bodyFrameLayout = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(184), |
| | | Height = Application.GetRealHeight(1737), |
| | | BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor, |
| | | }; |
| | | AddChidren(bodyFrameLayout); |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 房间管理界面 |
| | | /// </summary> |
| | |
| | | |
| | | var delBtn = new Shared.Phone.Device.CommonForm.RowLayoutDeleteButton(); |
| | | //第一个是房间喜爱,不允许滑动删除 分享过来的也不允许删除 |
| | | if (!room.IsLove || !room.IsSharedRoom){ |
| | | if (room.IsLove || room.IsSharedRoom) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | roomRowView.AddRightView(delBtn); |
| | | } |
| | | |
| | | //删除住宅 |
| | | delBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |