HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-06-10 dce6c3481a37216292724013ff9d2b75ceb82f86
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs
@@ -1,4 +1,5 @@
using Shared.Common;
using Shared.Phone.UserCenter.SmartSound;
using System;
using System.Collections.Generic;
using System.Text;
@@ -12,7 +13,10 @@
    public class DeviceListMainForm : EditorCommonForm
    {
        #region ■ 变量声明___________________________
        /// <summary>
        /// 智能音箱
        /// </summary>
        private MySmartSoundControl smmartSoundView = null;
        /// <summary>
        /// 网关控件
        /// </summary>
@@ -86,6 +90,18 @@
            //清空bodyFrame
            this.ClearBodyFrame();
            smmartSoundView = new MySmartSoundControl();
            bodyFrameLayout.AddChidren(smmartSoundView);
            smmartSoundView.InitControl();
            //当前不是虚拟住宅的话
            if (Config.Instance.Home.IsVirtually == false)
            {
                smmartSoundView.ButtonClickEvent += (sernder, e) =>
                {
                    var form = new SmartSoundListForm();
                    form.AddForm();
                };
            }
            //初始化网关行控件
            GatewayResourse.NowSelectGatewayId = GatewayResourse.AppOldSelectGatewayId;
            var nowGateway = HdlGatewayLogic.Current.GetLocalGateway(GatewayResourse.AppOldSelectGatewayId);
@@ -232,7 +248,7 @@
            //提示新版本
            var btnNew = new InformationTipView(rowMenu.btnIcon);
            btnNew.Visible = false;
            rowMenu.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEventOnly);
            rowMenu.frameTable.AddChidren(btnNew, ChidrenBindMode.BindEvent);
            rowMenu.AddTag("btnNew", btnNew);
            //检测设备是否拥有定位的功能
@@ -643,7 +659,7 @@
                if (HdlGatewayLogic.Current.GetRealGateway(ref realWay, nowGateway) == true)
                {
                    //重新设置住宅ID(这个应该是不经过APP,直接把网关恢复了出厂设置)
                    if (HdlGatewayLogic.Current.HomeIdIsEmpty(realWay.getGatewayBaseInfo.HomeId) == true)
                    if (HdlGatewayLogic.Current.HomeIdIsEmpty(realWay.HomeId) == true)
                    {
                        //显示进度条
                        ProgressBar.Show();
@@ -726,7 +742,7 @@
            {
                return;
            }
            if (HdlGatewayLogic.Current.GetGatewayId(gateWay) == this.gatewayViewRow.zbGatewayId)
            if (gateWay.GwId == this.gatewayViewRow.zbGatewayId)
            {
                Application.RunOnMainThread(() =>
                {
@@ -1145,9 +1161,10 @@
                this.UseClickStatu = false;
                if (i_zbGateway != null)
                {
                    this.zbGatewayId = HdlGatewayLogic.Current.GetGatewayId(i_zbGateway);
                    this.zbGatewayId = i_zbGateway.GwId;
                }
                this.BackgroundColor = UserCenterColor.Current.White;
                this.Y = Application.GetRealHeight(174);
                this.Height = Application.GetRealHeight(173);
            }
@@ -1262,7 +1279,55 @@
                }
            }
        }
        #endregion
        #region ■ 自定义智能音箱控件_____________________
        /// <summary>
        /// 自定义网关控件
        /// </summary>
        private class MySmartSoundControl : FrameRowControl
        {
            /// <summary>
            /// 网关名字控件
            /// </summary>
            private NormalViewControl btnName = null;
            /// <summary>
            /// 自定音箱关控件
            /// </summary>
            public MySmartSoundControl()
            {
                this.UseClickStatu = false;
                this.BackgroundColor = UserCenterColor.Current.White;
                this.Height = Application.GetRealHeight(173);
                //this.InitControl();
            }
            /// <summary>
            /// 初始化控件
            /// </summary>
            public void InitControl()
            {
                //图标
                var btnIcon = this.AddLeftIcon(81);
                btnIcon.UnSelectedImagePath = "SmartSound/SoundIcon.png";
                //显示文本
                btnName = this.AddLeftCaption(string.Empty, 700);
                btnName.Height = Application.GetRealHeight(60);
                btnName.TextSize = 15;
                btnName.Y = Application.GetRealHeight(57);
                btnName.Text = "小度小度";
                this.AddRightArrow();
                this.AddMostRightView("", 300, false).Name = "smartSoundLayout";
                this.AddBottomLine();
            }
        }
        #endregion
    }
}