| | |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.UI.Music; |
| | | using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | /// </summary> |
| | | private TopView topView; |
| | | /// <summary> |
| | | /// 当前设备名称 |
| | | /// </summary> |
| | | private Button btnCurrDeviceName; |
| | | /// <summary> |
| | | /// 区域 |
| | | /// </summary> |
| | | private Button btnCurrDeviceRoom; |
| | | /// <summary> |
| | | /// 电量父控件 |
| | | /// </summary> |
| | | private FrameLayout cellFrame; |
| | | /// <summary> |
| | | /// 电量 |
| | | /// </summary> |
| | | private Button btnCell; |
| | | /// <summary> |
| | | /// 电量进度条 |
| | | /// </summary> |
| | | private DiyArcSeekBar cellDiyArcSeekBar; |
| | | /// <summary> |
| | | ///收藏图标 |
| | | /// </summary> |
| | | private Button btnCollectIcon; |
| | | /// <summary> |
| | | /// 门锁状态 |
| | | /// </summary> |
| | | private CustomFrameLayout doorLockFL; |
| | | private Button btnDoorLockIcon; |
| | | Button btnDoorlockStatus; |
| | | /// <summary> |
| | | /// 实时视频 |
| | | /// </summary> |
| | | private CustomFrameLayout rtvFL; |
| | | /// <summary> |
| | | /// 一键开锁 |
| | | /// </summary> |
| | | private CustomFrameLayout openFL; |
| | | /// <summary> |
| | | /// 临时密码 |
| | | /// </summary> |
| | |
| | | /// 历史记录 |
| | | /// </summary> |
| | | private CustomFrameLayout recordFL; |
| | | |
| | | /// <summary> |
| | | /// 表示来自那个界面 |
| | | /// </summary> |
| | | private Comerom Comerom; |
| | | private CommonMethod.Comerom comerom; |
| | | /// <summary> |
| | | /// 删除设备后需要更新界面的回调 |
| | | /// </summary> |
| | | public Action action; |
| | | #endregion |
| | | |
| | | |
| | |
| | | /// 构造函数 |
| | | /// </summary> |
| | | /// <param name="function">设备</param> |
| | | /// <param name="btnDeviceName">上一级界面的设备名字控件</param> |
| | | /// <param name="btnRoomName">上一级界面的房间名字控件</param> |
| | | public VideoDoorLockPage(Function function, Button btnDeviceName, Button btnRoomName, Comerom comerom) |
| | | /// <param name="btnDeviceName">上一级界面的设备名字控件(注:不能传null,没有可以传new Button())</param> |
| | | /// <param name="btnRoomName">上一级界面的房间名字控件(注:不能传null,没有可以传new Button())</param> |
| | | public VideoDoorLockPage(Function function, Button btnDeviceName, Button btnRoomName, CommonMethod.Comerom comerom, Action action) |
| | | { |
| | | this.device = function; |
| | | this.btnDeviceName = btnDeviceName; |
| | | this.btnRoomName = btnRoomName; |
| | | this.Comerom = comerom; |
| | | this.comerom = comerom; |
| | | this.action = action; |
| | | |
| | | } |
| | | |
| | |
| | | //初始化UI |
| | | this.InitUI(); |
| | | //初始化事件 |
| | | this.Events(); |
| | | |
| | | this.EventListener(); |
| | | //读取数据 |
| | | this.ReadData(); |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 初始化界面 |
| | | /// </summary> |
| | |
| | | this.BackgroundColor = MusicColor.ViewColor; |
| | | this.topView = new TopView(); |
| | | this.topView.setBtn.Visible = true; |
| | | this.topView.topNameBtn.Text = this.device.name; |
| | | this.topView.topNameBtn.TextID = StringId.shipinmensuo; |
| | | this.AddChidren(topView.TopFLayoutView()); |
| | | var middLayout = new FrameLayout |
| | | var middleFl = new FrameLayout |
| | | { |
| | | Y = topView.fLayout.Bottom, |
| | | Height = Application.GetRealHeight(H_W.H - H_W.T_Height), |
| | | }; |
| | | this.AddChidren(middLayout); |
| | | this.AddChidren(middleFl); |
| | | |
| | | var whiteFl = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(24), |
| | | X = Application.GetRealWidth(24), |
| | | Height = Application.GetRealHeight(526), |
| | | Width = Application.GetRealWidth(327), |
| | | BackgroundImagePath = "MusicIcon/playBj.png", |
| | | Name = "fl", |
| | | }; |
| | | middleFl.AddChidren(whiteFl); |
| | | |
| | | btnCollectIcon = new Button |
| | | { |
| | | X = Application.GetRealWidth(273), |
| | | X = Application.GetRealWidth(264), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "MusicIcon/collect.png", |
| | | SelectedImagePath = "MusicIcon/collectSelected.png", |
| | | IsSelected= this.device.collect, |
| | | IsSelected = this.device.collect, |
| | | Name = "collect" |
| | | }; |
| | | middLayout.AddChidren(btnCollectIcon); |
| | | whiteFl.AddChidren(btnCollectIcon); |
| | | |
| | | btnCurrDeviceName = new Button |
| | | { |
| | | TextSize = TextSize.Text24, |
| | | TextColor = MusicColor.Text18Color, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(33), |
| | | Y = Application.GetRealHeight(16), |
| | | X = Application.GetRealWidth(16), |
| | | Text = this.device.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | whiteFl.AddChidren(btnCurrDeviceName); |
| | | |
| | | |
| | | btnCurrDeviceRoom = new Button |
| | | { |
| | | TextSize = TextSize.Text12, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(17), |
| | | Y = btnCurrDeviceName.Bottom + Application.GetRealHeight(4), |
| | | X = Application.GetRealWidth(16), |
| | | Text = this.device.GetRoomListName(), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | whiteFl.AddChidren(btnCurrDeviceRoom); |
| | | |
| | | cellFrame = new FrameLayout |
| | | { |
| | | X = btnCurrDeviceRoom.Right + Application.GetRealWidth(20), |
| | | Y = btnCurrDeviceName.Bottom + Application.GetRealHeight(5), |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealHeight(16), |
| | | }; |
| | | whiteFl.AddChidren(cellFrame); |
| | | |
| | | cellDiyArcSeekBar = new DiyArcSeekBar |
| | | { |
| | | X = Application.GetRealWidth(3), |
| | | Y = Application.GetRealHeight(3), |
| | | Width = cellFrame.Width + Application.GetRealWidth(-6), |
| | | Height = cellFrame.Height + Application.GetRealHeight(-6), |
| | | Progress = 60, |
| | | ProgressBarColor = MusicColor.MusicNoTxetColor, |
| | | MaxValue = 100, |
| | | MinValue = 0, |
| | | |
| | | //IsCanMove = false, |
| | | //IsCanScrolled=false, |
| | | }; |
| | | //cellFrame.AddChidren(cellDiyArcSeekBar); |
| | | |
| | | btnCell = new Button |
| | | { |
| | | TextSize = TextSize.Text10, |
| | | TextColor = MusicColor.TextColor, |
| | | Text = "60" + "%", |
| | | TextAlignment = TextAlignment.Center, |
| | | UnSelectedImagePath = "FunctionIcon/DoorLock/Cell.png", |
| | | }; |
| | | cellFrame.AddChidren(btnCell); |
| | | |
| | | |
| | | #if __IOS__ |
| | | //btnCell.Padding = new Padding(0,0,0,0); |
| | | btnCell.Width += 5; |
| | | cellFrame.Width += 5; |
| | | #else |
| | | #endif |
| | | |
| | | |
| | | //门锁状态 |
| | | doorLockFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout); |
| | | middLayout.AddChidren(doorLockFL); |
| | | doorLockFL.X = Application.GetRealWidth(40); |
| | | doorLockFL.Y = btnCollectIcon.Bottom + Application.GetRealHeight(20); |
| | | doorLockFL.AddImageView(); |
| | | doorLockFL.AddTextButtonView(); |
| | | doorLockFL.GetTextButton().TextID = StringId.shishishipin; |
| | | btnDoorLockIcon = new Button |
| | | { |
| | | X = Application.GetRealWidth(65), |
| | | Y = Application.GetRealHeight(108), |
| | | Width = Application.GetRealWidth(198), |
| | | Height = Application.GetRealWidth(200), |
| | | UnSelectedImagePath = "FunctionIcon/DoorLock/UnLocked.png", |
| | | SelectedImagePath = "FunctionIcon/DoorLock/UnLocking.png", |
| | | }; |
| | | whiteFl.AddChidren(btnDoorLockIcon); |
| | | |
| | | this.CalculatedPosition();//重新计算宽度 |
| | | |
| | | btnDoorlockStatus = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(62), |
| | | Y = btnDoorLockIcon.Bottom, |
| | | TextAlignment = TextAlignment.Center, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextID = StringId.DoorlockOpen, |
| | | TextColor = CSS_Color.WarningColor, |
| | | TextSize = 16, |
| | | }; |
| | | whiteFl.AddChidren(btnDoorlockStatus); |
| | | |
| | | int heightY = btnDoorLockIcon.Bottom + Application.GetRealHeight(133); |
| | | //实时视频 |
| | | rtvFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout); |
| | | middLayout.AddChidren(rtvFL); |
| | | rtvFL.X = Application.GetRealWidth(20); |
| | | rtvFL.Y = Application.GetRealHeight(300); |
| | | whiteFl.AddChidren(rtvFL); |
| | | rtvFL.Y = heightY; |
| | | rtvFL.X = Application.GetRealWidth(26); |
| | | rtvFL.AddImageView(); |
| | | rtvFL.AddTextButtonView(); |
| | | rtvFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/RTV.png"; |
| | | rtvFL.GetTextButton().TextID = StringId.shishishipin; |
| | | //一键开锁 |
| | | openFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout); |
| | | middLayout.AddChidren(openFL); |
| | | openFL.X = rtvFL.Right + Application.GetRealWidth(20); |
| | | openFL.Y = Application.GetRealHeight(300); |
| | | openFL.AddImageView(); |
| | | openFL.AddTextButtonView(); |
| | | openFL.GetTextButton().TextID = StringId.yijiankaisuo; |
| | | |
| | | |
| | | //临时密码 |
| | | pswFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout); |
| | | middLayout.AddChidren(pswFL); |
| | | pswFL.X = openFL.Right + Application.GetRealWidth(20); |
| | | pswFL.Y = Application.GetRealHeight(300); |
| | | whiteFl.AddChidren(pswFL); |
| | | pswFL.Y = heightY; |
| | | pswFL.X = rtvFL.Right + Application.GetRealWidth(CustomFrameLayout.interval); |
| | | pswFL.AddImageView(); |
| | | pswFL.AddTextButtonView(); |
| | | pswFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/OneOpenLock.png"; |
| | | pswFL.GetTextButton().TextID = StringId.linshimima1; |
| | | if (device.omodel.Contains("CS-DL30F-V100")) |
| | | { |
| | | rtvFL.Visible = rtvFL.Enable = false; |
| | | pswFL.X = Application.GetRealWidth(26); |
| | | } |
| | | |
| | | //历史记录 |
| | | recordFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout); |
| | | middLayout.AddChidren(recordFL); |
| | | recordFL.X = Application.GetRealWidth(20); |
| | | recordFL.Y = Application.GetRealHeight(300 + 100); |
| | | whiteFl.AddChidren(recordFL); |
| | | recordFL.Y = heightY; |
| | | recordFL.X = pswFL.Right + Application.GetRealWidth(CustomFrameLayout.interval); |
| | | recordFL.AddImageView(); |
| | | recordFL.AddTextButtonView(); |
| | | recordFL.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/HistoryList.png"; |
| | | recordFL.GetTextButton().TextID = StringId.lishijilu; |
| | | |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | { |
| | | //用户管理 |
| | | CustomFrameLayout userManagerView = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout); |
| | | whiteFl.AddChidren(userManagerView); |
| | | userManagerView.Y = heightY; |
| | | userManagerView.X = recordFL.Right + Application.GetRealWidth(CustomFrameLayout.interval); |
| | | userManagerView.AddImageView(); |
| | | userManagerView.AddTextButtonView(); |
| | | userManagerView.GetImageButton().UnSelectedImagePath = "FunctionIcon/DoorLock/DoorlockUserManager.png"; |
| | | userManagerView.GetTextButton().TextID = StringId.UserManagement; |
| | | |
| | | userManagerView.SetClickListener((fl, btnImage, btnText) => |
| | | { |
| | | var page = new VideoDoorlockUserListPage(device); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | }); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 注册事件 |
| | | /// </summary> |
| | | private void Events() |
| | | private void EventListener() |
| | | { |
| | | //返回 |
| | | this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | RemoveFromParent(); |
| | | this.RemoveFromParent(); |
| | | }; |
| | | //设置 |
| | | this.topView.clickSetBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //调用秀绕的界面 |
| | | var infoView = new UI.FunctionBaseInfoSetPage(this.device, () => |
| | | CommonMethod.Current.MainThread(() => |
| | | { |
| | | //调用秀绕的界面 |
| | | var infoView = new UI.FunctionBaseInfoSetPage(this.device, () => |
| | | { |
| | | if (this.btnDeviceName == null || this.btnRoomName == null || this.device == null) |
| | | { |
| | | return; |
| | | } |
| | | ////刷新显示 |
| | | this.btnDeviceName.Text = this.device.name; |
| | | this.btnRoomName.Text = this.device.GetRoomListName(); |
| | | this.btnCurrDeviceName.Text = this.device.name; |
| | | this.btnCurrDeviceRoom.Text = this.device.GetRoomListName(); |
| | | this.CalculatedPosition();//重新计算宽度 |
| | | |
| | | }); |
| | | infoView.actionDel += () => |
| | | { |
| | | //解绑设备后 |
| | | this.RemoveFromParent(); |
| | | this.action?.Invoke(); |
| | | |
| | | if (this.btnDeviceName == null || this.btnRoomName == null) |
| | | { |
| | | return; |
| | | } |
| | | ////刷新显示 |
| | | this.btnDeviceName.Text = this.device.name; |
| | | this.btnRoomName.Text = this.device.GetRoomListName(); |
| | | this.topView.topNameBtn.Text = this.device.name; |
| | | |
| | | ////从新计算宽度 |
| | | //this.btnDeviceName.Text = btnDeviceName.Text; |
| | | //this.btnDeviceName.Width = this.btnDeviceName.GetTextWidth(); |
| | | |
| | | //this.btnRoomName.Text = btnRoomName.Text; |
| | | //this.btnRoomName.Width = this.btnRoomName.GetTextWidth(); |
| | | |
| | | ////回调事件 |
| | | //this.SettionFinishEvent?.Invoke(); |
| | | }; |
| | | MainPage.BasePageView.AddChidren(infoView); |
| | | infoView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }); |
| | | MainPage.BasePageView.AddChidren(infoView); |
| | | infoView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | //收藏 |
| | | btnCollectIcon.MouseUpEventHandler += (sender, e) => |
| | | this.btnCollectIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnCollectIcon.IsSelected = this.device.collect = !btnCollectIcon.IsSelected; |
| | | this.device.CollectFunction(); |
| | | }; |
| | | |
| | | int delayTimeMaxValue = 0;// |
| | | var startTime = DateTime.Now; |
| | | //实时视频 |
| | | rtvFL.SetClickListener((fl, btnStateImage, btnStateText) => { }); |
| | | //一键开锁 |
| | | openFL.SetClickListener((fl, btnStateImage, btnStateText) => { }); |
| | | this.rtvFL.SetClickListener((fl, btnStateImage, btnStateText) => |
| | | { |
| | | bool isDeyayClick = false; |
| | | var clickTime = DateTime.Now; |
| | | if ((clickTime - startTime).TotalMilliseconds > delayTimeMaxValue) |
| | | { |
| | | delayTimeMaxValue = 2*1000; |
| | | startTime = clickTime; |
| | | isDeyayClick = true; |
| | | } |
| | | if (!isDeyayClick) |
| | | { |
| | | return; |
| | | } |
| | | CommonMethod.Current.SkipRTVActivity(this.device.sid, this.device.deviceId, this.device.spk, false); |
| | | |
| | | }); |
| | | var lastClickTime = DateTime.MinValue; |
| | | //临时密码 |
| | | pswFL.SetClickListener((fl, btnStateImage, btnStateText) => { }); |
| | | this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) => |
| | | { |
| | | if (lastClickTime.AddSeconds(3) > DateTime.Now) |
| | | { |
| | | return; |
| | | } |
| | | lastClickTime = DateTime.Now; |
| | | CommonMethod.Current.SkipPSWActivity(this.device.deviceId); |
| | | }); |
| | | |
| | | //历史记录 |
| | | recordFL.SetClickListener((fl, btnStateImage, btnStateText) => { }); |
| | | |
| | | this.recordFL.SetClickListener((fl, btnStateImage, btnStateText) => |
| | | { |
| | | if (lastClickTime.AddSeconds(3) > DateTime.Now) |
| | | { |
| | | return; |
| | | } |
| | | lastClickTime = DateTime.Now; |
| | | |
| | | //VideoDoorlockHistoryPage historyPage = new VideoDoorlockHistoryPage(device); |
| | | //MainPage.BasePageView.AddChidren(historyPage); |
| | | //historyPage.LoadPage(); |
| | | //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | var waitPage = new Loading(); |
| | | this.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonMethod.Current.SkipRecordActivity(this.device.deviceId); |
| | | }); |
| | | }catch(Exception ex) |
| | | { |
| | | |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }); |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 初始数据 |
| | | /// </summary> |
| | | private void ReadData() |
| | | { |
| | | CommonMethod.Current.Loading.Start(); |
| | | CommonMethod.Current.SunThread(() => |
| | | { |
| | | try |
| | | { |
| | | var videoDoorLockInfo = VideDoorLockSend.Current.GetVideoDoorLockState(this.device); |
| | | var cellInfo = VideDoorLockSend.Current.GetCellValue(this.device); |
| | | CommonMethod.Current.MainThread(() => |
| | | { |
| | | //this.cellDiyArcSeekBar.Progress = i; |
| | | //更新电量值 |
| | | this.btnCell.Text = cellInfo.remain + "%"; |
| | | if(videoDoorLockInfo.doorStatus == "open") |
| | | { |
| | | this.btnDoorLockIcon.IsSelected = true; |
| | | this.btnDoorlockStatus.TextID = StringId.DoorlockOpen; |
| | | this.btnDoorlockStatus.TextColor = CSS_Color.WarningColor; |
| | | } |
| | | else |
| | | { |
| | | this.btnDoorLockIcon.IsSelected = false; |
| | | this.btnDoorlockStatus.TextID = StringId.DoorlockClose; |
| | | this.btnDoorlockStatus.TextColor = 0xFF000000; |
| | | } |
| | | }); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonMethod.Current.Loading.Hide(); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 重新计算宽度(设备名称,房间控件) |
| | | /// </summary> |
| | | private void CalculatedPosition() |
| | | { |
| | | this.btnCurrDeviceName.Width = this.btnCurrDeviceName.GetTextWidth(); |
| | | this.btnCurrDeviceName.Width += 10; |
| | | if (this.btnCurrDeviceName.GetTextWidth() > this.btnCollectIcon.X) |
| | | { |
| | | //重新计算宽度 |
| | | this.btnCurrDeviceName.Width = this.btnCollectIcon.X + Application.GetRealWidth(-10); |
| | | } |
| | | this.btnCurrDeviceRoom.Width = this.btnCurrDeviceRoom.GetTextWidth(); |
| | | this.btnCurrDeviceRoom.Width += 10; |
| | | if (this.btnCurrDeviceRoom.GetTextWidth() > this.btnCollectIcon.X) |
| | | { |
| | | //重新计算宽度 |
| | | this.btnCurrDeviceRoom.Width = this.btnCollectIcon.X + Application.GetRealWidth(-20 - 10); |
| | | } |
| | | this.cellFrame.X = this.btnCurrDeviceRoom.Right + Application.GetRealWidth(20); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新状态 |
| | | /// </summary> |
| | | public void UpdateState(PushMessageType pushMessageType) |
| | | { |
| | | CommonMethod.Current.MainThread(() => |
| | | { |
| | | if (pushMessageType == PushMessageType.Alarm) |
| | | { |
| | | //门锁电池值 |
| | | if (this.btnCell != null) |
| | | { |
| | | //videoDoorLockPage.btnCell.Text = ""; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (this.btnDoorLockIcon != null && !this.btnDoorLockIcon.IsSelected) |
| | | { |
| | | this.btnDoorLockIcon.IsSelected = false; |
| | | } |
| | | } |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | class CustomFrameLayout : FrameLayout |
| | | { |
| | | public const int widthFrameLayout = 100; |
| | | public const int heightFrameLayout = 80; |
| | | public const int yFrameLayout = 300; |
| | | public const int xFrameLayout = 20; |
| | | public const int interval = 20;//行中的列间隔值 |
| | | public const int widthFrameLayout = 48; |
| | | public const int heightFrameLayout = 53; |
| | | public const int yFrameLayout = 442; |
| | | public const int xFrameLayout = 41; |
| | | public const int interval = 30;//行中的列间隔值 |
| | | |
| | | public CustomFrameLayout(int width, int height, int x = 0, int y = 0) |
| | | { |
| | |
| | | } |
| | | Button btnStateImage = new Button |
| | | { |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "MusicIcon/collect.png", |
| | | SelectedImagePath = "MusicIcon/collectSelected.png", |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | Gravity = Gravity.TopCenter, |
| | | Name = "btnStateImage", |
| | | |
| | | }; |
| | | Button btnStateText = new Button |
| | | { |
| | | Y = Application.GetRealHeight(20), |
| | | Y = Application.GetRealHeight(4), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(20), |
| | | TextID = StringId.dangqianmenweiguan, |
| | | TextSize = TextSize.Text14, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text12, |
| | | TextColor = MusicColor.TextCancelColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Name = "btnStateText" |
| | | |
| | | |
| | | Name = "btnStateText", |
| | | IsMoreLines = true, |
| | | }; |
| | | public void AddImageView() |
| | | { |
| | |
| | | { |
| | | EventHandler<MouseEventArgs> click = (sender, e) => |
| | | { |
| | | if (action == null) |
| | | { |
| | | return; |
| | | } |
| | | action(this, btnStateImage, btnStateText); |
| | | action?.Invoke(this, btnStateImage, btnStateText); |
| | | }; |
| | | this.MouseUpEventHandler += click; |
| | | btnStateImage.MouseUpEventHandler += click; |
| | |
| | | return false; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 表示来自那个界面 |
| | | /// </summary> |
| | | public enum Comerom |
| | | { |
| | | function,//功能 |
| | | collect,//收藏 |
| | | room,//房间 |
| | | } |
| | | |
| | | } |