zhaoyang 2 жил өмнө
parent
commit
f6502ffb73

+ 1 - 0
FGUIProject/assets/poem/componentsGallery/ComNormal.xml

@@ -39,6 +39,7 @@
       <gearDisplay controller="c1" pages="0,1"/>
       <relation target="" sidePair="height-height"/>
     </component>
+    <component id="n38_v95q" name="comOpenLoad" src="r9ri12p" fileName="componentsGallery/ComPullHead.xml" xy="460,489" touchable="false"/>
     <list id="n23_r9ri" name="listRank" xy="43,483" size="997,1136" overflow="scroll" lineGap="20" defaultItem="ui://iyz778gkr9ri10y" align="center" autoClearItems="true">
       <gearDisplay controller="c1" pages="2"/>
       <relation target="" sidePair="top-top,bottomext-bottom"/>

+ 4 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_ComNormal.cs

@@ -19,6 +19,7 @@ namespace UI.Poem
         public GGroup m_grpTime;
         public GComboBox m_comBoBox;
         public UI_ComScroll m_comScroll;
+        public UI_ComPullHead m_comOpenLoad;
         public GList m_listRank;
         public GTextField m_txtRank;
         public GGroup m_grpResult;
@@ -81,6 +82,7 @@ namespace UI.Poem
             m_grpTime = (GGroup)comp.GetChild("grpTime");
             m_comBoBox = (GComboBox)comp.GetChild("comBoBox");
             m_comScroll = (UI_ComScroll)UI_ComScroll.Create(comp.GetChild("comScroll"));
+            m_comOpenLoad = (UI_ComPullHead)UI_ComPullHead.Create(comp.GetChild("comOpenLoad"));
             m_listRank = (GList)comp.GetChild("listRank");
             m_txtRank = (GTextField)comp.GetChild("txtRank");
             m_grpResult = (GGroup)comp.GetChild("grpResult");
@@ -100,6 +102,8 @@ namespace UI.Poem
             m_comBoBox = null;
             m_comScroll.Dispose();
             m_comScroll = null;
+            m_comOpenLoad.Dispose();
+            m_comOpenLoad = null;
             m_listRank = null;
             m_txtRank = null;
             m_grpResult = null;

+ 32 - 4
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemGalleryView.cs

@@ -59,6 +59,9 @@ namespace GFGGame
         private List<long> _galleryDatas = new List<long>();
         private int _sortType = 0;//由GallerySortType定义
         private int _pageCount = 4;
+        private int _lastListCount = 0;
+        private int _lastList1Count = 0;
+        private int _lastGalleryDatasCount = 0;
         private int _tabIndex = 0;//当前选中大页签下标,首页0投稿1收藏2
         private int _subtabIndex = 0;//当前选中小页签下标,推荐0好友1排行榜2;我的收藏0我的作品1
 
@@ -167,6 +170,7 @@ namespace GFGGame
 
                 // OnFavoritesTabChange();
                 // OnNormalTabChange();
+                _ui.m_comNormal.m_comOpenLoad.target.visible = true;
                 UpdateList();
                 PullDown();
                 onPullDownRelease();
@@ -357,9 +361,11 @@ namespace GFGGame
 
         private void onScrollEnd()
         {
-            if (_comScroll.scrollPane.percY == 1)
+            if (_comScroll.scrollPane.percY == 1 && _lastGalleryDatasCount < _galleryDatas.Count)
             {
                 ReqGalleryList(_galleryDatas.Count);
+                // PullUp();
+                // OnPullUpToRefresh();
             }
         }
         //请求刷新
@@ -378,6 +384,7 @@ namespace GFGGame
                 Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, startIndex, UpdateGalleryList));
             }
         }
+
         private void UpdateGalleryList()
         {
             if (_tabIndex == TabType.RECOVER && _subtabIndex == RecommendType.RANK)
@@ -638,12 +645,21 @@ namespace GFGGame
             _comScroll.scrollPane.LockHeader(0);
             isPullDown = false;
         }
+        //自动上拉
+        private void PullUp()
+        {
+            GComponent header = _comScroll.scrollPane.footer;
+            header.height = header.sourceHeight;
+        }
 
         //上拉刷新
         private async void OnPullUpToRefresh()
         {
             GComponent footer = _comScroll.scrollPane.footer;
             if (footer.height < footer.sourceHeight || isPullUp) return;
+            // _lastListCount = _list.numItems;
+            // _lastList1Count = _list1.numItems;
+            // _lastGalleryDatasCount = _galleryDatas.Count;
 
             isPullUp = true;
             _comScroll.scrollPane.LockFooter(footer.sourceHeight + 10);
@@ -652,9 +668,22 @@ namespace GFGGame
             // OnPullUpTimeComplete();
             if (result)
             {
-                Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, _galleryDatas.Count, UpdateGalleryList));
+                Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, _galleryDatas.Count, UpdatePullUp));
             }
         }
+        private void UpdatePullUp()
+        {
+            UpdateGalleryList();
+            // if (_list.numItems > _lastListCount)
+            // {
+            //     _list.ScrollToView(_lastListCount, true);
+            // }
+            // else if (_list1.numItems > _lastList1Count)
+            // {
+            //     _list1.ScrollToView(_lastList1Count, true);
+            // }
+
+        }
 
         private void OnPullUpTimeComplete()
         {
@@ -673,8 +702,7 @@ namespace GFGGame
             OnPullDownTimeComplete();
             // Timers.inst.Remove(OnPullUpTimeComplete);
             OnPullUpTimeComplete();
+            _ui.m_comNormal.m_comOpenLoad.target.visible = false;
         }
-
-
     }
 }

BIN
GameClient/Assets/ResIn/UI/Poem/Poem_fui.bytes