From e46f393e6bfca4a963b00717d3b1250e5b937ef6 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 16 八月 2023 10:56:43 +0800
Subject: [PATCH] 2023年08月16日10:56:22

---
 HDL-ON_Android/HDL-ON_Android.csproj                                |    6 
 HDL_APP_Project.sln                                                 |    5 +
 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs   |    2 
 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs |   68 +++++++++++++++-
 HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs                   |    1 
 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs |    6 +
 HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs                      |  101 ++++++++++++++++++++++---
 7 files changed, 167 insertions(+), 22 deletions(-)

diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj
index 6260760..558a2ac 100644
--- a/HDL-ON_Android/HDL-ON_Android.csproj
+++ b/HDL-ON_Android/HDL-ON_Android.csproj
@@ -79,9 +79,6 @@
     <Reference Include="System.Numerics.Vectors" />
     <Reference Include="System.Web.Services" />
     <Reference Include="System.Net" />
-    <Reference Include="Shared.Droid">
-      <HintPath>..\DLL\Shared.Droid.dll</HintPath>
-    </Reference>
     <Reference Include="Shared.Droid.HDLWidget">
       <HintPath>..\DLL\Shared.Droid.HDLWidget.dll</HintPath>
     </Reference>
@@ -197,6 +194,9 @@
     <Reference Include="HdlEzvizDroid">
       <HintPath>..\DLL\HdlEzvizDroid.dll</HintPath>
     </Reference>
+    <Reference Include="Shared.Droid">
+      <HintPath>..\..\..\Shared.Droid.dll</HintPath>
+    </Reference>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="MainActivity.cs" />
diff --git a/HDL_APP_Project.sln b/HDL_APP_Project.sln
index 1426310..a98de8e 100644
--- a/HDL_APP_Project.sln
+++ b/HDL_APP_Project.sln
@@ -20,6 +20,11 @@
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AliyuLog", "AliyuLog\AliyuLog.csproj", "{3A0E9FF9-56B6-4323-9AE6-2B22975E399B}"
 EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "瑙e喅鏂规椤�", "瑙e喅鏂规椤�", "{3496ECBF-1379-4C3E-A97C-0C52BD7D7668}"
+	ProjectSection(SolutionItems) = preProject
+		.editorconfig = .editorconfig
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SharedMSBuildProjectFiles) = preSolution
 		HDL_ON\HDL_ON.projitems*{09712674-2a38-407b-b1e2-560b2c352f9a}*SharedItemsImports = 4
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs
index 1b0e233..505a6ef 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs
@@ -34,7 +34,7 @@
         /// 鑾峰彇鍧愭爣搴曢儴鏈�涓嬮潰鐨勯偅涓帶浠剁殑搴曢儴鍧愭爣
         /// </summary>
         /// <returns></returns>
-        private int GetLocationMostLastViewBottom()
+        public int GetLocationMostLastViewBottom()
         {
             int bottomHeight = -1;
 
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs
index 8814d16..ae167b0 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs
@@ -154,6 +154,10 @@
 
                 //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
             };
+            this.Tag = "Cancel";
+            btnImage.Tag = this.Tag;
+            btnName.Tag = this.Tag;
+
             this.MouseUpEventHandler += UpClick;
             btnImage.MouseUpEventHandler += UpClick;
             btnName.MouseUpEventHandler += UpClick;
@@ -170,10 +174,12 @@
 
             EventHandler<MouseEventArgs> DownClick = (sender, e) =>
             {
+                
                 //鎸変笅鍘绘敼鍙樿儗鏅鑹�
                 this.BackgroundColor = 0xFFEFEFEF;
                 action?.Invoke(this, btnImage, btnName);
             };
+
             this.MouseDownEventHandler += DownClick;
             btnImage.MouseDownEventHandler += DownClick;
             btnName.MouseDownEventHandler += DownClick;
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs
index a31a476..5279b01 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>
@@ -45,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;
 
 
         }
@@ -78,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)
@@ -146,7 +150,7 @@
         /// </summary>
         /// <param name="mList">鍒楄〃</param>
         /// <param name="list"> 鍒楄〃涓储寮�,琛ㄧず鏌愪竴鏉″搴﹀姞瀹�,娌℃湁榛樿(new List<int>)</param>
