| | |
| | | { |
| | | |
| | | |
| | | #region ■ 变量声明___________________________ |
| | | #region -------变量声明--------- |
| | | /// <summary> |
| | | /// 设备 |
| | | /// </summary> |
| | |
| | | }; |
| | | |
| | | //首页 |
| | | shouyeFL.SetClickListener((fl, btnImage, btnText) => { }); |
| | | shouyeFL.SetClickListener((fl, btnImage, btnText) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.home_page, ""); |
| | | }); |
| | | //关机 |
| | | kaiguanFL.SetClickListener((fl, btnImage, btnText) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "0", (isBool) => |
| | | { |
| | | if (isBool) |
| | | { |
| | | CommonMethod.Current.MainThread(() => |
| | | { |
| | | vv.Visible = false; |
| | | baseCloseFFL.Visible = true; |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | //提示:关机失败; |
| | | } |
| | | }); |
| | | }); |
| | | //菜单 |
| | | caidanFL.SetClickListener((fl, btnImage, btnText) => { }); |
| | | caidanFL.SetClickListener((fl, btnImage, btnText) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "11"); |
| | | |
| | | }); |
| | | //音量+ |
| | | btn_jia.MouseDownEventHandler += (sender, e) => { }; |
| | | btn_jia.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.volume_add, ""); |
| | | |
| | | }; |
| | | //音量- |
| | | btn_jian.MouseDownEventHandler += (sender, e) => { }; |
| | | btn_jian.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.volume_subtract, ""); |
| | | }; |
| | | //播放 |
| | | bofangBtn.SetClickListener((btn) => { }); |
| | | bofangBtn.SetClickListener((btn) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.media_play, ""); |
| | | |
| | | }); |
| | | //暂停 |
| | | zantingBtn.SetClickListener((btn) => { }); |
| | | zantingBtn.SetClickListener((btn) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.media_pause, ""); |
| | | }); |
| | | //快进 |
| | | kuaijinBtn.SetClickListener((btn) => { }); |
| | | kuaijinBtn.SetClickListener((btn) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.fast_forward, ""); |
| | | }); |
| | | //快退 |
| | | kauituiBtn.SetClickListener((btn) => { }); |
| | | kauituiBtn.SetClickListener((btn) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.fast_back, ""); |
| | | }); |
| | | //静音 |
| | | jingyinBtn.SetClickListener((btn) => { }); |
| | | jingyinBtn.SetClickListener((btn) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.mute, "1"); |
| | | }); |
| | | //设置 |
| | | shezhiBtn.SetClickListener((btn) => { }); |
| | | shezhiBtn.SetClickListener((btn) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.system_setting, ""); |
| | | }); |
| | | //解除静音 |
| | | jiechujingyinBtn.SetClickListener((btn) => { }); |
| | | jiechujingyinBtn.SetClickListener((btn) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.mute, "0"); |
| | | }); |
| | | //返回 |
| | | fanhuiBtn.SetClickListener((btn) => { }); |
| | | //控制菜单 |
| | | fanhuiBtn.SetClickListener((btn) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "5"); |
| | | }); |
| | | //上 |
| | | muenFrameLayout.SetTopClickListener((muen) => |
| | | { |
| | | |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "0"); |
| | | |
| | | }); |
| | | //下 |
| | | muenFrameLayout.SetBottomClickListener((muen) => |
| | | { |
| | | |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "1"); |
| | | |
| | | }); |
| | | //左 |
| | | muenFrameLayout.SetLeftClickListener((muen) => |
| | | { |
| | | |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "2"); |
| | | |
| | | }); |
| | | //右 |
| | | muenFrameLayout.SetRightClickListener((muen) => |
| | | { |
| | | |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "3"); |
| | | |
| | | }); |
| | | //OK |
| | | muenFrameLayout.SetOkClickListener((muen) => |
| | | { |
| | | |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "4"); |
| | | |
| | | }); |
| | | //信号源 |
| | | sourceFrameLayout.selectAction += (text) => |
| | | { |
| | | |
| | | |
| | | string value = text.Replace(" ", "_"); |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.signal, value); |
| | | }; |
| | | |
| | | |
| | |
| | | //开机 |
| | | clickBtn.MouseDownEventHandler += (sen, e) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "1", (isBool) => |
| | | { |
| | | if (isBool) |
| | | { |
| | | CommonMethod.Current.MainThread(() => |
| | | { |
| | | vv.Visible = true; |
| | | baseCloseFFL.Visible = false; |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | //提示:开机失败; |
| | | } |
| | | }); |
| | | |
| | | }; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 发送控制属性指令 |
| | | /// </summary> |
| | | /// <param name="key">功能属性(语雀上定义的)</param> |
| | | /// <param name="value">值</param> |
| | | /// <param name="action">结果回调(默认不回调)</param> |
| | | private void ControlCommand(string key, string value, Action<bool> action = null) |
| | | { |
| | | try |
| | | { |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | dic.Add(key, value); |
| | | Send.Current.SendControlCommand(this.device, dic, action); |
| | | } |
| | | catch { } |
| | | } |
| | | /// <summary> |
| | | /// 初始数据 |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | #region -------界面布局--------- |
| | | /// <summary> |
| | | /// 初始化【开机】界面 |
| | | /// </summary> |
| | |
| | | shouyeFL.AddImageView(); |
| | | shouyeFL.AddTextButtonView(); |
| | | shouyeFL.GetImageButton().UnSelectedImagePath = "HisenseTv/shouye.png"; |
| | | shouyeFL.GetTextButton().Text = "首页"; |
| | | shouyeFL.GetTextButton().TextID = StringId.shouye; |
| | | |
| | | |
| | | kaiguanFL = new CustomFrameLayout(); |
| | |
| | | kaiguanFL.AddImageView(); |
| | | kaiguanFL.AddTextButtonView(); |
| | | kaiguanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/kaiguan.png"; |
| | | kaiguanFL.GetTextButton().Text = "关机"; |
| | | kaiguanFL.GetTextButton().TextID = StringId.guanji; |
| | | |
| | | caidanFL = new CustomFrameLayout(); |
| | | backgroundOpenFl.AddChidren(caidanFL); |
| | |
| | | caidanFL.AddImageView(); |
| | | caidanFL.AddTextButtonView(); |
| | | caidanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/caidan.png"; |
| | | caidanFL.GetTextButton().Text = "菜单"; |
| | | caidanFL.GetTextButton().TextID = StringId.caidan; |
| | | |
| | | var yinliangFL = new FrameLayout(); |
| | | backgroundOpenFl.AddChidren(yinliangFL); |
| | |
| | | { |
| | | Y = Application.GetRealHeight(90), |
| | | Height = Application.GetRealHeight(20), |
| | | Text = "音量", |
| | | //Text = "音量", |
| | | TextID = StringId.yinliang, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text14, |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | }; |
| | | |
| | | bofangBtn = new CustomButton(); |
| | | bofangBtn.Text = "播放"; |
| | | bofangBtn.TextID = StringId.bofang; |
| | | bofangBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24); |
| | | bofangBtn.X = yinliangFL.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(bofangBtn); |
| | | |
| | | |
| | | zantingBtn = new CustomButton(); |
| | | zantingBtn.Text = "暂停"; |
| | | zantingBtn.TextID = StringId.zanting; |
| | | zantingBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24); |
| | | zantingBtn.X = bofangBtn.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(zantingBtn); |
| | | |
| | | |
| | | kuaijinBtn = new CustomButton(); |
| | | kuaijinBtn.Text = "快进"; |
| | | kuaijinBtn.TextID = StringId.kuaijin; |
| | | kuaijinBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16); |
| | | kuaijinBtn.X = yinliangFL.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(kuaijinBtn); |
| | | |
| | | |
| | | kauituiBtn = new CustomButton(); |
| | | kauituiBtn.Text = "快退"; |
| | | kauituiBtn.TextID = StringId.kuaitui; |
| | | kauituiBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16); |
| | | kauituiBtn.X = kuaijinBtn.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(kauituiBtn); |
| | |
| | | |
| | | |
| | | jingyinBtn = new CustomButton(); |
| | | jingyinBtn.Text = "静音"; |
| | | jingyinBtn.TextID = StringId.jingyin; |
| | | jingyinBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16); |
| | | jingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(jingyinBtn); |
| | | |
| | | |
| | | shezhiBtn = new CustomButton(); |
| | | shezhiBtn.Text = "设置"; |
| | | shezhiBtn.TextID = StringId.shezhi; |
| | | shezhiBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16); |
| | | shezhiBtn.X = jingyinBtn.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(shezhiBtn); |
| | |
| | | |
| | | |
| | | jiechujingyinBtn = new CustomButton(); |
| | | jiechujingyinBtn.Text = "解除静音"; |
| | | jiechujingyinBtn.TextID = StringId.jiechujingyin; |
| | | jiechujingyinBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16); |
| | | jiechujingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(jiechujingyinBtn); |
| | | |
| | | |
| | | fanhuiBtn = new CustomButton(); |
| | | fanhuiBtn.Text = "返回"; |
| | | fanhuiBtn.TextID = StringId.fanhui; |
| | | fanhuiBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16); |
| | | fanhuiBtn.X = jiechujingyinBtn.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(fanhuiBtn); |
| | |
| | | Height = Application.GetRealHeight(22), |
| | | TextSize = TextSize.Text16, |
| | | TextColor = MusicColor.TextColor, |
| | | Text = "已关机", |
| | | //Text = "已关机", |
| | | TextID = StringId.yiguanji, |
| | | TextAlignment = TextAlignment.Center, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Padding = new Padding(0, 16, 0, 16), |
| | |
| | | Height = Application.GetRealHeight(16), |
| | | TextSize = TextSize.Text12, |
| | | TextColor = MusicColor.TextCancelColor, |
| | | Text = "开机", |
| | | TextID = StringId.kaiji, |
| | | TextAlignment = TextAlignment.Center, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Padding = new Padding(0, 2, 0, 2), |
| | |
| | | //this.cellFrame.X = this.btnCurrDeviceRoom.Right + Application.GetRealWidth(20); |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | #region -------自定义当前界面的容器--------- |
| | | /// <summary> |
| | | /// 自定义(首页,关机,菜单)容器 |
| | | /// </summary> |
| | |
| | | button.SetClickListener((btn) => |
| | | { |
| | | // MovieLibrary movieLibrary = new MovieLibrary(); |
| | | |
| | | selectAction?.Invoke(button.Text); |
| | | }); |
| | | //if (CurrnetSelectIndex != -1 && CurrnetSelectIndex == i) |
| | |
| | | { |
| | | return new List<string> |
| | | { |
| | | "HDML 1", |
| | | "HDML 1",//" " |
| | | "HDML 2", |
| | | "HDML 3", |
| | | "HDML 4", |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | } |