| | |
| | | using HDL_ON.Stan; |
| | | using ZXing.QrCode.Internal; |
| | | using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod; |
| | | using HDL_ON.Entity; |
| | | |
| | | namespace HDL_ON.UI.UI2.FuntionControlView.Video |
| | | { |
| | |
| | | /// <param name="listVideo">门口机列表</param> |
| | | /// <param name="listCall">通话记录列表</param> |
| | | /// <param name="video">当前的可视对讲</param> |
| | | //public void Show(List<VideoMethod.FlVideo> listVideo, List<CallView> listCall, VideoClouds video) |
| | | public void Show() |
| | | public void Show(List<VideoMethod.FlVideo> listVideo, List<CallView> listCall, VideoClouds video) |
| | | { |
| | | |
| | | #region 布局界面 |
| | | this.BackgroundColor = MusicColor.ViewColor; |
| | | var topView = new TopView(); |
| | |
| | | pageView.AddChidren(view1); |
| | | var view2 = new FrameLayout(); |
| | | pageView.AddChidren(view2); |
| | | View1(view1); |
| | | View2(view2); |
| | | View1(view1, listVideo, video); |
| | | View2(view2, listCall, video); |
| | | Button btn11 = new Button |
| | | { |
| | | X = Application.GetRealWidth(170), |
| | |
| | | /// <param name="view1">父控件</param> |
| | | /// <param name="list">门口机列表</param> |
| | | /// <param name="videoClouds">当前的可视对讲</param> |
| | | void View1(FrameLayout view1) |
| | | void View1(FrameLayout view1, List<VideoMethod.FlVideo> list, VideoClouds videoClouds) |
| | | { |
| | | |
| | | new System.Threading.Thread(() => |
| | | #region 布局界面 |
| | | var bjFl = new FrameLayout |
| | | { |
| | | var list = VideoSend.GetVideoInfoList(FunctionList.List.videoIntercom); |
| | | Application.RunOnMainThread(() => |
| | | Y = Application.GetRealHeight(24), |
| | | X = Application.GetRealWidth(24), |
| | | Height = Application.GetRealHeight(526), |
| | | Width = Application.GetRealWidth(327), |
| | | BackgroundImagePath = "MusicIcon/playBj.png", |
| | | }; |
| | | view1.AddChidren(bjFl); |
| | | /// <summary> |
| | | /// 汉字 |
| | | /// </summary> |
| | | Button nameBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(16), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealHeight(33), |
| | | TextColor = MusicColor.MusicTxet14Color, |
| | | TextSize = TextSize.Text24, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | //Text = "可视对讲", |
| | | TextID = StringId.keshiduijiang, |
| | | }; |
| | | bjFl.AddChidren(nameBtn); |
| | | /// <summary> |
| | | /// 区域名称 |
| | | /// </summary> |
| | | Button regionBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(53), |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(17), |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | TextSize = TextSize.Text12, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = "123456" |
| | | }; |
| | | // bjFl.AddChidren(regionBtn); |
| | | /// <summary> |
| | | ///收藏图标 |
| | | /// </summary> |
| | | Button collectIconBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(273), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "MusicIcon/collect.png", |
| | | SelectedImagePath = "MusicIcon/collectSelected.png", |
| | | }; |
| | | // bjFl.AddChidren(collectIconBtn); |
| | | ///可视对讲图标 |
| | | Button intercomBtnIcon = new Button |
| | | { |
| | | X = Application.GetRealWidth(84), |
| | | Y = Application.GetRealHeight(118), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealWidth(160), |
| | | UnSelectedImagePath = "VideoIcon/keshiduijiang.png", |
| | | |
| | | }; |
| | | bjFl.AddChidren(intercomBtnIcon); |
| | | |
| | | var vv = new VerticalScrolViewLayout |
| | | { |
| | | Y = Application.GetRealHeight(306), |
| | | Height = Application.GetRealHeight(220), |
| | | Width = Application.GetRealWidth(327), |
| | | }; |
| | | bjFl.AddChidren(vv); |
| | | if (list.Count > 0) |
| | | { |
| | | //门禁二维码固定有的,虚拟一个出来 |
| | | list.Add(new VideoMethod.FlVideo { aliasName = Language.StringByID(StringId.menjinerweima), devType = "100" }); |
| | | } |
| | | //数组个数 |
| | | //int value = 15; |
| | | //先计算数据所需要的很高度; |
| | | int l = 0; |
| | | if (list.Count % 3 == 0) |
| | | { |
| | | l = list.Count / 3; |
| | | } |
| | | else |
| | | { |
| | | |
| | | l = (list.Count / 3) + 1; |
| | | } |
| | | var fL = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight((48 + 24) * l), |
| | | |
| | | }; |
| | | vv.AddChidren(fL); |
| | | int line = 0; |
| | | #endregion |
| | | for (int i = 1, j = 0; i <= list.Count; i++, j++) |
| | | { |
| | | var video = list[i - 1]; |
| | | #region |
| | | var fLayout = new FrameLayout |
| | | { |
| | | #region 布局界面 |
| | | var bjFl = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(24), |
| | | X = Application.GetRealWidth(24), |
| | | Height = Application.GetRealHeight(526), |
| | | Width = Application.GetRealWidth(327), |
| | | BackgroundImagePath = "MusicIcon/playBj.png", |
| | | }; |
| | | view1.AddChidren(bjFl); |
| | | /// <summary> |
| | | /// 汉字 |
| | | /// </summary> |
| | | Button nameBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(16), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealHeight(33), |
| | | TextColor = MusicColor.MusicTxet14Color, |
| | | TextSize = TextSize.Text24, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | //Text = "可视对讲", |
| | | TextID = StringId.keshiduijiang, |
| | | }; |
| | | bjFl.AddChidren(nameBtn); |
| | | /// <summary> |
| | | /// 区域名称 |
| | | /// </summary> |
| | | Button regionBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(53), |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(17), |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | TextSize = TextSize.Text12, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = "123456" |
| | | }; |
| | | bjFl.AddChidren(regionBtn); |
| | | /// <summary> |
| | | ///收藏图标 |
| | | /// </summary> |
| | | Button collectIconBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(273), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "MusicIcon/collect.png", |
| | | SelectedImagePath = "MusicIcon/collectSelected.png", |
| | | }; |
| | | bjFl.AddChidren(collectIconBtn); |
| | | ///可视对讲图标 |
| | | Button intercomBtnIcon = new Button |
| | | { |
| | | X = Application.GetRealWidth(84), |
| | | Y = Application.GetRealHeight(118), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealWidth(160), |
| | | UnSelectedImagePath = "VideoIcon/keshiduijiang.png", |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(48), |
| | | X = Application.GetRealWidth(31 + (58 + 50) * j), |
| | | Y = Application.GetRealHeight(20 + (48 + 24) * line), |
| | | |
| | | }; |
| | | bjFl.AddChidren(intercomBtnIcon); |
| | | }; |
| | | fL.AddChidren(fLayout); |
| | | |
| | | var vv = new VerticalScrolViewLayout |
| | | var iconBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(11), |
| | | Width = Application.GetRealWidth(28), |
| | | Height = Application.GetRealWidth(28), |
| | | UnSelectedImagePath = "VideoIcon/weiqiangji.png", |
| | | }; |
| | | fLayout.AddChidren(iconBtn); |
| | | |
| | | var deviceNameBtn = new Button |
| | | { |
| | | Y = iconBtn.Bottom + Application.GetRealHeight(6), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealHeight(14), |
| | | TextSize = TextSize.Text10, |
| | | TextColor = CSS.CSS_Color.TextualColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = video.aliasName, |
| | | }; |
| | | fLayout.AddChidren(deviceNameBtn); |
| | | |
| | | var clickBtn = new Button { Tag = video }; |
| | | |
| | | fLayout.AddChidren(clickBtn); |
| | | if (i % 3 == 0) |
| | | { |
| | | //满一行重置j=0值; |
| | | j = -1; |
| | | line += 1; |
| | | } |
| | | getIconAndText(video, iconBtn); |
| | | #endregion |
| | | //门口机的点击事件 |
| | | clickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var flVideo = clickBtn.Tag as FlVideo; |
| | | if (flVideo.devType == "100") |
| | | { |
| | | Y = Application.GetRealHeight(306), |
| | | Height = Application.GetRealHeight(220), |
| | | Width = Application.GetRealWidth(327), |
| | | }; |
| | | bjFl.AddChidren(vv); |
| | | if (list.Count > 0) |
| | | { |
| | | //门禁二维码固定有的,虚拟一个出来 |
| | | list.Add(new VideoMethod.FlVideo { aliasName = Language.StringByID(StringId.menjinerweima), devType = "100" }); |
| | | } |
| | | //数组个数 |
| | | //int value = 15; |
| | | //先计算数据所需要的很高度; |
| | | int l = 0; |
| | | if (list.Count % 3 == 0) |
| | | { |
| | | l = list.Count / 3; |
| | | //门禁二维码固定有的 |
| | | VideoSend.GetQRcode(this, videoClouds, (tag, paw) => |
| | | { |
| | | if (tag) |
| | | { |
| | | //注意:密码有可能延时1分钟生效 |
| | | View.ShowDialog showDialog = new View.ShowDialog(); |
| | | showDialog.QRcode(paw); |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | l = (list.Count / 3) + 1; |
| | | } |
| | | var fL = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight((48 + 24) * l), |
| | | }; |
| | | vv.AddChidren(fL); |
| | | int line = 0; |
| | | #endregion |
| | | for (int i = 1, j = 0; i <= list.Count; i++, j++) |
| | | { |
| | | var video = list[i - 1]; |
| | | #region |
| | | var fLayout = new FrameLayout |
| | | if (string.IsNullOrEmpty(flVideo.uuid)) |
| | | { |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(48), |
| | | X = Application.GetRealWidth(31 + (58 + 50) * j), |
| | | Y = Application.GetRealHeight(20 + (48 + 24) * line), |
| | | |
| | | }; |
| | | fL.AddChidren(fLayout); |
| | | |
| | | var iconBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(11), |
| | | Width = Application.GetRealWidth(28), |
| | | Height = Application.GetRealWidth(28), |
| | | UnSelectedImagePath = "VideoIcon/weiqiangji.png", |
| | | }; |
| | | fLayout.AddChidren(iconBtn); |
| | | |
| | | var deviceNameBtn = new Button |
| | | { |
| | | Y = iconBtn.Bottom + Application.GetRealHeight(6), |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealHeight(14), |
| | | TextSize = TextSize.Text10, |
| | | TextColor = CSS.CSS_Color.TextualColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = video.aliasName, |
| | | }; |
| | | fLayout.AddChidren(deviceNameBtn); |
| | | |
| | | var clickBtn = new Button { Tag = video }; |
| | | |
| | | fLayout.AddChidren(clickBtn); |
| | | if (i % 3 == 0) |
| | | { |
| | | //满一行重置j=0值; |
| | | j = -1; |
| | | line += 1; |
| | | new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.peizhicanshuyouyichang)); |
| | | } |
| | | getIconAndText(video, iconBtn); |
| | | #endregion |
| | | //门口机的点击事件 |
| | | clickBtn.MouseUpEventHandler += (sender, e) => |
| | | ESVideoInfo eSVideoInfo = new ESVideoInfo |
| | | { |
| | | var flVideo = clickBtn.Tag as VideoMethod.FlVideo; |
| | | if (flVideo.devType == "100") |
| | | { |
| | | //门禁二维码固定有的 |
| | | VideoSend.GetQRcode(this, FunctionList.List.videoIntercom, (tag, paw) => |
| | | { |
| | | if (tag) |
| | | { |
| | | //注意:密码有可能延时1分钟生效 |
| | | View.ShowDialog showDialog = new View.ShowDialog(); |
| | | showDialog.QRcode(paw); |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | if (string.IsNullOrEmpty(flVideo.uuid)) |
| | | { |
| | | new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.peizhicanshuyouyichang)); |
| | | } |
| | | ESVideoInfo eSVideoInfo = new ESVideoInfo |
| | | { |
| | | ESVideoUUID = getUuid(flVideo.uuid), |
| | | DeviceName = flVideo.aliasName, |
| | | roomno = FunctionList.List.videoIntercom.flRoomId, |
| | | unitno = FunctionList.List.videoIntercom.flBuildingId, |
| | | }; |
| | | ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo); |
| | | } |
| | | |
| | | |
| | | ESVideoUUID = getUuid(flVideo.uuid), |
| | | DeviceName = flVideo.aliasName, |
| | | roomno = videoClouds.flRoomId, |
| | | unitno = videoClouds.flBuildingId, |
| | | }; |
| | | ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo); |
| | | } |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | |
| | | }; |
| | | } |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 第二个界面 |
| | |
| | | /// <param name="view2">父控件</param> |
| | | /// <param name="listCall">通话记录列表</param> |
| | | /// <param name="video">当前的可视对讲</param> |
| | | void View2(FrameLayout view2) |
| | | void View2(FrameLayout view2, List<CallView> listCall, VideoClouds video) |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | var listCall = new HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod().getCall(FunctionList.List.videoIntercom.id); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var bjFl = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(24), |
| | | X = Application.GetRealWidth(24), |
| | | Height = Application.GetRealHeight(526), |
| | | Width = Application.GetRealWidth(327), |
| | | BackgroundImagePath = "MusicIcon/playBj.png", |
| | | }; |
| | | view2.AddChidren(bjFl); |
| | | /// <summary> |
| | | /// 汉字 |
| | | /// </summary> |
| | | Button nameBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(16), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealHeight(33), |
| | | TextColor = MusicColor.MusicTxet14Color, |
| | | TextSize = TextSize.Text24, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = StringId.tonghuajilu, |
| | | }; |
| | | bjFl.AddChidren(nameBtn); |
| | | /// <summary> |
| | | /// 云端照片只保留30天 |
| | | /// </summary> |
| | | Button regionBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(53), |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(17), |
| | | TextColor = MusicColor.SelectedColor, |
| | | TextSize = TextSize.Text12, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = StringId.baolu30, |
| | | }; |
| | | bjFl.AddChidren(regionBtn); |
| | | |
| | | var vv = new VerticalRefreshLayout |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(58), |
| | | Height = Application.GetRealHeight(458), |
| | | Width = Application.GetRealWidth(295), |
| | | }; |
| | | bjFl.AddChidren(vv); |
| | | vv.BeginHeaderRefreshingAction += () => |
| | | { |
| | | VideoMethod videoMethod = new VideoMethod(); |
| | | var list = videoMethod.getCall(FunctionList.List.videoIntercom.id); |
| | | RefreshView(vv, list); |
| | | //关闭刷新View; |
| | | vv.EndHeaderRefreshing(); |
| | | }; |
| | | //RefreshView(vv, listCall); |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | var bjFl = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(24), |
| | | X = Application.GetRealWidth(24), |
| | | Height = Application.GetRealHeight(526), |
| | | Width = Application.GetRealWidth(327), |
| | | BackgroundImagePath = "MusicIcon/playBj.png", |
| | | }; |
| | | view2.AddChidren(bjFl); |
| | | /// <summary> |
| | | /// 汉字 |
| | | /// </summary> |
| | | Button nameBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(16), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealHeight(33), |
| | | TextColor = MusicColor.MusicTxet14Color, |
| | | TextSize = TextSize.Text24, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = StringId.tonghuajilu, |
| | | }; |
| | | bjFl.AddChidren(nameBtn); |
| | | /// <summary> |
| | | /// 云端照片只保留30天 |
| | | /// </summary> |
| | | Button regionBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(53), |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealHeight(17), |
| | | TextColor = MusicColor.SelectedColor, |
| | | TextSize = TextSize.Text12, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = StringId.baolu30, |
| | | }; |
| | | bjFl.AddChidren(regionBtn); |
| | | |
| | | var vv = new VerticalRefreshLayout |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(58), |
| | | Height = Application.GetRealHeight(458), |
| | | Width = Application.GetRealWidth(295), |
| | | }; |
| | | bjFl.AddChidren(vv); |
| | | vv.BeginHeaderRefreshingAction += () => |
| | | { |
| | | VideoMethod videoMethod = new VideoMethod(); |
| | | var list = videoMethod.GetCall(video.id); |
| | | RefreshView(vv, list); |
| | | //关闭刷新View; |
| | | vv.EndHeaderRefreshing(); |
| | | }; |
| | | RefreshView(vv, listCall); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 通话记录刷新界面 |