using System; using System.Collections.Generic; using Shared.Common; using ZigBee.Device; namespace Shared.Phone.UserCenter.DoorLock { public class HistoryRecordPage : DoorLockCommonLayout, ZigBee.Common.IStatus { public HistoryRecordPage(ZigBee.Device.DoorLock doorLock) { this.doorLock = doorLock; BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; ZigBee.Device.ZbGateway.StatusList.Add(this); } #region ◆ 变量申明__________________________ ZigBee.Device.DoorLock doorLock; FrameLayout bottomFrameLayout; #endregion /// /// UI显示 /// public void Show() { this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.HistoryRecord)); EventHandler eHandlerBack = (sender, e) => { RemoveFromParent(); }; this.btnBack.MouseUpEventHandler += eHandlerBack; this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; this.MidFrameLayout(this); var btnClearAll = new Button { X = Application.GetRealWidth(953), Height = Application.GetRealHeight(69), Width = Application.GetRealWidth(69), //UnSelectedImagePath = "Item/Back.png", //SelectedImagePath = "Item/BackOn.png", BackgroundColor = ZigbeeColor.Current.XMOrange, }; this.titleFrameLayout.AddChidren(btnClearAll); btnClearAll.MouseDownEventHandler += (sender, e) => { }; MidFrameLayoutContent(); } public void MidFrameLayoutContent() { var midTopFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(115), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTopFrameLayout, }; this.midFrameLayout.AddChidren(midTopFrameLayout); #region UI var btnAllMember = new Button() { X = Application.GetRealWidth(81), Y = Application.GetRealHeight(35), Height = Application.GetRealHeight(49), Width = Application.GetRealWidth(141), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextAlignment = TextAlignment.Center, Text = Language.StringByID(R.MyInternationalizationString.AllMember), TextSize = 12, }; midTopFrameLayout.AddChidren(btnAllMember); var btnAllMemberPic = new Button() { X = Application.GetRealWidth(222), Y = Application.GetRealHeight(23), Height = Application.GetRealHeight(69), Width = Application.GetRealWidth(69), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange, }; midTopFrameLayout.AddChidren(btnAllMemberPic); var btnLockMethod = new Button() { X = Application.GetRealWidth(348), Y = Application.GetRealHeight(35), Height = Application.GetRealHeight(49), Width = Application.GetRealWidth(141), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextAlignment = TextAlignment.Center, Text = Language.StringByID(R.MyInternationalizationString.LockMethod), TextSize = 12, }; midTopFrameLayout.AddChidren(btnLockMethod); var btnLockMethodPic = new Button() { X = Application.GetRealWidth(490), Y = Application.GetRealHeight(23), Height = Application.GetRealHeight(69), Width = Application.GetRealWidth(69), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange, }; midTopFrameLayout.AddChidren(btnLockMethodPic); var btnDate = new Button() { X = Application.GetRealWidth(746), Y = Application.GetRealHeight(35), Height = Application.GetRealHeight(49), Width = Application.GetRealWidth(207), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextAlignment = TextAlignment.Center, Text = Language.StringByID(R.MyInternationalizationString.AllDate), TextSize = 12, }; midTopFrameLayout.AddChidren(btnDate); var btnDatePic = new Button() { X = Application.GetRealWidth(953), Y = Application.GetRealHeight(35), Height = Application.GetRealHeight(69), Width = Application.GetRealWidth(69), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange, }; midTopFrameLayout.AddChidren(btnDatePic); #endregion #region 事件处理 btnAllMemberPic.MouseUpEventHandler += (sender, e) => { MatchUsersFrameLayout(); }; btnLockMethodPic.MouseUpEventHandler += (sender, e) => { LockMethodFrameLayout(); }; btnDatePic.MouseUpEventHandler += (sender, e) => { LockDateFrameLayout(); }; #endregion HistoryRecordList(); } public void HistoryRecordList() { var bodyView = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(118), }; this.midFrameLayout.AddChidren(bodyView); for (int i = 0; i < 3; i++) { var RowView = new FrameLayout() { Height = Application.GetRealHeight(161), }; bodyView.AddChidren(RowView); var btnPic = new Button() { X = Application.GetRealWidth(58), Y = Application.GetRealHeight(46), Height = Application.GetRealHeight(81), Width = Application.GetRealWidth(81), //UnSelectedImagePath = "Item/Next.png", //SelectedImagePath = "Item/Down.png", BackgroundColor = Shared.Common.ZigbeeColor.Current.XMOrange, }; RowView.AddChidren(btnPic); var btnMemberName = new Button() { X = Application.GetRealWidth(173), Y = Application.GetRealHeight(35), Width = Application.GetRealWidth(276), Height = Application.GetRealHeight(60), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextAlignment = TextAlignment.CenterLeft, TextSize = 14, Text = "Krafty", }; RowView.AddChidren(btnMemberName); var btnRight = new Button() { X = Application.GetRealWidth(645), Y = Application.GetRealHeight(35), Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(377), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextAlignment = TextAlignment.CenterRight, TextSize = 14, Text = "11:00:00", }; RowView.AddChidren(btnRight); var line2 = new Button() { Y = RowView.Height - 1, X = Application.GetRealWidth(58), Width = Application.GetRealWidth(965), Height = 1, BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, }; RowView.AddChidren(line2); int currentIndex = i; EventHandler eHandler = (sender, e) => { //var doorLock = new ZigBee.Device.DoorLock(); //var memberFrozenPage = new Shared.Phone.UserCenter.DoorLock.MemberFrozenPage(doorLock); //Shared.Phone.UserView.HomePage.Instance.AddChidren(memberFrozenPage); //Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; //memberFrozenPage.Show(); }; btnRight.MouseUpEventHandler += eHandler; RowView.MouseUpEventHandler += eHandler; } } public void MatchUsersFrameLayout() { var flMain = new FrameLayout { BackgroundColor = 0x0f000000 }; this.midFrameLayout.AddChidren(flMain); flMain.MouseUpEventHandler += (sender11, e11) => { flMain.RemoveFromParent(); bottomFrameLayout.RemoveAll(); HistoryRecordList(); }; bottomFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(100), Y = Application.GetRealHeight(930), Radius = 17, BackgroundColor = ZigbeeColor.Current.XMWhite, }; flMain.AddChidren(bottomFrameLayout); var bottomFrameLayout1 = new FrameLayout() { Height = Application.GetRealHeight(806 - 50), Y = Application.GetRealHeight(930 + 48), BackgroundColor = ZigbeeColor.Current.XMWhite, }; flMain.AddChidren(bottomFrameLayout1); var bottomFrameLayout2 = new FrameLayout() { Height = Application.GetRealHeight(806), Y = Application.GetRealHeight(930), }; flMain.AddChidren(bottomFrameLayout2); var matchUsersFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(138), }; bottomFrameLayout2.AddChidren(matchUsersFrameLayout); var btnCancel = new Button { X = Application.GetRealWidth(81), Y = Application.GetRealHeight(40), Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(101), Text = Language.StringByID(R.MyInternationalizationString.Cancel), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextSize = 14, }; matchUsersFrameLayout.AddChidren(btnCancel); var btnMatchUser = new Button { X = Application.GetRealWidth(446), Y = Application.GetRealHeight(35), Height = Application.GetRealHeight(63), Width = Application.GetRealWidth(284), Text = Language.StringByID(R.MyInternationalizationString.uMember), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextSize = 16, }; matchUsersFrameLayout.AddChidren(btnMatchUser); var btnFinish = new Button { X = Application.GetRealWidth(919), Y = Application.GetRealHeight(40), Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(101), Text = Language.StringByID(R.MyInternationalizationString.Complete), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextSize = 14, }; matchUsersFrameLayout.AddChidren(btnFinish); var btnTopLine = new FrameLayout() { Height = Application.GetRealHeight(5), Y = Application.GetRealHeight(138), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, }; bottomFrameLayout2.AddChidren(btnTopLine); var allUsersFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(207), Y = Application.GetRealHeight(138 + 5), }; bottomFrameLayout2.AddChidren(allUsersFrameLayout); var btnAllMember = new Button { X = Application.GetRealWidth(81), Y = Application.GetRealHeight(69), Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(625), Text = Language.StringByID(R.MyInternationalizationString.AllMember), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextSize = 14, TextAlignment = TextAlignment.CenterLeft, }; allUsersFrameLayout.AddChidren(btnAllMember); var btnAllChoose = new Button { Width = Application.GetRealWidth(58), Height = Application.GetRealHeight(58), X = Application.GetRealWidth(861 + 81), Y = Application.GetRealHeight(69), BackgroundColor = ZigbeeColor.Current.XMOrange, }; allUsersFrameLayout.AddChidren(btnAllChoose); var btnMidLine = new FrameLayout() { Height = Application.GetRealHeight(5), Y = Application.GetRealHeight(207 + 127), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, }; bottomFrameLayout2.AddChidren(btnMidLine); var matchUserHorizontalScrolViewLayout = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(207 + 127 + 5), Height = Application.GetRealHeight(806 - 207 - 127), }; bottomFrameLayout2.AddChidren(matchUserHorizontalScrolViewLayout); for (var i = 0; i < 3; i++) { var rowFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(127), }; matchUserHorizontalScrolViewLayout.AddChidren(rowFrameLayout); var btnUserName = new Button() { Width = Application.GetRealWidth(743), Height = Application.GetRealHeight(58), X = Application.GetRealWidth(81), Y = Application.GetRealHeight(37), Text = "Krafty", TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextSize = 14, TextAlignment = TextAlignment.CenterLeft, }; rowFrameLayout.AddChidren(btnUserName); var btnChoose = new Button() { Width = Application.GetRealWidth(58), Height = Application.GetRealHeight(58), X = Application.GetRealWidth(861 + 81), Y = Application.GetRealHeight(35), BackgroundColor = ZigbeeColor.Current.XMOrange, }; rowFrameLayout.AddChidren(btnChoose); var btnLine = new FrameLayout() { Width = Application.GetRealWidth(919), Height = Application.GetRealHeight(5), X = Application.GetRealWidth(81), Y = Application.GetRealHeight(122), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, }; rowFrameLayout.AddChidren(btnLine); } } public void LockMethodFrameLayout() { var flMain = new FrameLayout { BackgroundColor = 0x0f000000 }; this.midFrameLayout.AddChidren(flMain); flMain.MouseUpEventHandler += (sender11, e11) => { flMain.RemoveFromParent(); bottomFrameLayout.RemoveAll(); HistoryRecordList(); }; bottomFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(100), Y = Application.GetRealHeight(930), Radius = 17, BackgroundColor = ZigbeeColor.Current.XMWhite, }; flMain.AddChidren(bottomFrameLayout); var bottomFrameLayout1 = new FrameLayout() { Height = Application.GetRealHeight(806 - 50), Y = Application.GetRealHeight(930 + 48), BackgroundColor = ZigbeeColor.Current.XMWhite, }; flMain.AddChidren(bottomFrameLayout1); var bottomFrameLayout2 = new FrameLayout() { Height = Application.GetRealHeight(806), Y = Application.GetRealHeight(930), }; flMain.AddChidren(bottomFrameLayout2); var matchUsersFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(138), }; bottomFrameLayout2.AddChidren(matchUsersFrameLayout); var btnCancel = new Button { X = Application.GetRealWidth(81), Y = Application.GetRealHeight(40), Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(101), Text = Language.StringByID(R.MyInternationalizationString.Cancel), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextSize = 14, }; matchUsersFrameLayout.AddChidren(btnCancel); var btnMatchUser = new Button { X = Application.GetRealWidth(446), Y = Application.GetRealHeight(35), Height = Application.GetRealHeight(63), Width = Application.GetRealWidth(284), Text = Language.StringByID(R.MyInternationalizationString.LockMethod), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextSize = 16, }; matchUsersFrameLayout.AddChidren(btnMatchUser); var btnFinish = new Button { X = Application.GetRealWidth(919), Y = Application.GetRealHeight(40), Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(101), Text = Language.StringByID(R.MyInternationalizationString.Complete), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextSize = 14, }; matchUsersFrameLayout.AddChidren(btnFinish); var btnTopLine = new FrameLayout() { Height = Application.GetRealHeight(5), Y = Application.GetRealHeight(138), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, }; bottomFrameLayout2.AddChidren(btnTopLine); var matchUserHorizontalScrolViewLayout = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(207), Height = Application.GetRealHeight(806 - 207), }; bottomFrameLayout2.AddChidren(matchUserHorizontalScrolViewLayout); for (var i = 0; i < 4; i++) { var rowFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(127), }; matchUserHorizontalScrolViewLayout.AddChidren(rowFrameLayout); var btnUserName = new Button() { Width = Application.GetRealWidth(743), Height = Application.GetRealHeight(58), X = Application.GetRealWidth(81), Y = Application.GetRealHeight(37), TextSize = 14, TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextAlignment = TextAlignment.CenterLeft, }; rowFrameLayout.AddChidren(btnUserName); var btnChoose = new Button() { Width = Application.GetRealWidth(58), Height = Application.GetRealHeight(58), X = Application.GetRealWidth(861 + 81), Y = Application.GetRealHeight(35), BackgroundColor = ZigbeeColor.Current.XMOrange, }; rowFrameLayout.AddChidren(btnChoose); var btnLine = new FrameLayout() { Width = Application.GetRealWidth(919), Height = Application.GetRealHeight(5), X = Application.GetRealWidth(81), Y = Application.GetRealHeight(122), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, }; rowFrameLayout.AddChidren(btnLine); switch (i) { case 0: btnUserName.Text = Language.StringByID(R.MyInternationalizationString.FingerprintUnlock); break; case 1: btnUserName.Text = Language.StringByID(R.MyInternationalizationString.PasswordUnlock); break; case 2: btnUserName.Text = Language.StringByID(R.MyInternationalizationString.TempPasswordUnlock); break; case 3: btnUserName.Text = Language.StringByID(R.MyInternationalizationString.ProximithCardUnlock); break; } } } public void LockDateFrameLayout() { var flMain = new FrameLayout { BackgroundColor = 0x0f000000 }; this.midFrameLayout.AddChidren(flMain); flMain.MouseUpEventHandler += (sender11, e11) => { flMain.RemoveFromParent(); bottomFrameLayout.RemoveAll(); HistoryRecordList(); }; bottomFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(100), Y = Application.GetRealHeight(930), Radius = 17, BackgroundColor = ZigbeeColor.Current.XMWhite, }; flMain.AddChidren(bottomFrameLayout); var bottomFrameLayout1 = new FrameLayout() { Height = Application.GetRealHeight(806 - 50), Y = Application.GetRealHeight(930 + 48), BackgroundColor = ZigbeeColor.Current.XMWhite, }; flMain.AddChidren(bottomFrameLayout1); var bottomFrameLayout2 = new FrameLayout() { Height = Application.GetRealHeight(806), Y = Application.GetRealHeight(930), }; flMain.AddChidren(bottomFrameLayout2); var matchUsersFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(138), }; bottomFrameLayout2.AddChidren(matchUsersFrameLayout); var btnCancel = new Button { X = Application.GetRealWidth(81), Y = Application.GetRealHeight(40), Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(101), Text = Language.StringByID(R.MyInternationalizationString.Cancel), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextSize = 14, }; matchUsersFrameLayout.AddChidren(btnCancel); var btnMatchUser = new Button { X = Application.GetRealWidth(446), Y = Application.GetRealHeight(35), Height = Application.GetRealHeight(63), Width = Application.GetRealWidth(284), Text = Language.StringByID(R.MyInternationalizationString.date), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextSize = 16, }; matchUsersFrameLayout.AddChidren(btnMatchUser); var btnFinish = new Button { X = Application.GetRealWidth(919), Y = Application.GetRealHeight(40), Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(101), Text = Language.StringByID(R.MyInternationalizationString.Complete), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextSize = 14, }; matchUsersFrameLayout.AddChidren(btnFinish); var btnTopLine = new FrameLayout() { Height = Application.GetRealHeight(5), Y = Application.GetRealHeight(138), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMGray3, }; bottomFrameLayout2.AddChidren(btnTopLine); var dateFrameLayout = new FrameLayout() { Y = Application.GetRealHeight(138 + 5), Height = Application.GetRealHeight(668) }; bottomFrameLayout2.AddChidren(dateFrameLayout); var timeview = new DateView { }; dateFrameLayout.AddChidren(timeview); var btnSave = new Button { Y = Application.GetRealHeight(1920 - 800), Width = Application.GetRealWidth(200), Height = Application.GetRealHeight(150), Text = "完成", TextColor = ZigbeeColor.Current.LogicTimeViewSaveButton, X = Application.GetRealWidth(1080 - 200), }; dateFrameLayout.AddChidren(btnSave); } /// /// 重写移除方法 /// public override void RemoveFromParent() { ZbGateway.StatusList.Remove(this); base.RemoveFromParent(); } #region ◆ 接口实现__________________________ /// /// 处理变化事件 --将弃用 改用DeviceInfoChange() /// /// The changed. /// Common. public void Changed(CommonDevice common) { } /// /// 处理变化事件 /// /// /// public void DeviceInfoChange(CommonDevice common, string typeTag) { } /// /// Changeds the IL ogic status. /// /// Logic. public void ChangedILogicStatus(ZigBee.Device.Logic logic) { } /// /// Changeds the IS cene status. /// /// Scene. public void ChangedISceneStatus(Scene scene) { } #endregion } }