| | |
| | | /// <summary> |
| | | /// 切换设备容器 |
| | | /// </summary> |
| | | TypeMultiFramLayout typeMultiFramLayout; |
| | | TypeMultiFramLayout typeMultiFramLayout; |
| | | TypeSingleFramLayout tyySingleFramLayout; |
| | | |
| | | Button switchBtn; |
| | |
| | | private void EventListener() |
| | | { |
| | | //开关 |
| | | switchBtn.MouseDownEventHandler += (senser, e) => |
| | | switchBtn.MouseUpEventHandler += (senser, e) => |
| | | { |
| | | switchBtn.IsSelected = true; |
| | | switchBtn.IsSelected = false; |
| | | KeyControl("on_off", "开/关"); |
| | | }; |
| | | //信息 |
| | |
| | | //1 |
| | | number1FL.SetClickListener(() => |
| | | { |
| | | KeyControl("number_1", "1"); |
| | | KeyControl("number_1", "1"); |
| | | }); |
| | | //2 |
| | | number2FL.SetClickListener(() => |
| | |
| | | |
| | | }); |
| | | //左 |
| | | btnLeft.MouseDownEventHandler += (sender, e) => |
| | | btnLeft.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_left_selected.png"; |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_ok.png"; |
| | | KeyControl("key_left", "左"); |
| | | |
| | | }; |
| | | //上 |
| | | btnShang.MouseDownEventHandler += (sender, e) => |
| | | btnShang.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_shang_selected.png"; |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_ok.png"; |
| | | KeyControl("key_up", "上"); |
| | | |
| | | }; |
| | |
| | | //右 |
| | | btnRight.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_right_selected.png"; |
| | | |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_ok.png"; |
| | | KeyControl("key_right", "右"); |
| | | |
| | | }; |
| | | |
| | | //下 |
| | | btnXia.MouseDownEventHandler += (sender, e) => |
| | | btnXia.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_xia_selected.png"; |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_ok.png"; |
| | | |
| | | KeyControl("key_down", "下"); |
| | | }; |
| | | //OK |
| | | btnOk.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_ok_selected.png"; |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_ok.png"; |
| | | |
| | | KeyControl("key_ok", "确定"); |
| | | }; |
| | | //音量+ |
| | | btnYingliangjia.MouseDownEventHandler += (sen, e) => { |
| | | btnYingliangjia.IsSelected = true; |
| | | btnYingliangjia.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | btnYingliangjia.IsSelected = false; |
| | | KeyControl("volume_up", "音量+"); |
| | | }; |
| | | //音量- |
| | | btnYingliangjian.MouseDownEventHandler += (sen, e) => { |
| | | btnYingliangjian.IsSelected = true; |
| | | btnYingliangjian.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | btnYingliangjian.IsSelected = false; |
| | | KeyControl("volume_down", "音量-"); |
| | | }; |
| | | //频道+ |
| | | btnPindaojia.MouseDownEventHandler += (sen, e) => { |
| | | btnPindaojia.IsSelected = true; |
| | | btnPindaojia.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | btnPindaojia.IsSelected = false; |
| | | KeyControl("ch_up", "频道+"); |
| | | }; |
| | | //频道- |
| | | btnPindaojian.MouseDownEventHandler += (sen, e) => { |
| | | btnPindaojian.IsSelected = true; |
| | | btnPindaojian.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | btnPindaojian.IsSelected = false; |
| | | KeyControl("ch_down", "频道-"); |
| | | }; |
| | | |
| | |
| | | action?.Invoke(IntType.Control); |
| | | }); |
| | | } |
| | | if (tyySingleFramLayout!=null) { |
| | | tyySingleFramLayout.SetClickListener((f) => { |
| | | if (tyySingleFramLayout != null) |
| | | { |
| | | tyySingleFramLayout.SetClickListener((f) => |
| | | { |
| | | action?.Invoke(IntType.Control); |
| | | }); |
| | | } |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text16, |
| | | Text= this.remoteControl.name, |
| | | Text = this.remoteControl.name, |
| | | IsBold = true, |
| | | }; |
| | | this.AddChidren(btnTitle); |
| | |
| | | { |
| | | Y = btnTitle.Bottom + Application.GetRealHeight(16), |
| | | Width = Application.GetRealWidth(240), |
| | | Height = Application.GetRealHeight(1095-122),//遥控器固定高度 |
| | | Height = Application.GetRealHeight(1095 - 122 - 60),//遥控器固定高度 |
| | | Radius = (uint)Application.GetRealHeight(17), |
| | | BackgroundColor = 0xff798394, |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | Y = btnTitle.Bottom + Application.GetRealHeight(16), |
| | | //X = Application.GetRealWidth(71), |
| | | Width = Application.GetRealWidth(232), |
| | | Height = Application.GetRealHeight(1095-122),//遥控器固定高度 |
| | | Height = Application.GetRealHeight(1095 - 122 - 60),//遥控器固定高度 |
| | | Radius = (uint)Application.GetRealHeight(17), |
| | | BackgroundColor = 0xff19181E, |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | |
| | | switchBtn = new Button |
| | | { |
| | | Height = Application.GetRealWidth(32), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(48), |
| | | Width = Application.GetRealWidth(48), |
| | | Gravity = Gravity.Center, |
| | | UnSelectedImagePath = "AksIcon/ykq_kai.png", |
| | | SelectedImagePath= "AksIcon/ykq_kaiguang_selected.png" |
| | | SelectedImagePath = "AksIcon/ykq_kaiguang_selected.png" |
| | | }; |
| | | switchFl.AddChidren(switchBtn); |
| | | switchBtn.MouseUpEventHandler += (senser, e) => |
| | | switchBtn.MouseDownEventHandler += (senser, e) => |
| | | { |
| | | switchBtn.IsSelected = true; |
| | | }; |
| | | switchBtn.MouseUpOutsideEventHandler += (senser, e) => |
| | | { |
| | | switchBtn.IsSelected = false; |
| | | }; |
| | | |
| | | int h = 49-6; |
| | | int h = 49 - 6; |
| | | int offset = 28;//x轴偏移量 |
| | | int septal = 36;//间隔 |
| | | #region |
| | |
| | | var baseFl = new BaseFramLayout |
| | | { |
| | | Y = line8Fl.Bottom, |
| | | Height = Application.GetRealHeight(207-32-12), |
| | | Height = Application.GetRealHeight(207 - 32 - 12), |
| | | }; |
| | | layout.AddChidren(baseFl); |
| | | |
| | |
| | | SelectedImagePath = "AksIcon/ykq_yingliangjia_selected.png", |
| | | }; |
| | | baseFl.AddChidren(btnYingliangjia); |
| | | btnYingliangjia.MouseUpEventHandler += (sen,e) => { |
| | | btnYingliangjia.MouseDownEventHandler += (sen, e) => |
| | | { |
| | | btnYingliangjia.IsSelected = true; |
| | | }; |
| | | btnYingliangjia.MouseUpOutsideEventHandler += (sen, e) => |
| | | { |
| | | |
| | | btnYingliangjia.IsSelected = false; |
| | | }; |
| | |
| | | SelectedImagePath = "AksIcon/ykq_yingliangjian_selected.png", |
| | | }; |
| | | baseFl.AddChidren(btnYingliangjian); |
| | | btnYingliangjian.MouseUpEventHandler += (sen, e) => { |
| | | btnYingliangjian.MouseDownEventHandler += (sen, e) => |
| | | { |
| | | |
| | | btnYingliangjian.IsSelected = true; |
| | | }; |
| | | btnYingliangjian.MouseUpOutsideEventHandler += (sen, e) => |
| | | { |
| | | |
| | | btnYingliangjian.IsSelected = false; |
| | | }; |
| | | |
| | | |
| | | |
| | | btnPindaojia = new Button |
| | | btnPindaojia = new Button |
| | | { |
| | | Y = Application.GetRealHeight(16), |
| | | X = Application.GetRealWidth(170), |
| | |
| | | SelectedImagePath = "AksIcon/ykq_pindaojia_selected.png", |
| | | }; |
| | | baseFl.AddChidren(btnPindaojia); |
| | | btnPindaojia.MouseUpEventHandler += (sen, e) => { |
| | | btnPindaojia.MouseDownEventHandler += (sen, e) => |
| | | { |
| | | |
| | | btnPindaojia.IsSelected = true; |
| | | }; |
| | | btnPindaojia.MouseUpOutsideEventHandler += (sen, e) => |
| | | { |
| | | |
| | | btnPindaojia.IsSelected = false; |
| | | }; |
| | |
| | | SelectedImagePath = "AksIcon/ykq_pindaojian_selected.png", |
| | | }; |
| | | baseFl.AddChidren(btnPindaojian); |
| | | btnPindaojian.MouseUpEventHandler += (sen, e) => { |
| | | btnPindaojian.MouseDownEventHandler += (sen, e) => |
| | | { |
| | | |
| | | btnPindaojian.IsSelected = true; |
| | | }; |
| | | |
| | | btnPindaojian.MouseUpOutsideEventHandler += (sen, e) => |
| | | { |
| | | |
| | | btnPindaojian.IsSelected = false; |
| | | }; |
| | |
| | | |
| | | |
| | | |
| | | btnLeft.MouseUpEventHandler += (sender, e) => |
| | | |
| | | |
| | | btnLeft.MouseUpOutsideEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_ok.png"; |
| | | |
| | | }; |
| | | btnShang.MouseUpEventHandler += (sender, e) => |
| | | btnLeft.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_left_selected.png"; |
| | | |
| | | }; |
| | | btnShang.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_shang_selected.png"; |
| | | |
| | | |
| | | }; |
| | | btnShang.MouseUpOutsideEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_ok.png"; |
| | | |
| | | }; |
| | | btnRight.MouseUpEventHandler += (sender, e) => |
| | | btnRight.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_right_selected.png"; |
| | | |
| | | }; |
| | | btnRight.MouseUpOutsideEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_ok.png"; |
| | | |
| | | }; |
| | | btnXia.MouseUpEventHandler += (sender, e) => |
| | | |
| | | btnXia.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_xia_selected.png"; |
| | | |
| | | }; |
| | | |
| | | btnXia.MouseUpOutsideEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_ok.png"; |
| | | |
| | | }; |
| | | btnOk.MouseUpEventHandler += (sender, e) => |
| | | btnOk.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_ok_selected.png"; |
| | | |
| | | }; |
| | | btnOk.MouseUpOutsideEventHandler += (sender, e) => |
| | | { |
| | | okFl.BackgroundImagePath = "AksIcon/ykq_ok.png"; |
| | | |
| | |
| | | dengguanFL.AddTextButtonView(); |
| | | dengguanFL.GetImageButton().UnSelectedImagePath = "AksIcon/ykq_dengguan.png"; |
| | | dengguanFL.GetImageButton().SelectedImagePath = "AksIcon/ykq_dengguang_selected.png"; |
| | | dengguanFL.GetTextButton().Text = "灯关"; |
| | | dengguanFL.GetTextButton().Text = "灯光1"; |
| | | dengguanFL.AddClickView(); |
| | | |
| | | |
| | |
| | | dankongdengFL.AddTextButtonView(); |
| | | dankongdengFL.GetImageButton().UnSelectedImagePath = "AksIcon/ykq_dankongdeng.png"; |
| | | dankongdengFL.GetImageButton().SelectedImagePath = "AksIcon/ykq_dankongdeng_selected.png"; |
| | | dankongdengFL.GetTextButton().Text = "单控灯"; |
| | | dankongdengFL.GetTextButton().Text = "灯光2"; |
| | | dankongdengFL.AddClickView(); |
| | | |
| | | #endregion |
| | |
| | | |
| | | if (tyySingleFramLayout.btnName.GetTextWidth() > Application.GetRealWidth(48)) |
| | | { |
| | | tyySingleFramLayout.singleFramLayout.Width = Application.GetRealWidth(101 - 48) + tyySingleFramLayout.btnName.GetTextWidth(); |
| | | tyySingleFramLayout.singleFramLayout.Width = Application.GetRealWidth(101 - 48) + tyySingleFramLayout.btnName.GetTextWidth(); |
| | | tyySingleFramLayout.singleFramLayout.X = Application.GetRealWidth(226 + 48) - tyySingleFramLayout.btnName.GetTextWidth(); |
| | | tyySingleFramLayout.btnName.Width =tyySingleFramLayout.btnName.GetTextWidth(); |
| | | tyySingleFramLayout.btnName.Width = tyySingleFramLayout.btnName.GetTextWidth(); |
| | | tyySingleFramLayout.btnRightImage.X = tyySingleFramLayout.btnName.Right + Application.GetRealWidth(8); |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | |
| | | typeMultiFramLayout = new TypeMultiFramLayout(); |
| | | typeMultiFramLayout.multiFramLayout.Y = Application.GetRealHeight(16); |
| | | typeMultiFramLayout.AddView(cornerBottomFram); |
| | | typeMultiFramLayout.btnBottonRightName.Text = this.remoteControl.name; |
| | | typeMultiFramLayout.btnRightName.Text = this.remoteControl.name; |
| | | } |
| | | |
| | | this.AdjustRealHeight(16); |
| | |
| | | /// </summary> |
| | | /// <param name="keypad"><按键标识/param> |
| | | /// <param name="keyName"><按键名称(打印用的)/param> |
| | | |
| | | private void KeyControl(string keypad, string keyName,bool isSupport=true) |
| | | |
| | | 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,isSupport); |
| | | SendMethod.Current.KeypadExecute(remoteControl.deviceId, remoteControl.rcId, keypad, keyName, isSupport); |
| | | } |
| | | catch { } |
| | | finally |
| | |
| | | class CustomFrameLayout : FrameLayout |
| | | { |
| | | public const int widthFrameLayout = 36; |
| | | public const int heightFrameLayout = 49-6; |
| | | public const int heightFrameLayout = 49 - 6; |
| | | public CustomFrameLayout(int width = widthFrameLayout, int height = heightFrameLayout) |
| | | { |
| | | this.Width = Application.GetRealWidth(width); |
| | |
| | | SelectedTextColor = MusicColor.MusicTxet14SelectedColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Padding=new Padding(0,0,0,0), |
| | | Padding = new Padding(0, 0, 0, 0), |
| | | }; |
| | | Button btnNumber = new Button |
| | | { |
| | |
| | | Height = Application.GetRealWidth(12), |
| | | Gravity = Gravity.Center, |
| | | Radius = (uint)Application.GetRealWidth(6), |
| | | BackgroundColor=0x00000000, |
| | | BackgroundColor = 0x00000000, |
| | | SelectedBackgroundColor = 0xFFF2F3F7, |
| | | }; |
| | | |
| | |
| | | btnNumber.IsSelected = true; |
| | | btn.IsSelected = true; |
| | | |
| | | action?.Invoke(); |
| | | |
| | | }; |
| | | |
| | | clickFl.MouseUpEventHandler += (sender, e) => |
| | |
| | | btnText.IsSelected = false; |
| | | btnNumber.IsSelected = false; |
| | | btn.IsSelected = false; |
| | | action?.Invoke(); |
| | | }; |
| | | |
| | | clickFl.MouseUpOutsideEventHandler += (sender, e) => |
| | | { |
| | | //this.BackgroundColor = 0x00000000; |
| | | btnImage.IsSelected = false; |
| | | btnText.IsSelected = false; |
| | | btnNumber.IsSelected = false; |
| | | btn.IsSelected = false; |
| | | }; |
| | | |
| | | } |