From 5ec581e5d37b108fc9d59e89afd8e94e21b32080 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期二, 17 十月 2023 17:33:36 +0800
Subject: [PATCH] 2023年10月17日17:33:33

---
 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs |  155 ++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 126 insertions(+), 29 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs
index 25a64f5..87995cc 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs
@@ -15,6 +15,8 @@
         private int leftMargin;
         private int bottomMargin;
         private int rightMargin;
+        private int mWidth;
+        private int mHeight;
         /// <summary>
         /// 涓�琛屽嚑涓厓绱�
         /// </summary>
@@ -23,8 +25,14 @@
         /// 鍒楄〃鏈�澶у��
         /// </summary>
         private int mListCount;
-
-        public Action<KeypadEntity> selectAction = null;
+        /// <summary>
+        /// 鎸夐敭鍥炶皟
+        /// </summary>
+        public Action<KeypadEntity> selectKeyAction = null; 
+        /// <summary>
+        /// 褰辩墖鍥炶皟
+        /// </summary>
+        public Action<MovieLibrary> selectImageAction = null;
 
 
         /// <summary>
@@ -39,6 +47,8 @@
             this.Width = Application.GetRealWidth(width);
             this.Height = Application.GetRealHeight(height);
             this.Radius = (uint)Application.GetRealHeight(radius);
+            this.mWidth = this.Width;
+            this.mHeight = this.Height;
 
 
         }
@@ -64,7 +74,7 @@
         /// </summary>
         public List<KeypadEntity> GetTestList()
         {
-            return AksCommonMethod.Current.GetTYYKeypadList();
+            return AksCommonMethod.Current.GetTYYKeypadList(null);
         }
 
         /// <summary>
@@ -72,7 +82,7 @@
         /// </summary>
         /// <param name="mList">鍒楄〃</param>
         /// <param name="mRowNumber">涓�琛屽灏戜釜鍏冪礌</param>
-        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],澶т簬鑼冨洿,璇ュ�艰涓烘棤鏁�</param>
+        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],鍊艰秴鍑鸿寖鍥磋涓烘棤鏁�</param>
         public void LoadButtonPage(List<KeypadEntity> mList, int mRowNumber, int defaultIndex = -1)
         {
             if (mList == null || mList.Count == 0)
@@ -115,11 +125,22 @@
                     line++;
                     xCount = 0;
                 }
+                //涓嶆敮鎸佹寜閿偣鍑昏儗鏅鑹�
+                if (!keypad.isClicked)
+                {
+                    buttonFram.Enable = false;
+                    buttonFram.GetImageButton().Alpha =0.5f;
+                    buttonFram.GetImageButton().Enable = false;
+                    buttonFram.GetNameButton().Enable = false;
+                    buttonFram.GetNameButton().TextColor = AksCommonMethod.unBackgroundColor;
+                    //buttonFram.BackgroundColor =AksCommonMethod.unParentBackgroundColor;
+
+                }
                 buttonFram.SetClickListener((fl, btnIcon, btnName) =>
                 {
-                    if (buttonFram.Tag != null&& buttonFram.Tag is KeypadEntity)
+                    if (buttonFram.Tag != null && buttonFram.Tag is KeypadEntity)
                     {
-                        selectAction?.Invoke((KeypadEntity)buttonFram.Tag);
+                        selectKeyAction?.Invoke((KeypadEntity)buttonFram.Tag);
                     }
                 });
 
@@ -139,8 +160,8 @@
         /// 鍔ㄦ�佸姞杞芥寜閿晫闈�
         /// </summary>
         /// <param name="mList">鍒楄〃</param>
-        /// <param name="list">鍒楄〃涓储寮�,琛ㄧず鏌愪竴鏉″搴﹀姞瀹�</param>
-        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],澶т簬鑼冨洿,璇ュ�艰涓烘棤鏁�</param>
+        /// <param name="list"> 鍒楄〃涓储寮�,琛ㄧず鏌愪竴鏉″搴﹀姞瀹�,娌℃湁榛樿(new List<int>)</param>
+        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],鍊艰秴鍑鸿寖鍥磋涓烘棤鏁�</param>
         public void LoadButtonPage(List<KeypadEntity> mList, List<int> list,int defaultIndex=-1)
         {
             if (mList == null || mList.Count == 0)
@@ -195,12 +216,20 @@
                     currnetheightValue += ButtonFramLayout.heightFrameLayout;
                     currnetWidthValue = 0;
                 }