-        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],澶т簬鑼冨洿,璇ュ�艰涓烘棤鏁�</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)
@@ -224,7 +228,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)
@@ -291,7 +295,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)
@@ -341,7 +345,7 @@
         /// 褰辩墖甯冨眬
         /// </summary>
         /// <param name="mRowNumber">涓�琛屽灏戜釜鍏冪礌</param>
-        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],澶т簬鑼冨洿,璇ュ�艰涓烘棤鏁�</param>
+        /// <param name="defaultIndex">榛樿鍊肩储寮曡寖鍥碵0,mList.count-1],鍊艰秴鍑鸿寖鍥磋涓烘棤鏁�</param>
         public void LoadImagePage(List<MovieLibrary> mList, int mRowNumber)
         {
             if (mList == null || mList.Count == 0)
@@ -389,11 +393,63 @@
 
             }
         }
+
+       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)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs
index 866be6f..a1e3c04 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs
@@ -58,6 +58,7 @@
 
             cornerFram.selectKeyAction += (keypadEntity) =>
             {
+
                 if (keypadEntity == null)
                 {
                     return;
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs
index d7406b4..22357c3 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/YkPage.cs
@@ -24,6 +24,8 @@
         {
             this.remoteControl = remoteControlEntity;
         }
+
+        List<ImageFramlayout> imageFramlayoutList =new List<ImageFramlayout>();
         /// <summary>
         /// 褰撳墠鐨勯仴鎺у櫒瀵硅薄
         /// </summary>
@@ -93,7 +95,7 @@
             {
                 this.RemoveFromParent();
             };
-            //鏀惰棌鐐瑰嚮浜嬩欢
+            //鏀惰棌鍥炬爣鐐瑰嚮浜嬩欢
             this.topView.clickSetBtn.MouseUpEventHandler += (sender, e) =>
             {
                 CommonMethod.Current.MainThread(() =>
@@ -128,8 +130,9 @@
             //浜岀骇杩囨护浜嬩欢
             horizontalFl.selectKeyAction += (filters) =>
             {
+                pageNo = 1;//杩樺師椤垫暟
                 AddMemoryFilters(filters);
-                UpdateData();
+                UpdateData(true);
             };
 
         }
@@ -142,16 +145,38 @@
             {
                 return;
             }
-            vv.RemoveAll();
+            vv.RemoveAll(); 
             int count = this.mMovieLibraryList == null ? 0 : this.mMovieLibraryList.Count;
             imageFLayout = new CornerFramLayout(343, count * 168, 0);
             vv.AddChidren(imageFLayout);
             imageFLayout.X = Application.GetRealWidth(16);
-            imageFLayout.LoadImagePage(this.mMovieLibraryList);
+            //imageFLayout.LoadImagePage(this.mMovieLibraryList);
+            imageFLayout.LoadImagePage(imageFramlayoutList);
             imageFLayout.AdjustRealHeight(16);
+
+
+            //鏇村鐨�
+            var btnMore = new Button
+            {
+                Width = Application.GetRealWidth(375),
+                Height = Application.GetRealHeight(30),
+                TextSize = TextSize.Text14,
+                TextColor = MusicColor.TextColor,
+                Text = "鏇村鐨�...",
+                TextAlignment = TextAlignment.TopCenter,
+                Padding = new Padding(0, 20, 0, 20),
+            };
+            vv.AddChidren(btnMore);
+
+            btnMore.MouseDownEventHandler += (sender,e) => {
+                //涓诲姩鏇存柊鏁版嵁
+                UpdateData(false);
+            };
+          
             //褰辩墖浜嬩欢
             imageFLayout.selectImageAction += (movieLibrary) =>
             {
+                
                 CommonMethod.Current.MainThread(() =>
                 {
                     DetailPage detailPage = new DetailPage(remoteControl, movieLibrary);
@@ -166,9 +191,41 @@
             {
                 //鍏抽棴鍒锋柊View锛�
                 vv.EndHeaderRefreshing();
-                UpdateData();
+                //涓诲姩鏇存柊鏁版嵁
+                //UpdateData();
             };
+
+         
+          
         }
+
+
+
+
+
+        /// <summary>
+        /// 鍔犺浇鍥剧墖瀹瑰櫒
+        /// </summary>
+        /// <param name="movieLibrary">movieLibrary</param>
+        private void AddImageFramlayout(MovieLibrary movieLibrary)
+        {
+            CommonMethod.Current.MainThread(() =>
+            {
+                if (movieLibrary == null)
+                {
+                    return;
+                }
+                ImageFramlayout imageFram = new ImageFramlayout();
+                //imageFram.AddView(this);
+                imageFram.Tag = movieLibrary;
+                imageFram.btnName.Text = movieLibrary.name;
+                imageFram.btnImage.ImageBytes = movieLibrary.imageBytes;
+                imageFram.btnScore.Text = movieLibrary.rating;
+                //娣诲姞缂撳瓨
+                imageFramlayoutList.Add(imageFram);
+            });
+        }
+
 
         /// <summary>
         /// 鍒濆鍖栨暟鎹�
@@ -202,7 +259,8 @@
         /// <summary>
         /// 涓诲姩鏇存柊鏁版嵁
         /// </summary>
-        private void UpdateData()
+        /// <param name="isUpdateData">鏄惁鏄簩绾ц繃婊�,true琛ㄧず鏄簩绾ц繃婊よ繃鏉ョ殑</param>
+        private void UpdateData(bool isUpdateData)
         {
 
             CommonMethod.Current.Loading.Start();
@@ -219,7 +277,18 @@
                     CommonMethod.Current.MainThread(() =>
                     {
                         CommonMethod.Current.Loading.Hide();
-                        this.LoadImageFLayout();
+                        if (isUpdateData)
+                        {
+                            //娓呯┖鎵�鏈夋棫褰辩墖鏁版嵁,閲嶆柊鍔犺浇鏂板奖鐗囨暟鎹�
+                            this.LoadImageFLayout();
+                        }
+                        else
+                        {
+                            //杩藉姞鏂版暟鎹湪鏃ф暟鎹悗闈�
+                            imageFLayout.LoadImagePage(imageFramlayoutList);
+                            imageFLayout.AdjustRealHeight(16);
+                        }
+
                     });
                 }
             });
@@ -227,15 +296,18 @@
         }
 
         /// <summary>
-        /// 椤甸潰鏁版嵁澶勭悊閫昏緫
+        /// 鏁版嵁澶勭悊閫昏緫
         /// </summary>
         /// <param name="newList">鏂板垪琛ㄦ暟鎹�</param>
         private void DataTreating(List<MovieLibrary> newList)
         {
-            if (newList == null)
+            if (newList == null || newList.Count == 0)
             {
                 return;
             }
+            //鏈夋柊鏁版嵁锛屾竻绌烘棫鏁版嵁
+            imageFramlayoutList.Clear();
+
             for (int i = 0; i < newList.Count; i++)
             {
                 var mMovieLibrary = newList[i];
@@ -245,19 +317,25 @@
                 mMovieLibrary.imageBytes = bytes;
 
             }
+          
             for (int i = 0; i < newList.Count; i++)
             {
                 //鍘婚噸
                 var mMovieLibrary = this.mMovieLibraryList.Find((o) => o.movieId == newList[i].movieId);
                 if (mMovieLibrary == null)
                 {
-                    //鏂板垪琛ㄩ粯璁ゅ姞鍦ㄥ墠闈�
+                    //鏂板垪琛ㄩ粯璁ゅ姞鍦ㄦ渶鍓嶉潰
                     this.mMovieLibraryList.Insert(0, newList[i]);
+
                 }
+                //娣诲姞鍥剧墖瀹瑰櫒
+                AddImageFramlayout(newList[i]);
+
             }
+
             if (newList.Count == SendMethod.pageSize)
             {
-                //鏁版嵁鍥炲鏇存柊椤垫暟
+                //鏇存柊椤垫暟
                 pageNo++;
             }
 
@@ -270,7 +348,6 @@
         /// <param name="filters">杩囨护鏉′欢</param>
         private void AddMemoryFilters(Filters filters)
         {
-
             if (FiltersList.ContainsKey(filters.category))
             {
                 FiltersList.Remove(filters.category);

--
Gitblit v1.8.0