wjc
2023-08-09 922dcfb535b7c9d8bd4ab1d97ebc50b49237b0df
HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs
@@ -9,6 +9,7 @@
using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock;
using HDL_ON.UI.UI2.Intelligence.Automation;
using System.Linq;
using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks
{
@@ -18,6 +19,10 @@
    public class AksPage : FrameLayout
    {
        #region ■ 变量声明___________________________
        /// <summary>
        /// 遥控器列表
        /// </summary>
        private List<RemoteControlEntity> remoteControlList;
        /// <summary>
        /// 设备
        /// </summary>
@@ -55,6 +60,8 @@
        /// 记录当前设备
        /// </summary>
        public IntType currnetIntType= IntType.none;
        public VerticalScrolViewLayout vv;
        #endregion
@@ -114,7 +121,7 @@
            };
            this.AddChidren(vv);
            //进来默认播放器界面
            this.SwitchUI(IntType.Player);
            //this.SwitchUI(IntType.Player);
        }
        /// <summary>
        /// 注册事件
@@ -171,14 +178,29 @@
            {
                try
                {
                    this.remoteControlList = SendMethod.Current.GetRemoteControlLits(this.device.deviceId);
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    CommonMethod.Current.MainThread(() =>
                    {
                        CommonMethod.Current.Loading.Hide();
                        if (this.remoteControlList.Count > 0)
                        {
                            if (string.IsNullOrEmpty(this.GetValueString(IntType.Player)))
                            {
                                //默认取第一位
                                this.SwitchUI((IntType)this.remoteControlList[0].type);
                            }
                            else
                            {
                                //有播放类型遥控器优先显示
                                this.SwitchUI(IntType.Player);
                            }
                        }
                    });
                }
            });
@@ -196,10 +218,11 @@
            {
                return;
            }
            if (vv != null)
            if (this.vv == null)
            {
                vv.RemoveAll();
                return;
            }
            this.vv.RemoveAll();
            this.currnetIntType = type;
            switch (type)
            {
@@ -334,13 +357,48 @@
        /// <returns></returns>
        private Dictionary<IntType, string> GetTypeDictionary()
        {
            if (this.remoteControlList == null || this.remoteControlList.Count == 0)
            {
                return new Dictionary<IntType, string>();
            }
            var dic = new Dictionary<IntType, string>();
            dic.Add(IntType.Player, Language.StringByID(StringId.bofangqi));
            dic.Add(IntType.HiFi, Language.StringByID(StringId.gongfan));
            dic.Add(IntType.TV, Language.StringByID(StringId.dianshi));
            dic.Add(IntType.STB, Language.StringByID(StringId.jidinghe));
            dic.Add(IntType.Projector, Language.StringByID(StringId.touyingyi));
            dic.Add(IntType.Control, Language.StringByID(StringId.xuniyaokongqi));
            foreach (var o in this.remoteControlList)
            {
                switch (o.type)
                {
                    case (int)IntType.Player:
                        {
                            dic.Add(IntType.Player, Language.StringByID(StringId.bofangqi));
                        }
                        break;
                    case (int)IntType.HiFi:
                        {
                            dic.Add(IntType.HiFi, Language.StringByID(StringId.gongfan));
                        }
                        break;
                    case (int)IntType.TV:
                        {
                            dic.Add(IntType.TV, Language.StringByID(StringId.dianshi));
                        }
                        break;
                    case (int)IntType.STB:
                        {
                            dic.Add(IntType.STB, Language.StringByID(StringId.jidinghe));
                        }
                        break;
                    case (int)IntType.Projector:
                        {
                            dic.Add(IntType.Projector, Language.StringByID(StringId.touyingyi));
                        }
                        break;
                    case (int)IntType.Control:
                        {
                            dic.Add(IntType.Control, Language.StringByID(StringId.xuniyaokongqi));
                        }
                        break;
                }
            }
            return dic;
        }
        /// <summary>