-
+                //涓嶆敮鎸佹寜閿偣鍑昏儗鏅鑹�
+                if (!keypad.isClicked)
+                {
+                    buttonFram.Enable = false;
+                    buttonFram.GetImageButton().Alpha = 0.5f;
+                    buttonFram.GetImageButton().Enable = false;
+                    buttonFram.GetNameButton().Enable = false;
+                    buttonFram.GetNameButton().TextColor = AksCommonMethod.unBackgroundColor;
+                }
                 buttonFram.SetClickListener((fl, btnIcon, btnName) =>
                 {
                     if (buttonFram.Tag != null&& buttonFram.Tag is KeypadEntity)
                     {
-                        selectAction?.Invoke((KeypadEntity)buttonFram.Tag);
+                        selectKeyAction?.Invoke((KeypadEntity)buttonFram.Tag);
                     }
                 });
 
@@ -218,7 +247,7 @@
         ///鍔ㄦ�佸姞杞芥暟瀛楁寜閿晫闈�
         /// </summary>
         /// <param name="mList">鍒楄〃</param>
-        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],澶т簬鑼冨洿,璇ュ�艰涓烘棤鏁�</param>
+        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],鍊艰秴鍑鸿寖鍥磋涓烘棤鏁�</param>
         public void LoadNumberButtonPage(List<KeypadEntity> mList)
         {
             if (mList == null || mList.Count == 0)
@@ -227,7 +256,7 @@
             }
             int currnetheightValue = 0;
             int currnetWidthValue = 0;
-            int heightMaxValue = 84;
+            int heightMaxValue = 84-6;
             int widthMaxValue = 78;
             //鑾峰彇鐩稿涓�涓含搴﹀��
             int heightDimensionValue = this.Height - Application.GetRealHeight(this.topMargin) - Application.GetRealHeight(this.bottomMargin) - Application.GetRealHeight(heightMaxValue / 2);
@@ -248,7 +277,9 @@
                     IsBold = true,
                     Tag = keypad,
                     BackgroundColor = MusicColor.WhiteColor,
-                    SelectedBackgroundColor = 0xff454635,
+                    SelectedBackgroundColor = 0xFFF2F3F7,
+                    Radius = (uint)Application.GetRealHeight(8),
+                    SelectedTextColor = MusicColor.TextColor,
                 };
                 this.AddChidren(button);
 
@@ -258,17 +289,31 @@
                     currnetheightValue += heightMaxValue;
                     currnetWidthValue = 0;
                 }
+                //涓嶆敮鎸佹寜閿偣鍑昏儗鏅鑹�
+                if (!keypad.isClicked)
+                {
+                    button.Enable = false;
+                    button.TextColor = AksCommonMethod.unBackgroundColor;
+                }
                 button.MouseDownEventHandler += (sen, e) =>
+                {
+                    
+                    button.IsSelected = true;
+
+                };
+                button.MouseUpOutsideEventHandler += (sen, e) =>
+                {
+
+                    button.IsSelected = false;
+
+                };
+                button.MouseUpEventHandler += (sen, e) =>
                 {
                     if (button.Tag == null || ((KeypadEntity)button.Tag).keypad == "none")
                     {
                         return;
                     }
-                    button.IsSelected = true;
-                    selectAction?.Invoke((KeypadEntity)button.Tag);
-                };
-                button.MouseUpEventHandler += (sen, e) =>
-                {
+                    selectKeyAction?.Invoke((KeypadEntity)button.Tag);
                     button.IsSelected = false;
                 };
 
@@ -284,7 +329,7 @@
         /// 褰辩墖甯冨眬
         /// </summary>
         /// <param name="mList">鍒楄〃</param>
-        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],澶т簬鑼冨洿,璇ュ�艰涓烘棤鏁�</param>
+        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],鍊艰秴鍑鸿寖鍥磋涓烘棤鏁�</param>
         public void LoadImagePage(List<MovieLibrary> mList)
         {
             if (mList == null || mList.Count == 0)
@@ -318,14 +363,14 @@
 
                 imageFram.SetClickListener((fl) =>
                 {
-                    if (imageFram.Tag != null&& imageFram.Tag is KeypadEntity)
+                    if (imageFram.Tag != null&& imageFram.Tag is MovieLibrary)
                     {
-                        selectAction?.Invoke((KeypadEntity)imageFram.Tag);
+                        selectImageAction?.Invoke((MovieLibrary)imageFram.Tag);
                     }
                 });
                 //if (CurrnetSelectIndex != -1 && CurrnetSelectIndex == i)
                 //{
-                //    selectAction?.Invoke((int)imageFram.Tag);
+                //    selectImageAction?.Invoke((int)imageFram.Tag);
                 //}
             }
         }
@@ -334,8 +379,8 @@
         /// 褰辩墖甯冨眬
         /// </summary>
         /// <param name="mRowNumber">涓�琛屽灏戜釜鍏冪礌</param>
