陈嘉乐
2021-03-29 232070c7a697bd5c7e3cd5115da22fd9a749e3e0
HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs
@@ -1,13 +1,15 @@
using System;
using HDL_ON.UI.Music;
using System.Collections.Generic;
using Shared;
using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod;
namespace HDL_ON.UI.UI2.FuntionControlView.Video
{
    public class MainView : FrameLayout
    {
        public void Show()
        public void Show(List<ESVideoInfo> listVideo, List<CallView> listCall)
        {
            this.BackgroundColor = MusicColor.ViewColor;
            var topView = new TopView();
            this.AddChidren(topView.TopFLayoutView());
@@ -28,8 +30,8 @@
            pageView.AddChidren(view1);
            var view2 = new FrameLayout();
            pageView.AddChidren(view2);
            View1(view1);
            View2(view2);
            View1(view1, listVideo);
            View2(view2, listCall);
            Button btn11 = new Button
            {
                X = Application.GetRealWidth(170),
@@ -91,9 +93,9 @@
        /// 第一个界面
        /// </summary>
        /// <param name="view1">父控件</param>
        void View1(FrameLayout view1)
        void View1(FrameLayout view1, List<ESVideoInfo> list)
        {
            var bjFl = new FrameLayout
            {
                Y = Application.GetRealHeight(24),
@@ -158,24 +160,25 @@
            };
            bjFl.AddChidren(intercomBtnIcon);
            var vv = new VerticalScrolViewLayout {
            var vv = new VerticalScrolViewLayout
            {
                Y = Application.GetRealHeight(306),
                Height = Application.GetRealHeight(220),
                Width = Application.GetRealWidth(327),
            };
            bjFl.AddChidren(vv);
            //数组个数
            int value = 15;
            //int value = 15;
            //先计算数据所需要的很高度;
            int l = 0;
            if (value % 3 == 0)
            if (list.Count % 3 == 0)
            {
                l = value / 3;
                l = list.Count / 3;
            }
            else
            {
                l = (value / 3) + 1;
                l = (list.Count / 3) + 1;
            }
            var fL = new FrameLayout
            {
@@ -184,8 +187,10 @@
            };
            vv.AddChidren(fL);
            int line = 0;
            for (int i = 1, j = 0; i <= value; i++, j++)
            for (int i = 1, j = 0; i <= list.Count; i++, j++)
            {
                var video = list[i - 1];
                var fLayout = new FrameLayout
                {
                    Width = Application.GetRealWidth(50),
@@ -213,11 +218,12 @@
                    TextSize = TextSize.Text10,
                    TextColor = CSS.CSS_Color.TextualColor,
                    TextAlignment = TextAlignment.Center,
                    Text="查看单元机"
                    Text = video.DeviceName,
                };
                fLayout.AddChidren(iconNameBtn);
                var clickBtn = new Button { Tag = i };
                var clickBtn = new Button { Tag = video };
                fLayout.AddChidren(clickBtn);
                if (i % 3 == 0)
                {
@@ -228,35 +234,9 @@
                // GetIconAndText(i, deviceIconBtn, iconNameBtn);
                clickBtn.MouseUpEventHandler += (sender, e) =>
                {
                    var eSVideoInfo = clickBtn.Tag as ESVideoInfo;
                    ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo);
                    ////1=空调;2=电视;3=风扇;4=机顶盒;5=DVD/EVD/VCD;6=投影仪;7=自定义;
                    //int if_value = int.Parse(clickBtn.Tag.ToString());
                    //if (if_value == 7)
                    //{
                    //    Method method = new Method();
                    //    method.AddControl(this, (control) =>
                    //    {
                    //        AddButton addButton = new AddButton();
                    //        MainPage.BasePageView.AddChidren(addButton);
                    //        addButton.Show(control);
                    //        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    //    });
                    //}
                    //else
                    //{
                    //    if (DeviceTypeList.Count == 0)
                    //    {
                    //        GetDeviceTypeList(true, () =>
                    //        {
                    //            DeviceTypeViewClick(if_value);
                    //        });
                    //    }
                    //    else
                    //    {
                    //        DeviceTypeViewClick(if_value);
                    //    }
                    //}
                };
            }
@@ -266,9 +246,9 @@
        /// 第二个界面
        /// </summary>
        /// <param name="view2">父控件</param>
        void View2(FrameLayout view2)
        void View2(FrameLayout view2, List<CallView> listCall)
        {
            var bjFl = new FrameLayout
            {
                Y = Application.GetRealHeight(24),
@@ -317,24 +297,28 @@
                Width = Application.GetRealWidth(295),
            };
            bjFl.AddChidren(vv);
            for (int i = 0; i < 6; i++)
            for (int i = 0; i < listCall.Count; i++)
            {
                if (i == 0|| i == 2)
                var year = listCall[i];
                View.FrameLayout50 frameLayout50 = new View.FrameLayout50();
                vv.AddChidren(frameLayout50.FLayoutView());
                for (int j = 0; j < year.callList.Count; j++)
                {
                    View.FrameLayout50 frameLayout50 = new View.FrameLayout50();
                    vv.AddChidren(frameLayout50.FLayoutView());
                }
                else
                {
                    var call = year.callList[j];
                    View.FrameLayout60 frameLayout60 = new View.FrameLayout60();
                    vv.AddChidren(frameLayout60.FLayoutView());
                }
            }
        }
        public string getTime(string str)
        {
            var dd = Convert.ToDateTime(str);
            var time = dd.ToString("HH") + ":" + dd.ToString("mm");
            return time;
        }
    }
}