| | |
| | | using Shared; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.UI.Music; |
| | | using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock; |
| | | using HDL_ON.UI.UI2.Intelligence.Automation; |
| | | using System.Linq; |
| | | using HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView; |
| | | using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity; |
| | | |
| | | namespace HDL_ON.UI.UI2.FuntionControlView.HisenseTV |
| | | { |
| | |
| | | /// 头部布局 |
| | | /// </summary> |
| | | private TopView topView; |
| | | BaseFramLayout baseCloseFFL; |
| | | VerticalScrolViewLayout vv; |
| | | /// <summary> |
| | | /// 当前设备名称 |
| | | /// </summary> |
| | | private Button btnCurrDeviceName; |
| | | private Button btnOpenCurrDeviceName; |
| | | /// <summary> |
| | | /// 区域 |
| | | /// </summary> |
| | | private Button btnCurrDeviceRoom; |
| | | |
| | | private Button btnOpenCurrDeviceRoom; |
| | | /// <summary> |
| | | ///收藏图标 |
| | | /// </summary> |
| | | private Button btnCollectIcon; |
| | | /// <summary> |
| | | /// 门锁状态 |
| | | /// </summary> |
| | | private Button btnDoorLockIcon; |
| | | private Button btnOpenCollectIcon; |
| | | CustomFrameLayout shouyeFL; |
| | | CustomFrameLayout kaiguanFL; |
| | | CustomFrameLayout caidanFL; |
| | | Button btn_jia; |
| | | Button btn_jian; |
| | | CustomButton bofangBtn; |
| | | CustomButton zantingBtn; |
| | | CustomButton kuaijinBtn; |
| | | CustomButton kauituiBtn; |
| | | CustomButton jingyinBtn; |
| | | CustomButton shezhiBtn; |
| | | CustomButton jiechujingyinBtn; |
| | | CustomButton fanhuiBtn; |
| | | MenuFramLayout muenFrameLayout; |
| | | SourceFrameLayout sourceFrameLayout; |
| | | |
| | | |
| | | Button btnCloseCollectIcon; |
| | | Button btnCloseCurrDeviceName; |
| | | Button btnCloseCurrDeviceRoom; |
| | | Button clickBtn; |
| | | |
| | | /// <summary> |
| | | /// 表示来自那个界面 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public Action action; |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | | /// 构造函数 |
| | |
| | | public void Show() |
| | | { |
| | | //初始化UI |
| | | this.InitUI(); |
| | | this.InitTopUI(); |
| | | this.InitOpenUI(); |
| | | this.InitCloseUI(); |
| | | this.CurrentAssignPage(); |
| | | //初始化事件 |
| | | this.EventListener(); |
| | | //读取数据 |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 初始化界面 |
| | | /// </summary> |
| | | private void InitUI() |
| | | { |
| | | #region ---界面布局--- |
| | | this.BackgroundColor = MusicColor.ViewColor; |
| | | this.topView = new TopView(); |
| | | this.topView.setBtn.Visible = true; |
| | | this.topView.topNameBtn.TextID = StringId.dianshi; |
| | | this.AddChidren(topView.TopFLayoutView()); |
| | | |
| | | var vv = new VerticalScrolViewLayout |
| | | { |
| | | Y = topView.fLayout.Bottom, |
| | | Height = Application.GetRealHeight(H_W.H - H_W.T_Height), |
| | | }; |
| | | this.AddChidren(vv); |
| | | var baseFL = new BaseFramLayout(); |
| | | vv.AddChidren(baseFL); |
| | | |
| | | var backgroundFl = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(24), |
| | | X = Application.GetRealWidth(24), |
| | | Height = Application.GetRealHeight(682), |
| | | Width = Application.GetRealWidth(327), |
| | | BackgroundImagePath = "HisenseTv/onbj.png", |
| | | Name = "backgroundFl", |
| | | }; |
| | | baseFL.AddChidren(backgroundFl); |
| | | |
| | | baseFL.AdjustRealHeight(51); |
| | | |
| | | btnCollectIcon = new Button |
| | | { |
| | | X = Application.GetRealWidth(273), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "MusicIcon/collect.png", |
| | | SelectedImagePath = "MusicIcon/collectSelected.png", |
| | | IsSelected = this.device.collect, |
| | | Name = "collect" |
| | | }; |
| | | backgroundFl.AddChidren(btnCollectIcon); |
| | | |
| | | btnCurrDeviceName = new Button |
| | | { |
| | | TextSize = TextSize.Text24, |
| | | TextColor = MusicColor.Text18Color, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(33), |
| | | Y = Application.GetRealHeight(16), |
| | | X = Application.GetRealWidth(16), |
| | | Text = this.device.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | IsBold = true |
| | | }; |
| | | backgroundFl.AddChidren(btnCurrDeviceName); |
| | | |
| | | |
| | | btnCurrDeviceRoom = new Button |
| | | { |
| | | TextSize = TextSize.Text12, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(17), |
| | | Y = btnCurrDeviceName.Bottom + Application.GetRealHeight(4), |
| | | X = Application.GetRealWidth(16), |
| | | Text = this.device.GetRoomListName(), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | backgroundFl.AddChidren(btnCurrDeviceRoom); |
| | | |
| | | int yHeight = btnCurrDeviceRoom.Bottom + Application.GetRealHeight(16); |
| | | var shouyeFL = new CustomFrameLayout(); |
| | | backgroundFl.AddChidren(shouyeFL); |
| | | shouyeFL.X = Application.GetRealWidth(24); |
| | | shouyeFL.Y = yHeight; |
| | | shouyeFL.AddImageView(); |
| | | shouyeFL.AddTextButtonView(); |
| | | shouyeFL.GetImageButton().UnSelectedImagePath = "HisenseTv/shouye.png"; |
| | | shouyeFL.GetTextButton().Text = "首页"; |
| | | |
| | | |
| | | var kaiguanFL = new CustomFrameLayout(); |
| | | backgroundFl.AddChidren(kaiguanFL); |
| | | kaiguanFL.X = shouyeFL.Right + Application.GetRealWidth(37); |
| | | kaiguanFL.Y = yHeight; |
| | | kaiguanFL.AddImageView(); |
| | | kaiguanFL.AddTextButtonView(); |
| | | kaiguanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/kaiguan.png"; |
| | | kaiguanFL.GetTextButton().Text = "关机"; |
| | | |
| | | var caidanFL = new CustomFrameLayout(); |
| | | backgroundFl.AddChidren(caidanFL); |
| | | caidanFL.X = kaiguanFL.Right + Application.GetRealWidth(37); |
| | | caidanFL.Y = yHeight; |
| | | caidanFL.AddImageView(); |
| | | caidanFL.AddTextButtonView(); |
| | | caidanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/caidan.png"; |
| | | caidanFL.GetTextButton().Text = "菜单"; |
| | | |
| | | var yinliangFL = new FrameLayout(); |
| | | backgroundFl.AddChidren(yinliangFL); |
| | | yinliangFL.Height = Application.GetRealHeight(200); |
| | | yinliangFL.Width = Application.GetRealWidth(68); |
| | | yinliangFL.Y = shouyeFL.Bottom + Application.GetRealHeight(24); |
| | | yinliangFL.X = shouyeFL.X; |
| | | yinliangFL.BackgroundColor = 0xffF2F3F7; |
| | | yinliangFL.Radius = (uint)Application.GetRealHeight(34); |
| | | |
| | | Button btn_jia = new Button |
| | | { |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "HisenseTv/yingliangjia.png", |
| | | Y = Application.GetRealHeight(20), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | |
| | | }; |
| | | yinliangFL.AddChidren(btn_jia); |
| | | Button btnText = new Button |
| | | { |
| | | Y = Application.GetRealHeight(90), |
| | | Height = Application.GetRealHeight(20), |
| | | Text = "音量", |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text14, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | |
| | | }; |
| | | yinliangFL.AddChidren(btnText); |
| | | Button btn_jian = new Button |
| | | { |
| | | Y = Application.GetRealHeight(148), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "HisenseTv/yingliangjian.png", |
| | | Gravity = Gravity.CenterHorizontal, |
| | | |
| | | }; |
| | | yinliangFL.AddChidren(btn_jian); |
| | | |
| | | |
| | | CustomButton bofangBtn = new CustomButton(); |
| | | bofangBtn.Text = "播放"; |
| | | bofangBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24); |
| | | bofangBtn.X = yinliangFL.Right + Application.GetRealWidth(37); |
| | | backgroundFl.AddChidren(bofangBtn); |
| | | |
| | | |
| | | CustomButton zantingBtn = new CustomButton(); |
| | | zantingBtn.Text = "暂停"; |
| | | zantingBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24); |
| | | zantingBtn.X = bofangBtn.Right + Application.GetRealWidth(37); |
| | | backgroundFl.AddChidren(zantingBtn); |
| | | |
| | | |
| | | CustomButton kuaijinBtn = new CustomButton(); |
| | | kuaijinBtn.Text = "快进"; |
| | | kuaijinBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16); |
| | | kuaijinBtn.X = yinliangFL.Right + Application.GetRealWidth(37); |
| | | backgroundFl.AddChidren(kuaijinBtn); |
| | | |
| | | |
| | | CustomButton kauituiBtn = new CustomButton(); |
| | | kauituiBtn.Text = "快退"; |
| | | kauituiBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16); |
| | | kauituiBtn.X = kuaijinBtn.Right + Application.GetRealWidth(37); |
| | | backgroundFl.AddChidren(kauituiBtn); |
| | | |
| | | |
| | | |
| | | |
| | | CustomButton jingyinBtn = new CustomButton(); |
| | | jingyinBtn.Text = "静音"; |
| | | jingyinBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16); |
| | | jingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37); |
| | | backgroundFl.AddChidren(jingyinBtn); |
| | | |
| | | |
| | | CustomButton shezhiBtn = new CustomButton(); |
| | | shezhiBtn.Text = "设置"; |
| | | shezhiBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16); |
| | | shezhiBtn.X = jingyinBtn.Right + Application.GetRealWidth(37); |
| | | backgroundFl.AddChidren(shezhiBtn); |
| | | |
| | | |
| | | |
| | | CustomButton jiechujingyinBtn = new CustomButton(); |
| | | jiechujingyinBtn.Text = "解除静音"; |
| | | jiechujingyinBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16); |
| | | jiechujingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37); |
| | | backgroundFl.AddChidren(jiechujingyinBtn); |
| | | |
| | | |
| | | CustomButton fanhuiBtn = new CustomButton(); |
| | | fanhuiBtn.Text = "返回"; |
| | | fanhuiBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16); |
| | | fanhuiBtn.X = jiechujingyinBtn.Right + Application.GetRealWidth(37); |
| | | backgroundFl.AddChidren(fanhuiBtn); |
| | | |
| | | |
| | | TypeFrameLayout typeFrameLayout = new TypeFrameLayout(); |
| | | typeFrameLayout.middLayout.Y = yinliangFL.Bottom + Application.GetRealHeight(32); |
| | | typeFrameLayout.AddView(backgroundFl); |
| | | |
| | | |
| | | |
| | | MuenFrameLayout muenFrameLayout = new MuenFrameLayout (); |
| | | muenFrameLayout.AddView(backgroundFl); |
| | | muenFrameLayout.parentFl.Y = Application.GetRealHeight(482); |
| | | muenFrameLayout.parentFl.X = Application.GetRealWidth(73); |
| | | |
| | | |
| | | typeFrameLayout.SetLfteClickListener((btn) => { |
| | | |
| | | |
| | | }); |
| | | typeFrameLayout.SetRightClickListener((btn) => { |
| | | |
| | | |
| | | }); |
| | | |
| | | muenFrameLayout.SetLeftClickListener((b) => { |
| | | |
| | | }); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 注册事件 |
| | | /// </summary> |
| | |
| | | ////刷新显示 |
| | | this.btnDeviceName.Text = this.device.name; |
| | | this.btnRoomName.Text = this.device.GetRoomListName(); |
| | | this.btnCurrDeviceName.Text = this.device.name; |
| | | this.btnCurrDeviceRoom.Text = this.device.GetRoomListName(); |
| | | // |
| | | this.btnOpenCurrDeviceName.Text = this.device.name; |
| | | this.btnOpenCurrDeviceRoom.Text = this.device.GetRoomListName(); |
| | | // |
| | | this.btnCloseCurrDeviceName.Text = this.device.name; |
| | | this.btnCloseCurrDeviceRoom.Text = this.device.GetRoomListName(); |
| | | this.CalculatedPosition();//重新计算宽度 |
| | | |
| | | }); |
| | |
| | | }); |
| | | }; |
| | | //收藏 |
| | | this.btnCollectIcon.MouseUpEventHandler += (sender, e) => |
| | | this.btnOpenCollectIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnCollectIcon.IsSelected = this.device.collect = !btnCollectIcon.IsSelected; |
| | | btnOpenCollectIcon.IsSelected = this.device.collect = !btnOpenCollectIcon.IsSelected; |
| | | this.device.CollectFunction(); |
| | | }; |
| | | |
| | | //首页 |
| | | shouyeFL.SetClickListener((fl, btnImage, btnText) => { }); |
| | | //关机 |
| | | kaiguanFL.SetClickListener((fl, btnImage, btnText) => |
| | | { |
| | | vv.Visible = false; |
| | | baseCloseFFL.Visible = true; |
| | | }); |
| | | //菜单 |
| | | caidanFL.SetClickListener((fl, btnImage, btnText) => { }); |
| | | //音量+ |
| | | btn_jia.MouseDownEventHandler += (sender, e) => { }; |
| | | //音量- |
| | | btn_jian.MouseDownEventHandler += (sender, e) => { }; |
| | | //播放 |
| | | bofangBtn.SetClickListener((btn) => { }); |
| | | //暂停 |
| | | zantingBtn.SetClickListener((btn) => { }); |
| | | //快进 |
| | | kuaijinBtn.SetClickListener((btn) => { }); |
| | | //快退 |
| | | kauituiBtn.SetClickListener((btn) => { }); |
| | | //静音 |
| | | jingyinBtn.SetClickListener((btn) => { }); |
| | | //设置 |
| | | shezhiBtn.SetClickListener((btn) => { }); |
| | | //解除静音 |
| | | jiechujingyinBtn.SetClickListener((btn) => { }); |
| | | //返回 |
| | | fanhuiBtn.SetClickListener((btn) => { }); |
| | | //控制菜单 |
| | | muenFrameLayout.SetLeftClickListener((muen) => |
| | | { |
| | | |
| | | }); |
| | | //信号源 |
| | | sourceFrameLayout.selectAction += (text) => |
| | | { |
| | | |
| | | |
| | | }; |
| | | |
| | | |
| | | //收藏(关机) |
| | | this.btnCloseCollectIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btnCloseCollectIcon.IsSelected = this.device.collect = !btnCloseCollectIcon.IsSelected; |
| | | this.device.CollectFunction(); |
| | | }; |
| | | //开机 |
| | | clickBtn.MouseDownEventHandler += (sen, e) => |
| | | { |
| | | vv.Visible = true; |
| | | baseCloseFFL.Visible = false; |
| | | }; |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | } |
| | | }); |
| | | } |
| | | /// <summary> |
| | | /// 初始化【开机】界面 |
| | | /// </summary> |
| | | private void InitOpenUI() |
| | | { |
| | | #region ---界面布局--- |
| | | vv = new VerticalScrolViewLayout |
| | | { |
| | | Y = topView.fLayout.Bottom, |
| | | Height = Application.GetRealHeight(H_W.H - H_W.T_Height), |
| | | }; |
| | | this.AddChidren(vv); |
| | | var baseOpenFL = new BaseFramLayout(); |
| | | vv.AddChidren(baseOpenFL); |
| | | var backgroundOpenFl = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(24), |
| | | X = Application.GetRealWidth(24), |
| | | Height = Application.GetRealHeight(648), |
| | | Width = Application.GetRealWidth(327), |
| | | BackgroundImagePath = "HisenseTv/onbj.png", |
| | | }; |
| | | baseOpenFL.AddChidren(backgroundOpenFl); |
| | | |
| | | baseOpenFL.AdjustRealHeight(16); |
| | | |
| | | btnOpenCollectIcon = new Button |
| | | { |
| | | X = Application.GetRealWidth(273), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "MusicIcon/collect.png", |
| | | SelectedImagePath = "MusicIcon/collectSelected.png", |
| | | IsSelected = this.device.collect, |
| | | }; |
| | | backgroundOpenFl.AddChidren(btnOpenCollectIcon); |
| | | |
| | | btnOpenCurrDeviceName = new Button |
| | | { |
| | | TextSize = TextSize.Text24, |
| | | TextColor = MusicColor.Text18Color, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(33), |
| | | Y = Application.GetRealHeight(16), |
| | | X = Application.GetRealWidth(16), |
| | | Text = this.device.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | IsBold = true |
| | | }; |
| | | backgroundOpenFl.AddChidren(btnOpenCurrDeviceName); |
| | | |
| | | |
| | | btnOpenCurrDeviceRoom = new Button |
| | | { |
| | | TextSize = TextSize.Text12, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(17), |
| | | Y = btnOpenCurrDeviceName.Bottom + Application.GetRealHeight(4), |
| | | X = Application.GetRealWidth(16), |
| | | Text = this.device.GetRoomListName(), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | backgroundOpenFl.AddChidren(btnOpenCurrDeviceRoom); |
| | | |
| | | int yHeight = btnOpenCurrDeviceRoom.Bottom + Application.GetRealHeight(16); |
| | | shouyeFL = new CustomFrameLayout(); |
| | | backgroundOpenFl.AddChidren(shouyeFL); |
| | | shouyeFL.X = Application.GetRealWidth(24); |
| | | shouyeFL.Y = yHeight; |
| | | shouyeFL.AddImageView(); |
| | | shouyeFL.AddTextButtonView(); |
| | | shouyeFL.GetImageButton().UnSelectedImagePath = "HisenseTv/shouye.png"; |
| | | shouyeFL.GetTextButton().Text = "首页"; |
| | | |
| | | |
| | | kaiguanFL = new CustomFrameLayout(); |
| | | backgroundOpenFl.AddChidren(kaiguanFL); |
| | | kaiguanFL.X = shouyeFL.Right + Application.GetRealWidth(37); |
| | | kaiguanFL.Y = yHeight; |
| | | kaiguanFL.AddImageView(); |
| | | kaiguanFL.AddTextButtonView(); |
| | | kaiguanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/kaiguan.png"; |
| | | kaiguanFL.GetTextButton().Text = "关机"; |
| | | |
| | | caidanFL = new CustomFrameLayout(); |
| | | backgroundOpenFl.AddChidren(caidanFL); |
| | | caidanFL.X = kaiguanFL.Right + Application.GetRealWidth(37); |
| | | caidanFL.Y = yHeight; |
| | | caidanFL.AddImageView(); |
| | | caidanFL.AddTextButtonView(); |
| | | caidanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/caidan.png"; |
| | | caidanFL.GetTextButton().Text = "菜单"; |
| | | |
| | | var yinliangFL = new FrameLayout(); |
| | | backgroundOpenFl.AddChidren(yinliangFL); |
| | | yinliangFL.Height = Application.GetRealHeight(200); |
| | | yinliangFL.Width = Application.GetRealWidth(68); |
| | | yinliangFL.Y = shouyeFL.Bottom + Application.GetRealHeight(24); |
| | | yinliangFL.X = shouyeFL.X; |
| | | yinliangFL.BackgroundColor = 0xffF2F3F7; |
| | | yinliangFL.Radius = (uint)Application.GetRealHeight(34); |
| | | |
| | | btn_jia = new Button |
| | | { |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "HisenseTv/yingliangjia.png", |
| | | Y = Application.GetRealHeight(20), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | |
| | | }; |
| | | yinliangFL.AddChidren(btn_jia); |
| | | Button btnText = new Button |
| | | { |
| | | Y = Application.GetRealHeight(90), |
| | | Height = Application.GetRealHeight(20), |
| | | Text = "音量", |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text14, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | |
| | | }; |
| | | yinliangFL.AddChidren(btnText); |
| | | btn_jian = new Button |
| | | { |
| | | Y = Application.GetRealHeight(148), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "HisenseTv/yingliangjian.png", |
| | | Gravity = Gravity.CenterHorizontal, |
| | | |
| | | }; |
| | | yinliangFL.AddChidren(btn_jian); |
| | | btn_jia.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | |
| | | }; |
| | | btn_jian.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | |
| | | }; |
| | | |
| | | bofangBtn = new CustomButton(); |
| | | bofangBtn.Text = "播放"; |
| | | bofangBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24); |
| | | bofangBtn.X = yinliangFL.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(bofangBtn); |
| | | |
| | | |
| | | zantingBtn = new CustomButton(); |
| | | zantingBtn.Text = "暂停"; |
| | | zantingBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24); |
| | | zantingBtn.X = bofangBtn.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(zantingBtn); |
| | | |
| | | |
| | | kuaijinBtn = new CustomButton(); |
| | | kuaijinBtn.Text = "快进"; |
| | | kuaijinBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16); |
| | | kuaijinBtn.X = yinliangFL.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(kuaijinBtn); |
| | | |
| | | |
| | | kauituiBtn = new CustomButton(); |
| | | kauituiBtn.Text = "快退"; |
| | | kauituiBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16); |
| | | kauituiBtn.X = kuaijinBtn.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(kauituiBtn); |
| | | |
| | | |
| | | |
| | | |
| | | jingyinBtn = new CustomButton(); |
| | | jingyinBtn.Text = "静音"; |
| | | jingyinBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16); |
| | | jingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(jingyinBtn); |
| | | |
| | | |
| | | shezhiBtn = new CustomButton(); |
| | | shezhiBtn.Text = "设置"; |
| | | shezhiBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16); |
| | | shezhiBtn.X = jingyinBtn.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(shezhiBtn); |
| | | |
| | | |
| | | |
| | | jiechujingyinBtn = new CustomButton(); |
| | | jiechujingyinBtn.Text = "解除静音"; |
| | | jiechujingyinBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16); |
| | | jiechujingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(jiechujingyinBtn); |
| | | |
| | | |
| | | fanhuiBtn = new CustomButton(); |
| | | fanhuiBtn.Text = "返回"; |
| | | fanhuiBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16); |
| | | fanhuiBtn.X = jiechujingyinBtn.Right + Application.GetRealWidth(37); |
| | | backgroundOpenFl.AddChidren(fanhuiBtn); |
| | | |
| | | |
| | | TypeFrameLayout typeFrameLayout = new TypeFrameLayout(); |
| | | typeFrameLayout.middLayout.Y = yinliangFL.Bottom + Application.GetRealHeight(32); |
| | | typeFrameLayout.AddView(backgroundOpenFl); |
| | | |
| | | muenFrameLayout = new MenuFramLayout(); |
| | | muenFrameLayout.Y = Application.GetRealHeight(482); |
| | | muenFrameLayout.AddView(backgroundOpenFl); |
| | | |
| | | sourceFrameLayout = new SourceFrameLayout(); |
| | | sourceFrameLayout.Y = Application.GetRealHeight(482); |
| | | backgroundOpenFl.AddChidren(sourceFrameLayout); |
| | | sourceFrameLayout.LoadSourcePage(); |
| | | |
| | | |
| | | |
| | | muenFrameLayout.Visible = true; |
| | | sourceFrameLayout.Visible = false; |
| | | typeFrameLayout.SetLfteClickListener(() => |
| | | { |
| | | |
| | | muenFrameLayout.Visible = true; |
| | | sourceFrameLayout.Visible = false; |
| | | }); |
| | | typeFrameLayout.SetRightClickListener(() => |
| | | { |
| | | muenFrameLayout.Visible = false; |
| | | sourceFrameLayout.Visible = true; |
| | | |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 初始化【关机】界面 |
| | | /// </summary> |
| | | private void InitCloseUI() |
| | | { |
| | | #region ---界面布局--- |
| | | |
| | | baseCloseFFL = new BaseFramLayout |
| | | { |
| | | Y = topView.fLayout.Bottom, |
| | | Height = Application.GetRealHeight(H_W.H - H_W.T_Height), |
| | | }; |
| | | this.AddChidren(baseCloseFFL); |
| | | var backgroundCloseFl = new FrameLayout |
| | | { |
| | | Y = Application.GetRealHeight(24), |
| | | X = Application.GetRealWidth(24), |
| | | Height = Application.GetRealHeight(526), |
| | | Width = Application.GetRealWidth(327), |
| | | BackgroundImagePath = "HisenseTv/offbj.png", |
| | | }; |
| | | baseCloseFFL.AddChidren(backgroundCloseFl); |
| | | baseCloseFFL.AdjustRealHeight(16); |
| | | |
| | | btnCloseCollectIcon = new Button |
| | | { |
| | | X = Application.GetRealWidth(273), |
| | | Y = Application.GetRealHeight(14), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "MusicIcon/collect.png", |
| | | SelectedImagePath = "MusicIcon/collectSelected.png", |
| | | IsSelected = this.device.collect, |
| | | }; |
| | | backgroundCloseFl.AddChidren(btnCloseCollectIcon); |
| | | |
| | | btnCloseCurrDeviceName = new Button |
| | | { |
| | | TextSize = TextSize.Text24, |
| | | TextColor = MusicColor.Text18Color, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(33), |
| | | Y = Application.GetRealHeight(16), |
| | | X = Application.GetRealWidth(16), |
| | | Text = this.device.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | IsBold = true |
| | | }; |
| | | backgroundCloseFl.AddChidren(btnCloseCurrDeviceName); |
| | | |
| | | |
| | | btnCloseCurrDeviceRoom = new Button |
| | | { |
| | | TextSize = TextSize.Text12, |
| | | TextColor = MusicColor.MusicNoTxetColor, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(17), |
| | | Y = btnCloseCurrDeviceName.Bottom + Application.GetRealHeight(4), |
| | | X = Application.GetRealWidth(16), |
| | | Text = this.device.GetRoomListName(), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | backgroundCloseFl.AddChidren(btnCloseCurrDeviceRoom); |
| | | |
| | | var btnOffTvBj = new Button |
| | | { |
| | | Y = Application.GetRealHeight(108), |
| | | Height = Application.GetRealWidth(198), |
| | | Width = Application.GetRealWidth(198), |
| | | UnSelectedImagePath = "HisenseTv/offtvbj.png", |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | backgroundCloseFl.AddChidren(btnOffTvBj); |
| | | |
| | | |
| | | var btnText = new Button |
| | | { |
| | | Y = btnOffTvBj.Bottom + Application.GetRealHeight(20), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(22), |
| | | TextSize = TextSize.Text16, |
| | | TextColor = MusicColor.TextColor, |
| | | Text = "已关机", |
| | | TextAlignment = TextAlignment.Center, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Padding = new Padding(0, 16, 0, 16), |
| | | |
| | | }; |
| | | backgroundCloseFl.AddChidren(btnText); |
| | | |
| | | |
| | | var offFl = new FrameLayout |
| | | { |
| | | Y = btnText.Bottom + Application.GetRealHeight(91), |
| | | Width = Application.GetRealHeight(32), |
| | | Height = Application.GetRealWidth(32 + 20), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | backgroundCloseFl.AddChidren(offFl); |
| | | |
| | | var btnOffIcon = new Button |
| | | { |
| | | Height = Application.GetRealWidth(32), |
| | | Width = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "HisenseTv/on.png", |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | offFl.AddChidren(btnOffIcon); |
| | | |
| | | var btnOffText = new Button |
| | | { |
| | | Y = btnOffIcon.Bottom + Application.GetRealHeight(4), |
| | | Height = Application.GetRealHeight(16), |
| | | TextSize = TextSize.Text12, |
| | | TextColor = MusicColor.TextCancelColor, |
| | | Text = "开机", |
| | | TextAlignment = TextAlignment.Center, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Padding = new Padding(0, 2, 0, 2), |
| | | }; |
| | | offFl.AddChidren(btnOffText); |
| | | |
| | | clickBtn = new Button |
| | | { |
| | | Width = Application.GetRealHeight(32), |
| | | Height = Application.GetRealWidth(32 + 20), |
| | | }; |
| | | offFl.AddChidren(clickBtn); |
| | | #endregion |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 初始化头部 |
| | | /// </summary> |
| | | private void InitTopUI() |
| | | { |
| | | this.BackgroundColor = MusicColor.ViewColor; |
| | | this.topView = new TopView(); |
| | | this.topView.setBtn.Visible = true; |
| | | this.topView.topNameBtn.TextID = StringId.dianshi; |
| | | this.AddChidren(topView.TopFLayoutView()); |
| | | } |
| | | /// <summary> |
| | | /// 根据设备开关状态显示指定显示界面 |
| | | /// (进来的时候用到) |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private void CurrentAssignPage() |
| | | { |
| | | |
| | | if (this.device == null) |
| | | { |
| | | vv.Visible = false; |
| | | baseCloseFFL.Visible = true; |
| | | return; |
| | | } |
| | | if (this.device.GetAttrState("on_off") == "on") |
| | | { |
| | | vv.Visible = true; |
| | | baseCloseFFL.Visible = false; |
| | | } |
| | | else |
| | | { |
| | | vv.Visible = false; |
| | | baseCloseFFL.Visible = true; |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重新计算宽度(设备名称,房间控件) |
| | | /// </summary> |
| | | private void CalculatedPosition() |
| | | { |
| | | this.btnCurrDeviceName.Width = this.btnCurrDeviceName.GetTextWidth(); |
| | | this.btnCurrDeviceName.Width += 10; |
| | | if (this.btnCurrDeviceName.GetTextWidth() > this.btnCollectIcon.X) |
| | | //开机状态 |
| | | this.btnOpenCurrDeviceName.Width = this.btnOpenCurrDeviceName.GetTextWidth(); |
| | | this.btnOpenCurrDeviceName.Width += 10; |
| | | if (this.btnOpenCurrDeviceName.GetTextWidth() > this.btnOpenCollectIcon.X) |
| | | { |
| | | //重新计算宽度 |
| | | this.btnCurrDeviceName.Width = this.btnCollectIcon.X + Application.GetRealWidth(-10); |
| | | this.btnOpenCurrDeviceName.Width = this.btnOpenCollectIcon.X + Application.GetRealWidth(-10); |
| | | } |
| | | this.btnCurrDeviceRoom.Width = this.btnCurrDeviceRoom.GetTextWidth(); |
| | | this.btnCurrDeviceRoom.Width += 10; |
| | | if (this.btnCurrDeviceRoom.GetTextWidth() > this.btnCollectIcon.X) |
| | | this.btnOpenCurrDeviceRoom.Width = this.btnOpenCurrDeviceRoom.GetTextWidth(); |
| | | this.btnOpenCurrDeviceRoom.Width += 10; |
| | | if (this.btnOpenCurrDeviceRoom.GetTextWidth() > this.btnOpenCollectIcon.X) |
| | | { |
| | | //重新计算宽度 |
| | | this.btnCurrDeviceRoom.Width = this.btnCollectIcon.X + Application.GetRealWidth(-20 - 10); |
| | | this.btnOpenCurrDeviceRoom.Width = this.btnOpenCollectIcon.X + Application.GetRealWidth(-20 - 10); |
| | | } |
| | | |
| | | |
| | | //关机状态 |
| | | this.btnCloseCurrDeviceName.Width = this.btnCloseCurrDeviceName.GetTextWidth(); |
| | | this.btnCloseCurrDeviceName.Width += 10; |
| | | if (this.btnCloseCurrDeviceName.GetTextWidth() > this.btnCloseCollectIcon.X) |
| | | { |
| | | //重新计算宽度 |
| | | this.btnCloseCurrDeviceName.Width = this.btnCloseCollectIcon.X + Application.GetRealWidth(-10); |
| | | } |
| | | this.btnCloseCurrDeviceRoom.Width = this.btnCloseCurrDeviceRoom.GetTextWidth(); |
| | | this.btnCloseCurrDeviceRoom.Width += 10; |
| | | if (this.btnCloseCurrDeviceRoom.GetTextWidth() > this.btnCloseCollectIcon.X) |
| | | { |
| | | //重新计算宽度 |
| | | this.btnCloseCurrDeviceRoom.Width = this.btnCloseCollectIcon.X + Application.GetRealWidth(-20 - 10); |
| | | } |
| | | //this.cellFrame.X = this.btnCurrDeviceRoom.Right + Application.GetRealWidth(20); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | { |
| | | this.BackgroundColor = 0x00000000; |
| | | this.BackgroundColor = 0xffECEDEE; |
| | | }; |
| | | this.MouseUpEventHandler += UpClick; |
| | | |
| | |
| | | rightBtnLine.Visible = false; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 信号源监听方法 |
| | | /// 控制监听方法 |
| | | /// </summary> |
| | | /// <param name="action">回调(第一个是父类对象</param> |
| | | public void SetRightClickListener(Action<Button> action) |
| | | public void SetLfteClickListener(Action action) |
| | | { |
| | | //频道点击事件 |
| | | //点击事件 |
| | | clickLeftLayout.MouseDownEventHandler += (sen, e) => |
| | | { |
| | | leftBtnTitle.IsSelected = true; |
| | |
| | | rightBtnTitle.IsSelected = false; |
| | | rightBtnLine.IsSelected = false; |
| | | rightBtnLine.Visible = false; |
| | | action?.Invoke(); |
| | | }; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 控制监听方法 |
| | | /// 信号源监听方法 |
| | | /// </summary> |
| | | /// <param name="action">回调(第一个是父类对象</param> |
| | | public void SetLfteClickListener(Action<Button> action) |
| | | public void SetRightClickListener(Action action) |
| | | { |
| | | //控制点击事件 |
| | | |
| | | //点击事件 |
| | | clickRightLayout.MouseDownEventHandler += (sen, e) => |
| | | { |
| | | leftBtnTitle.IsSelected = false; |
| | |
| | | rightBtnTitle.IsSelected = true; |
| | | rightBtnLine.IsSelected = true; |
| | | rightBtnLine.Visible = true; |
| | | action?.Invoke(); |
| | | |
| | | |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 菜单容器 |
| | | /// 信号源容器 |
| | | /// </summary> |
| | | class MuenFrameLayout |
| | | class SourceFrameLayout : FrameLayout |
| | | { |
| | | public const int widthFrameLayout = 375; |
| | | public const int heightFrameLayout = 146; |
| | | public const int interval = 37;//行中的列间隔值 |
| | | |
| | | public FrameLayout parentFl = new FrameLayout |
| | | public Action<string> selectAction; |
| | | |
| | | public SourceFrameLayout(int width = widthFrameLayout, int height = heightFrameLayout) |
| | | { |
| | | Width = Application.GetRealWidth(180), |
| | | Height = Application.GetRealWidth(180), |
| | | Radius = (uint)Application.GetRealHeight(90), |
| | | BackgroundColor= 0xffF2F3F7, |
| | | |
| | | }; |
| | | |
| | | Button btnTop = new Button |
| | | { |
| | | Y = Application.GetRealWidth(16), |
| | | X = Application.GetRealWidth(78), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealHeight(20), |
| | | UnSelectedImagePath = "AksIcon/shang.png", |
| | | SelectedImagePath = "AksIcon/shang_selected.png", |
| | | Name = "上", |
| | | }; |
| | | Button btnBottom = new Button |
| | | { |
| | | Y = Application.GetRealWidth(144), |
| | | X = Application.GetRealWidth(78), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealHeight(20), |
| | | UnSelectedImagePath = "AksIcon/xia.png", |
| | | SelectedImagePath = "AksIcon/xia_selected.png", |
| | | Name = "下", |
| | | }; |
| | | Button btnLeft = new Button |
| | | { |
| | | Y = Application.GetRealWidth(78), |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(20), |
| | | Height = Application.GetRealHeight(24), |
| | | UnSelectedImagePath = "AksIcon/zuo.png", |
| | | SelectedImagePath = "AksIcon/zuo_selected.png", |
| | | Name = "左", |
| | | |
| | | }; |
| | | Button btnRight = new Button |
| | | { |
| | | Y = Application.GetRealWidth(78), |
| | | X = Application.GetRealWidth(144), |
| | | Width = Application.GetRealWidth(20), |
| | | Height = Application.GetRealHeight(24), |
| | | UnSelectedImagePath = "AksIcon/you.png", |
| | | SelectedImagePath = "AksIcon/you_selected.png", |
| | | Name = "右", |
| | | |
| | | }; |
| | | |
| | | Button btnOkbj = new Button |
| | | { |
| | | //Y = Application.GetRealWidth(52), |
| | | //X = Application.GetRealWidth(52), |
| | | Width = Application.GetRealWidth(76), |
| | | Height = Application.GetRealWidth(76), |
| | | Radius = (uint)Application.GetRealHeight(38), |
| | | Gravity=Gravity.Center, |
| | | BackgroundColor = MusicColor.WhiteColor, |
| | | |
| | | |
| | | }; |
| | | Button btnOk = new Button |
| | | { |
| | | //Y = Application.GetRealWidth(76), |
| | | //X = Application.GetRealWidth(76), |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(28), |
| | | Height = Application.GetRealWidth(28), |
| | | Radius = (uint)Application.GetRealHeight(14), |
| | | BackgroundColor = MusicColor.SelectedColor, |
| | | Name = "确定" |
| | | }; |
| | | |
| | | public void AddView(FrameLayout layout) |
| | | { |
| | | layout.AddChidren(parentFl); |
| | | parentFl.AddChidren(btnTop); |
| | | parentFl.AddChidren(btnBottom); |
| | | parentFl.AddChidren(btnLeft); |
| | | parentFl.AddChidren(btnRight); |
| | | parentFl.AddChidren(btnOkbj); |
| | | parentFl.AddChidren(btnOk); |
| | | |
| | | |
| | | this.Width = Application.GetRealWidth(width); |
| | | this.Height = Application.GetRealHeight(height); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 上 |
| | | /// 动态加载图片界面 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | public void SetTopClickListener(Action<KeypadEntity> action) |
| | | public void LoadSourcePage() |
| | | { |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | var mList = GetList(); |
| | | int currnetheightValue = 0; |
| | | int currnetWidthValue = 0; |
| | | int heightMaxValue = 38; |
| | | int widthMaxValue = 68; |
| | | //获取相对一个纬度值 |
| | | int widthDimensionValue = this.Width - Application.GetRealWidth(24) - Application.GetRealWidth(24) - Application.GetRealHeight(widthMaxValue / 2); |
| | | for (int i = 0; i < mList.Count; i++) |
| | | { |
| | | btnTop.IsSelected = false; |
| | | //弹起来还原背景颜色 |
| | | }; |
| | | btnTop.MouseUpEventHandler += UpClick; |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> DownClick = (sender, e) => |
| | | var source = mList[i]; |
| | | CustomButton button = new CustomButton(); |
| | | this.AddChidren(button); |
| | | button.Tag = source; |
| | | button.Y = Application.GetRealHeight(currnetheightValue); |
| | | button.X = Application.GetRealWidth(24) + Application.GetRealWidth(currnetWidthValue); |
| | | button.Text = source; |
| | | currnetWidthValue += (widthMaxValue + 37);//37是隔间值 |
| | | if (widthDimensionValue < Application.GetRealWidth(currnetWidthValue)) |
| | | { |
| | | //按下去改变背景颜色 |
| | | btnTop.IsSelected = true; |
| | | KeypadEntity keypadEntity = new KeypadEntity(); |
| | | keypadEntity.name = btnTop.Name; |
| | | keypadEntity.keypad = "key_up"; |
| | | action?.Invoke(keypadEntity); |
| | | }; |
| | | btnTop.MouseDownEventHandler += DownClick; |
| | | currnetheightValue += (heightMaxValue + 16);//16是隔间值 |
| | | currnetWidthValue = 0; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 下 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | public void SetBottomClickListener(Action<KeypadEntity> action) |
| | | button.SetClickListener((btn) => |
| | | { |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | { |
| | | btnBottom.IsSelected = false; |
| | | |
| | | |
| | | //弹起来还原背景颜色 |
| | | }; |
| | | btnBottom.MouseUpEventHandler += UpClick; |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> DownClick = (sender, e) => |
| | | { |
| | | btnBottom.IsSelected = true; |
| | | KeypadEntity keypadEntity = new KeypadEntity(); |
| | | keypadEntity.name = btnBottom.Name; |
| | | keypadEntity.keypad = "key_down"; |
| | | action?.Invoke(keypadEntity); |
| | | //按下去改变背景颜色 |
| | | }; |
| | | btnBottom.MouseDownEventHandler += DownClick; |
| | | } |
| | | /// <summary> |
| | | /// 左 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | public void SetLeftClickListener(Action<KeypadEntity> action) |
| | | { |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | { |
| | | btnLeft.IsSelected = false; |
| | | //弹起来还原背景颜色 |
| | | }; |
| | | btnLeft.MouseUpEventHandler += UpClick; |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> DownClick = (sender, e) => |
| | | { |
| | | btnLeft.IsSelected = true; |
| | | KeypadEntity keypadEntity = new KeypadEntity(); |
| | | keypadEntity.name = btnLeft.Name; |
| | | keypadEntity.keypad = "key_left"; |
| | | action?.Invoke(keypadEntity); |
| | | //按下去改变背景颜色 |
| | | }; |
| | | btnLeft.MouseDownEventHandler += DownClick; |
| | | } |
| | | /// <summary> |
| | | /// 右 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | public void SetRightClickListener(Action<KeypadEntity> action) |
| | | { |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | { |
| | | btnRight.IsSelected = false; |
| | | //弹起来还原背景颜色 |
| | | }; |
| | | btnRight.MouseUpEventHandler += UpClick; |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> DownClick = (sender, e) => |
| | | { |
| | | //按下去改变背景颜色 |
| | | btnRight.IsSelected = true; |
| | | KeypadEntity keypadEntity = new KeypadEntity(); |
| | | keypadEntity.name = btnRight.Name; |
| | | keypadEntity.keypad = "key_right"; |
| | | action?.Invoke(keypadEntity); |
| | | }; |
| | | btnRight.MouseDownEventHandler += DownClick; |
| | | // MovieLibrary movieLibrary = new MovieLibrary(); |
| | | selectAction?.Invoke(button.Text); |
| | | }); |
| | | //if (CurrnetSelectIndex != -1 && CurrnetSelectIndex == i) |
| | | //{ |
| | | // selectImageAction?.Invoke((int)imageFram.Tag); |
| | | //} |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// ok |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | public void SetOkClickListener(Action<KeypadEntity> action) |
| | | { |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | { |
| | | btnOk.BackgroundColor = MusicColor.SelectedColor;// this.UpBackgroundColor; |
| | | //弹起来还原背景颜色 |
| | | }; |
| | | btnOk.MouseUpEventHandler += UpClick; |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> DownClick = (sender, e) => |
| | | { |
| | | KeypadEntity keypadEntity = new KeypadEntity(); |
| | | keypadEntity.name = btnOk.Name; |
| | | keypadEntity.keypad = "key_ok"; |
| | | action?.Invoke(keypadEntity); |
| | | btnOk.BackgroundColor = 0xffF2F3F7; |
| | | }; |
| | | btnOk.MouseDownEventHandler += DownClick; |
| | | } |
| | | |
| | | private List<string> GetList() |
| | | { |
| | | return new List<string> |
| | | { |
| | | "HDML 1", |
| | | "HDML 2", |
| | | "HDML 3", |
| | | "HDML 4", |
| | | "Live TV", |
| | | "PS", |
| | | "AV", |
| | | }; |
| | | } |
| | | |
| | | |
| | | } |