From 922dcfb535b7c9d8bd4ab1d97ebc50b49237b0df Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期三, 09 八月 2023 14:36:42 +0800 Subject: [PATCH] 2023年08月09日14:36:17 --- HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs | 80 ++++++++++++++++++++++++++++++++++----- 1 files changed, 69 insertions(+), 11 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs index b2d9217..3c9bb3f 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksPage.cs +++ b/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> -- Gitblit v1.8.0