| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | |
| | |
| | | using Shared; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity; |
| | | using Android.Graphics; |
| | | using Android.Media; |
| | | using Java.Lang; |
| | | using Java.Util.Streams; |
| | | using static Android.Graphics.BlurMaskFilter; |
| | | using static Android.Icu.Text.IDNA; |
| | | using System.Threading; |
| | | |
| | | namespace HDL_ON.UI.UI2.FuntionControlView.Aks |
| | | { |
| | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取【自定义】遥控器按键列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<KeypadEntity> GetZdiKeypadList(RemoteControlEntity remoteControlEntity) |
| | | { |
| | | List<KeypadEntity> keypads = new List<KeypadEntity>(); |
| | | string aksIcon = "AksIcon/"; |
| | | keypads.Add(new KeypadEntity { keypad = "on_off", name = "开/关", localIconAddress = $"{aksIcon}kai.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "info", name = "信息", localIconAddress = $"{aksIcon}guan.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "collect", name = "收藏", localIconAddress = $"{aksIcon}caidan.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "movie", name = "电影", localIconAddress = $"{aksIcon}jingyin.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "volume_up", name = "音量+", localIconAddress = $"{aksIcon}yinliangjia.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "volume_down", name = "音量-", localIconAddress = $"{aksIcon}yinliangjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "recreation", name = "娱乐", localIconAddress = $"{aksIcon}huikan.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "tv", name = "电视", localIconAddress = $"{aksIcon}quxiao.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "red", name = "红按键", localIconAddress = $"{aksIcon}gfyingliangjia.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "yellow", name = "黄按键", localIconAddress = $"{aksIcon}gf_ingliangjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "blue", name = "蓝按键", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "number_0", name = "0" }); |
| | | keypads.Add(new KeypadEntity { keypad = "number_1", name = "1" }); |
| | | keypads.Add(new KeypadEntity { keypad = "number_2", name = "2" }); |
| | | keypads.Add(new KeypadEntity { keypad = "number_3", name = "3" }); |
| | | keypads.Add(new KeypadEntity { keypad = "number_4", name = "4" }); |
| | | keypads.Add(new KeypadEntity { keypad = "number_5", name = "5" }); |
| | | keypads.Add(new KeypadEntity { keypad = "number_6", name = "6" }); |
| | | keypads.Add(new KeypadEntity { keypad = "number_7", name = "7" }); |
| | | keypads.Add(new KeypadEntity { keypad = "number_8", name = "8" }); |
| | | keypads.Add(new KeypadEntity { keypad = "number_9", name = "9" }); |
| | | keypads.Add(new KeypadEntity { keypad = "audio_track", name = "音轨", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "subtitle", name = "字幕", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "mute", name = "静音", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "main", name = "主界面", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "home", name = "主页", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "ch_up", name = "频道+", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "ch_down", name = "频道-", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "look_back", name = "回看", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "cancel", name = "取消", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "key_up", name = "上", localIconAddress = $"{aksIcon}shang.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "key_down", name = "下", localIconAddress = $"{aksIcon}xia.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "key_left", name = "左", localIconAddress = $"{aksIcon}zuo.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "key_right", name = "右", localIconAddress = $"{aksIcon}you.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "key_ok", name = "确认", localIconAddress = $"{aksIcon}ok.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "menu", name = "菜单" }); |
| | | keypads.Add(new KeypadEntity { keypad = "part_up", name = "上一部" }); |
| | | keypads.Add(new KeypadEntity { keypad = "part_down", name = "下一部" }); |
| | | keypads.Add(new KeypadEntity { keypad = "fast_rewind", name = "快退" }); |
| | | keypads.Add(new KeypadEntity { keypad = "fast_forward", name = "快进" }); |
| | | keypads.Add(new KeypadEntity { keypad = "stop", name = "停止" }); |
| | | keypads.Add(new KeypadEntity { keypad = "pause", name = "暂停", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "play", name = "播放", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "lamp", name = "灯光1", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | keypads.Add(new KeypadEntity { keypad = "lamp_plc", name = "灯光2", localIconAddress = $"{aksIcon}zdyanjian.png" }); |
| | | this.CheckKeyIsClick(remoteControlEntity, keypads); |
| | | return keypads; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取【数字】按键列表 |
| | |
| | | { |
| | | cornerFram.selectKeyAction += (keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }; |
| | | |
| | | if (gfSingleFramLayout != null) |
| | |
| | | /// </summary> |
| | | /// <param name="keypad"><按键标识/param> |
| | | /// <param name="keyName"><按键名称(打印用的)/param> |
| | | private void KeyControl(string keypad, string keyName) |
| | | /// <param name="isSupport"><是否支持控制/param> |
| | | private void KeyControl(string keypad, string keyName, bool isSupport) |
| | | { |
| | | //CommonMethod.Current.Loading.Start(); |
| | | CommonMethod.Current.SunThread(() => |
| | | { |
| | | try |
| | | { |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName); |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName, isSupport); |
| | | } |
| | | catch { } |
| | | finally |
| | |
| | | //功能键控制 |
| | | cornerTopFram.selectKeyAction += (keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }; |
| | | //数字键控制 |
| | | numberFrame.selectKeyAction += (keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }; |
| | | //菜单上按键 |
| | | menuFram.SetTopClickListener((keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | //菜单下按键 |
| | | menuFram.SetBottomClickListener((keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | //菜单左按键 |
| | | menuFram.SetLeftClickListener((keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | //菜单右按键 |
| | | menuFram.SetRightClickListener((keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | //菜单ok按键 |
| | | menuFram.SetOkClickListener((keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | |
| | | if (jdhSingleFramLayout != null) |
| | |
| | | /// </summary> |
| | | /// <param name="keypad"><按键标识/param> |
| | | /// <param name="keyName"><按键名称(打印用的)/param> |
| | | private void KeyControl(string keypad, string keyName) |
| | | /// <param name="isSupport"><是否支持控制/param> |
| | | private void KeyControl(string keypad, string keyName, bool isSupport) |
| | | { |
| | | //CommonMethod.Current.Loading.Start(); |
| | | CommonMethod.Current.SunThread(() => |
| | | { |
| | | try |
| | | { |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName); |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName, isSupport); |
| | | } |
| | | catch { } |
| | | finally |
| | |
| | | { |
| | | return; |
| | | } |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }; |
| | | |
| | | |
| | | menuFram.SetTopClickListener((keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | menuFram.SetBottomClickListener((keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | menuFram.SetLeftClickListener((keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | menuFram.SetRightClickListener((keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | |
| | | }); |
| | | menuFram.SetOkClickListener((keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="keypad"><按键标识/param> |
| | | /// <param name="keyName"><按键名称(打印用的)/param> |
| | | private void KeyControl(string keypad, string keyName) |
| | | /// <param name="isSupport"><是否支持控制/param> |
| | | private void KeyControl(string keypad, string keyName, bool isSupport) |
| | | { |
| | | //CommonMethod.Current.Loading.Start(); |
| | | CommonMethod.Current.SunThread(() => |
| | | { |
| | | try |
| | | { |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName); |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName,isSupport); |
| | | } |
| | | catch { } |
| | | finally |
| | |
| | | /// <param name="rcId">遥控器id</param> |
| | | /// <param name="keypad"><按键标识/param> |
| | | /// <param name="keyName"><按键名称(打印用的)/param> |
| | | /// <param name="isSupport"><是否支持控制/param> |
| | | /// <param name="tipType">是否需要提示,默认提示</param> |
| | | public bool KeypadExecute(string deviceId, string rcId, string keypad,string keyName, TipType tipType = TipType.flicker) |
| | | public bool KeypadExecute(string deviceId, string rcId, string keypad, string keyName, bool isSupport, TipType tipType = TipType.flicker) |
| | | { |
| | | |
| | | if (!isSupport) { |
| | | CommonMethod.Current.ShowTip("按键不支持.", 3); |
| | | return false; |
| | | } |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId);//设备id |
| | |
| | | //功能键控制 |
| | | cornerTopFram.selectKeyAction += (keypadEntity) => |
| | | { |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }; |
| | | //数字键控制 |
| | | numberFrame.selectKeyAction += (keypadEntity) => |
| | | { |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }; |
| | | //菜单上按键 |
| | | menuFram.SetTopClickListener((keypadEntity) => |
| | | { |
| | | |
| | | |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | //菜单下按键 |
| | | menuFram.SetBottomClickListener((keypadEntity) => |
| | | { |
| | | |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | //菜单左按键 |
| | | menuFram.SetLeftClickListener((keypadEntity) => |
| | | { |
| | | |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | //菜单右按键 |
| | | menuFram.SetRightClickListener((keypadEntity) => |
| | | { |
| | | |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | //菜单ok按键 |
| | | menuFram.SetOkClickListener((keypadEntity) => |
| | | { |
| | | |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | |
| | | if (tvSingleFramLayout != null) |
| | |
| | | /// </summary> |
| | | /// <param name="keypad"><按键标识/param> |
| | | /// <param name="keyName"><按键名称(打印用的)/param> |
| | | private void KeyControl(string keypad, string keyName) |
| | | /// <param name="isSupport"><是否支持控制/param> |
| | | private void KeyControl(string keypad, string keyName,bool isSupport) |
| | | { |
| | | //CommonMethod.Current.Loading.Start(); |
| | | CommonMethod.Current.SunThread(() => |
| | | { |
| | | try |
| | | { |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName); |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName, isSupport); |
| | | } |
| | | catch { } |
| | | finally |
| | |
| | | //功能键控制 |
| | | cornerTopFram.selectKeyAction += (keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }; |
| | | |
| | | //菜单上按键 |
| | | menuFram.SetTopClickListener((keypadEntity) => |
| | | { |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | //菜单下按键 |
| | | menuFram.SetBottomClickListener((keypadEntity) => |
| | | { |
| | | |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | //菜单左按键 |
| | | menuFram.SetLeftClickListener((keypadEntity) => |
| | | { |
| | | |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | //菜单右按键 |
| | | menuFram.SetRightClickListener((keypadEntity) => |
| | | { |
| | | |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | //菜单ok按键 |
| | | menuFram.SetOkClickListener((keypadEntity) => |
| | | { |
| | | |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name); |
| | | this.KeyControl(keypadEntity.keypad, keypadEntity.name, keypadEntity.isClicked); |
| | | }); |
| | | if (typeMultiFramLayout != null) |
| | | { |
| | |
| | | /// </summary> |
| | | /// <param name="keypad"><按键标识/param> |
| | | /// <param name="keyName"><按键名称(打印用的)/param> |
| | | private void KeyControl(string keypad, string keyName) |
| | | /// <param name="isSupport"><是否支持控制/param> |
| | | private void KeyControl(string keypad, string keyName, bool isSupport) |
| | | { |
| | | //CommonMethod.Current.Loading.Start(); |
| | | CommonMethod.Current.SunThread(() => |
| | | { |
| | | try |
| | | { |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName); |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName,isSupport); |
| | | } |
| | | catch { } |
| | | finally |
| | |
| | | /// </summary> |
| | | /// <param name="keypad"><按键标识/param> |
| | | /// <param name="keyName"><按键名称(打印用的)/param> |
| | | private void KeyControl(string keypad, string keyName) |
| | | |
| | | private void KeyControl(string keypad, string keyName,bool isSupport=true) |
| | | { |
| | | //CommonMethod.Current.Loading.Start(); |
| | | CommonMethod.Current.SunThread(() => |
| | | { |
| | | try |
| | | { |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName); |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName,isSupport); |
| | | } |
| | | catch { } |
| | | finally |