From 5868b389a3544cf14ff65e87b554c07349badd28 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期一, 16 十月 2023 15:30:46 +0800 Subject: [PATCH] 2023年10月16日15:30:28 --- HDL_ON/UI/UI2/FuntionControlView/Aks/GfPage.cs | 89 ++++++++++++++++++++++++++++++++++---------- 1 files changed, 69 insertions(+), 20 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/GfPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/GfPage.cs index 9eec8dd..1af1e6a 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/GfPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/GfPage.cs @@ -34,6 +34,7 @@ public Action<IntType> action; CornerFramLayout cornerFram; TypeMultiFramLayout typeMultiFramLayout; + TypeSingleFramLayout gfSingleFramLayout; public void Show() { @@ -53,24 +54,37 @@ private void EventListener() { - cornerFram.selectKeyAction += (keypadEntity) => + cornerFram.selectKeyAction += (keypadEntity) => { this.KeyControl(keypadEntity.keypad, keypadEntity.name); }; - //鏃跺簭鍣� - typeMultiFramLayout.SetLeftFlClickListener((f) => - { - SxqPage sxqPage = new SxqPage(this.sequencerList, this.remoteControl.deviceId); - MainPage.BasePageView.AddChidren(sxqPage); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - sxqPage.Show(); - }); - //璁惧鍒囨崲 - typeMultiFramLayout.SetRightFlClickListener((f) => + if (gfSingleFramLayout != null) { - action?.Invoke(IntType.HiFi); - }); + //璁惧鍒囨崲 + gfSingleFramLayout.SetClickListener((f) => + { + action?.Invoke(IntType.HiFi); + }); + } + + if (typeMultiFramLayout != null) + { + //鏃跺簭鍣� + typeMultiFramLayout.SetLeftFlClickListener((f) => + { + SxqPage sxqPage = new SxqPage(this.sequencerList, this.remoteControl.deviceId); + MainPage.BasePageView.AddChidren(sxqPage); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + sxqPage.Show(); + + }); + //璁惧鍒囨崲 + typeMultiFramLayout.SetRightFlClickListener((f) => + { + action?.Invoke(IntType.HiFi); + }); + } } @@ -86,19 +100,19 @@ TextAlignment = TextAlignment.CenterLeft, TextColor = MusicColor.TextColor, TextSize = TextSize.Text16, - Text= this.remoteControl.name, + Text = this.remoteControl.name, IsBold = true, }; this.AddChidren(btnTitle); - cornerFram = new CornerFramLayout(343, 284-18, 17); + cornerFram = new CornerFramLayout(343, 284 - 18, 17); cornerFram.X = Application.GetRealWidth(16); cornerFram.Y = btnTitle.Bottom + Application.GetRealHeight(16); this.AddChidren(cornerFram); cornerFram.SetMargin(16, 0, 16, 0); - cornerFram.LoadButtonPage(AksCommonMethod.Current.GetGFKeypadList(this.remoteControl),4); + cornerFram.LoadButtonPage(AksCommonMethod.Current.GetGFKeypadList(this.remoteControl), 4); CornerFramLayout cornerBottomFram = new CornerFramLayout(343, 72, 17); @@ -108,12 +122,47 @@ cornerBottomFram.Radius = (uint)Application.GetRealHeight(17); this.AddChidren(cornerBottomFram); - typeMultiFramLayout = new TypeMultiFramLayout(); - typeMultiFramLayout.multiFramLayout.Gravity = Gravity.Center; - typeMultiFramLayout.AddView(cornerBottomFram); - typeMultiFramLayout.btnBottonRightName.Text = this.remoteControl.name; + if (sequencerList.Count == 0) + { + //娌℃湁鏃跺簭鍣� + gfSingleFramLayout = new TypeSingleFramLayout(); + gfSingleFramLayout.AddView(cornerBottomFram); + gfSingleFramLayout.singleFramLayout.X = Application.GetRealWidth(226); + gfSingleFramLayout.singleFramLayout.Width = Application.GetRealWidth(101); + gfSingleFramLayout.singleFramLayout.Gravity = Gravity.CenterVertical; + gfSingleFramLayout.btnName.Text = this.remoteControl.name; + gfSingleFramLayout.btnName.X = Application.GetRealWidth(16); + gfSingleFramLayout.btnName.Width = Application.GetRealWidth(48); + gfSingleFramLayout.btnRightImage.X = gfSingleFramLayout.btnName.Right + Application.GetRealWidth(8); + gfSingleFramLayout.btnRightImage.Width = Application.GetRealWidth(16); + gfSingleFramLayout.btnRightImage.Height = Application.GetRealWidth(16); + gfSingleFramLayout.btnRightImage.UnSelectedImagePath = "AksIcon/xuanze.png"; + gfSingleFramLayout.btnRightImage.Gravity = Gravity.CenterVertical; + gfSingleFramLayout.btnLeftImage.Visible = false; + + if (gfSingleFramLayout.btnName.GetTextWidth() > Application.GetRealWidth(48)) + { + gfSingleFramLayout.singleFramLayout.Width = Application.GetRealWidth(101 - 48) + gfSingleFramLayout.btnName.GetTextWidth(); + gfSingleFramLayout.singleFramLayout.X = Application.GetRealWidth(226 + 48) - gfSingleFramLayout.btnName.GetTextWidth(); + gfSingleFramLayout.btnName.Width = gfSingleFramLayout.btnName.GetTextWidth(); + gfSingleFramLayout.btnRightImage.X = gfSingleFramLayout.btnName.Right + Application.GetRealWidth(8); + } + } + else + { + //鏈夋椂搴忓櫒 + typeMultiFramLayout = new TypeMultiFramLayout(); + typeMultiFramLayout.multiFramLayout.Gravity = Gravity.Center; + typeMultiFramLayout.AddView(cornerBottomFram); + typeMultiFramLayout.btnBottonRightName.Text = this.remoteControl.name; + + } this.AdjustRealHeight(16); + + + + } /// <summary> -- Gitblit v1.8.0