-        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],澶т簬鑼冨洿,璇ュ�艰涓烘棤鏁�</param>
-        public void LoadImagePage(List<KeypadEntity> mList, int mRowNumber)
+        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],鍊艰秴鍑鸿寖鍥磋涓烘棤鏁�</param>
+        public void LoadImagePage(List<MovieLibrary> mList, int mRowNumber)
         {
             if (mList == null || mList.Count == 0)
             {
@@ -368,25 +413,77 @@
                 }
                 imageFram.SetClickListener((fl) =>
                 {
-                    if (imageFram.Tag != null)
+                    if (imageFram.Tag != null && imageFram.Tag is MovieLibrary)
                     {
-                        selectAction?.Invoke((KeypadEntity)imageFram.Tag);
+                        selectImageAction?.Invoke((MovieLibrary)imageFram.Tag);
                     }
                 });
 
                 //if (CurrnetSelectIndex != -1 && CurrnetSelectIndex == i)
                 //{
-                //    selectAction?.Invoke((int)imageFram.Tag);
+                //    selectImageAction?.Invoke((MovieLibrary)imageFram.Tag);
                 //}
 
 
+            }
+        }
+
+       private int currnetheightValue1 = 0;
+       private int currnetWidthValue1 = 0;
+       private int heightMaxValue1 = ImageFramlayout.heightFrameLayout;
+       private int widthMaxValue1 = ImageFramlayout.widthFrameLayout;
+        //鑾峰彇鐩稿涓�涓含搴﹀��
+       private int widthDimensionValue1 = Application.GetRealWidth(343) - Application.GetRealHeight(ImageFramlayout.widthFrameLayout / 2);
+        /// <summary>
+        /// 鍔犺浇褰辩墖鍒楄〃甯冨眬
+        /// (鐗规畩甯冨眬)
+        /// </summary>
+        /// <param name="mList">鍒楄〃</param>
+        public void LoadImagePage(List<ImageFramlayout> imageFramlayoutList)
+        {
+
+            if (imageFramlayoutList==null||imageFramlayoutList.Count == 0)
+            {
+                return;
+            }
+            //int currnetheightValue = 0;
+            //int currnetWidthValue = 0;
+            //int heightMaxValue = ImageFramlayout.heightFrameLayout;
+            //int widthMaxValue = ImageFramlayout.widthFrameLayout;
+            ////鑾峰彇鐩稿涓�涓含搴﹀��
+            //int heightDimensionValue = this.Height - Application.GetRealHeight(this.topMargin) - Application.GetRealHeight(this.bottomMargin) - Application.GetRealHeight(heightMaxValue / 2);
+            //int widthDimensionValue = this.Width - Application.GetRealWidth(this.leftMargin) - Application.GetRealWidth(this.rightMargin) - Application.GetRealHeight(widthMaxValue / 2);
+            for (int i = 0; i < imageFramlayoutList.Count; i++)
+            {
+                var imageFram = imageFramlayoutList[i];
+                if (imageFram == null)
+                {
+                    continue;
+                }
+                imageFram.AddView(this);
+                imageFram.Y =Application.GetRealHeight(this.topMargin) + Application.GetRealHeight(currnetheightValue1);
+                imageFram.X = Application.GetRealWidth(currnetWidthValue1);
+                currnetWidthValue1 += (widthMaxValue1 + 8);//8鏄殧闂村��
+                if (widthDimensionValue1 < Application.GetRealWidth(currnetWidthValue1))
+                {
+                    currnetheightValue1 += (heightMaxValue1 + 20);//20鏄殧闂村��
+                    currnetWidthValue1 = 0;
+                }
+
+                imageFram.SetClickListener((fl) =>
+                {
+                    if (imageFram.Tag != null && imageFram.Tag is MovieLibrary)
+                    {
+                        selectImageAction?.Invoke((MovieLibrary)imageFram.Tag);
+                    }
+                });
             }
         }
         /// <summary>
         /// 姘村钩婊戝姩甯冨眬
         /// </summary>
         /// <param name="mList">鍒楄〃</param>
-        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],澶т簬鑼冨洿,璇ュ�艰涓烘棤鏁�</param>
+        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],鍊艰秴鍑鸿寖鍥磋涓烘棤鏁�</param>
         public void LoadHorizontalPage(List<FilterCategoryEntity> mList, int defaultIndex = -1)
         {
             if (mList == null || mList.Count == 0)
@@ -428,7 +525,7 @@
                     keypad.category = filters.category;
                     keypad.filterValue = filters.filterValue;
                     keypad.filterName = filters.filterName;
-                    selectAction?.Invoke(keypad);
+                    selectKeyAction?.Invoke(keypad);
                 };
                 horizontal.InitControl(filterCategory.filters, defaultIndex);
 

--
Gitblit v1.8.0