소스 검색

优化画廊列表

zhaoyang 2 년 전
부모
커밋
208c5afa5f

+ 1 - 1
FGUIProject/assets/poem/componentsGallery/ComFavorites.xml

@@ -10,7 +10,7 @@
       <Button icon="ui://iyz778gkr9ri12v" selectedIcon="ui://iyz778gkr9ri12y" controller="c1" page="1"/>
     </component>
     <group id="n27_r9ri" name="grpTab" xy="244,210" size="592,83"/>
-    <component id="n30_r9ri" name="comScroll" src="r9ri139" fileName="componentsGallery/ComScroll.xml" xy="24,400" size="1032,936">
+    <component id="n33_qpj3" name="comScroll" src="r9ri139" fileName="componentsGallery/ComScroll.xml" xy="24,399" size="1032,937">
       <relation target="" sidePair="height-height"/>
     </component>
   </displayList>

+ 4 - 5
FGUIProject/assets/poem/componentsGallery/ComNormal.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1619" overflow="hidden" opaque="false">
-  <controller name="c1" pages="0,,1,,2," selected="2"/>
+  <controller name="c1" pages="0,,1,,2," selected="0"/>
   <displayList>
     <component id="n11_r9ri" name="btnShop" src="r9ri10v" fileName="componentsGallery/Button9.xml" xy="900,56" size="180,113">
       <gearDisplay controller="c1" pages="0,1"/>
@@ -12,13 +12,13 @@
     </component>
     <image id="n5_r9ri" name="n5" src="r9ri12w" fileName="imagesGallery/hl_sczpxzdik.png" xy="137,206" size="805,76" group="n8_r9ri"/>
     <component id="n6_r9ri" name="btnTab0" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="120,204" group="n8_r9ri">
-      <Button icon="ui://iyz778gkr9ri11p" selectedIcon="ui://iyz778gkr9ri11h" controller="c1" page="0"/>
+      <Button checked="true" icon="ui://iyz778gkr9ri11p" selectedIcon="ui://iyz778gkr9ri11h" controller="c1" page="0"/>
     </component>
     <component id="n7_r9ri" name="btnTab1" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="400,204" group="n8_r9ri">
       <Button icon="ui://iyz778gkr9ri11o" selectedIcon="ui://iyz778gkr9ri11g" controller="c1" page="1"/>
     </component>
     <component id="n9_r9ri" name="btnTab2" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="680,204" group="n8_r9ri">
-      <Button checked="true" icon="ui://iyz778gkr9ri11n" selectedIcon="ui://iyz778gkr9ri11f" controller="c1" page="2"/>
+      <Button icon="ui://iyz778gkr9ri11n" selectedIcon="ui://iyz778gkr9ri11f" controller="c1" page="2"/>
     </component>
     <group id="n8_r9ri" name="grpTab" xy="120,204" size="840,83"/>
     <image id="n25_r9ri" name="n25" src="r9ri11e" fileName="imagesGallery/hl_xzbtzt.png" xy="310,309" group="n26_r9ri"/>
@@ -35,11 +35,10 @@
       <gearDisplay controller="c1" pages="0"/>
       <ComboBox visibleItemCount="10"/>
     </component>
-    <component id="n36_r9ri" name="comScroll" src="r9ri139" fileName="componentsGallery/ComScroll.xml" xy="24,483">
+    <component id="n43_qpj3" name="comScroll" src="r9ri139" fileName="componentsGallery/ComScroll.xml" xy="24,483">
       <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" visible="false" 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" scrollItemToViewOnClick="false">
       <gearDisplay controller="c1" pages="2"/>
       <relation target="" sidePair="top-top,bottomext-bottom"/>

+ 1 - 1
FGUIProject/assets/poem/componentsGallery/ComPullFooter.xml

@@ -3,7 +3,7 @@
   <displayList>
     <image id="n35_r9ri" name="n35" src="r9ri12t" fileName="imagesGallery/hl_jzhjz.png" xy="1,16" pivot="0.5,0.5" group="n37_r9ri"/>
     <image id="n36_r9ri" name="n36" src="r9ri12s" fileName="imagesGallery/hl_jzhjz_1.png" xy="65,23" group="n37_r9ri"/>
-    <group id="n37_r9ri" name="n37" xy="1,16" size="159,46" advanced="true">
+    <group id="n37_r9ri" name="grpLoad" xy="1,16" size="159,46" visible="false" advanced="true">
       <relation target="" sidePair="center-center,top-top"/>
     </group>
   </displayList>

+ 1 - 1
FGUIProject/assets/poem/componentsGallery/ComPullHead.xml

@@ -3,7 +3,7 @@
   <displayList>
     <image id="n35_r9ri" name="n35" src="r9ri12t" fileName="imagesGallery/hl_jzhjz.png" xy="1,16" pivot="0.5,0.5" group="n37_r9ri"/>
     <image id="n36_r9ri" name="n36" src="r9ri12s" fileName="imagesGallery/hl_jzhjz_1.png" xy="65,23" group="n37_r9ri"/>
-    <group id="n37_r9ri" name="n37" xy="1,16" size="159,46" advanced="true">
+    <group id="n37_r9ri" name="grpLoad" xy="1,16" size="159,46" visible="false" advanced="true">
       <relation target="" sidePair="center-center,bottom-bottom"/>
     </group>
   </displayList>

+ 13 - 2
FGUIProject/assets/poem/componentsGallery/ComScroll.xml

@@ -1,7 +1,18 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1032,1136" overflow="scroll" ptrRes="ui://iyz778gkr9ri12p,ui://iyz778gkr9ri137">
   <displayList>
-    <list id="n0_r9ri" name="listRecommend" xy="10,0" size="500,1136" ptrRes="ui://iyz778gkr9ri12p,ui://iyz778gkr9ri137" lineGap="17" colGap="28" defaultItem="ui://iyz778gkr9ri10w" autoClearItems="true"/>
-    <list id="n1_r9ri" name="listRecommend1" xy="524,0" size="500,1136" ptrRes="ui://iyz778gkr9ri12p,ui://iyz778gkr9ri137" lineGap="17" colGap="28" defaultItem="ui://iyz778gkr9ri10w" autoClearItems="true"/>
+    <list id="n0_r9ri" name="listRecommend" xy="10,0" size="500,1136" group="n2_qpj3" overflow="scroll" ptrRes="ui://iyz778gkr9ri12p,ui://iyz778gkr9ri137" lineGap="17" colGap="28" defaultItem="ui://iyz778gkr9ri10w" autoClearItems="true" scrollItemToViewOnClick="false">
+      <relation target="" sidePair="height-height"/>
+    </list>
+    <list id="n1_r9ri" name="listRecommend1" xy="524,0" size="500,1136" group="n2_qpj3" overflow="scroll" ptrRes="ui://iyz778gkr9ri12p,ui://iyz778gkr9ri137" lineGap="17" colGap="28" defaultItem="ui://iyz778gkr9ri10w" autoClearItems="true" scrollItemToViewOnClick="false">
+      <relation target="" sidePair="height-height"/>
+    </list>
+    <component id="n4_qpj3" name="comHeader" src="r9ri12p" fileName="componentsGallery/ComPullHead.xml" xy="436,-79" group="n2_qpj3">
+      <relation target="" sidePair="top-top"/>
+    </component>
+    <component id="n3_qpj3" name="comFooter" src="r9ri137" fileName="componentsGallery/ComPullFooter.xml" xy="436,1139" size="160,79" group="n2_qpj3">
+      <relation target="" sidePair="bottom-bottom"/>
+    </component>
+    <group id="n2_qpj3" name="n2" xy="10,-79" size="1014,1297"/>
   </displayList>
 </component>

+ 3 - 3
FGUIProject/assets/poem/componentsGallery/ListItem.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="500,900" overflow="hidden">
-  <controller name="c1" pages="0,,1," selected="1"/>
+<component size="500,900" overflow="hidden" opaque="false">
+  <controller name="c1" pages="0,,1," selected="0"/>
   <displayList>
     <image id="n24_pac9" name="n24" src="pac9tjx" fileName="imagesGallery/hl_cjkuangdiban.png" xy="4,1" size="493,889" group="n23_pac9">
-      <relation target="" sidePair="width-width,height-height"/>
+      <relation target="" sidePair="height-height"/>
     </image>
     <loader id="n15_r9ri" name="loaIcon" xy="4,2" pivot="0.5,0" size="492,820" group="n23_pac9" url="ui://iyz778gkr9ri132" align="center" vAlign="middle" fill="scaleMatchWidth"/>
     <image id="n21_r9ri" name="n21" src="r9ri12h" fileName="imagesGallery/hl_cjkuangdi.png" xy="0,0" size="500,903" group="n23_pac9">

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

@@ -19,7 +19,6 @@ 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;
@@ -82,7 +81,6 @@ 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");
@@ -102,8 +100,6 @@ 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;

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_ComPullFooter.cs

@@ -7,6 +7,7 @@ namespace UI.Poem
     public partial class UI_ComPullFooter
     {
         public GComponent target;
+        public GGroup m_grpLoad;
         public Transition m_t0;
         public const string URL = "ui://iyz778gkr9ri137";
         public const string PACKAGE_NAME = "Poem";
@@ -55,10 +56,12 @@ namespace UI.Poem
 
         private void Init(GComponent comp)
         {
+            m_grpLoad = (GGroup)comp.GetChild("grpLoad");
             m_t0 = comp.GetTransition("t0");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_grpLoad = null;
             m_t0 = null;
             if(disposeTarget && target != null)
             {

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_ComPullHead.cs

@@ -7,6 +7,7 @@ namespace UI.Poem
     public partial class UI_ComPullHead
     {
         public GComponent target;
+        public GGroup m_grpLoad;
         public Transition m_t0;
         public const string URL = "ui://iyz778gkr9ri12p";
         public const string PACKAGE_NAME = "Poem";
@@ -55,10 +56,12 @@ namespace UI.Poem
 
         private void Init(GComponent comp)
         {
+            m_grpLoad = (GGroup)comp.GetChild("grpLoad");
             m_t0 = comp.GetTransition("t0");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_grpLoad = null;
             m_t0 = null;
             if(disposeTarget && target != null)
             {

+ 8 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_ComScroll.cs

@@ -9,6 +9,8 @@ namespace UI.Poem
         public GComponent target;
         public GList m_listRecommend;
         public GList m_listRecommend1;
+        public UI_ComPullHead m_comHeader;
+        public UI_ComPullFooter m_comFooter;
         public const string URL = "ui://iyz778gkr9ri139";
         public const string PACKAGE_NAME = "Poem";
         public const string RES_NAME = "ComScroll";
@@ -58,11 +60,17 @@ namespace UI.Poem
         {
             m_listRecommend = (GList)comp.GetChild("listRecommend");
             m_listRecommend1 = (GList)comp.GetChild("listRecommend1");
+            m_comHeader = (UI_ComPullHead)UI_ComPullHead.Create(comp.GetChild("comHeader"));
+            m_comFooter = (UI_ComPullFooter)UI_ComPullFooter.Create(comp.GetChild("comFooter"));
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_listRecommend = null;
             m_listRecommend1 = null;
+            m_comHeader.Dispose();
+            m_comHeader = null;
+            m_comFooter.Dispose();
+            m_comFooter = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 1 - 1
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_ComScroll.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 31828a34c2f6fb14ca20dfedb947290d
+guid: e13d291b47f0f2d40a08da3296aa3983
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 138 - 77
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemGalleryView.cs

@@ -54,7 +54,11 @@ namespace GFGGame
         private UI_PoemGalleryUI _ui;
         private GList _list;
         private GList _list1;
-        private GComponent _comScroll;
+        private GList _scrollList;
+
+        private UI_ComScroll _comScroll;
+        private ScrollPane _curScrollPane;
+        private GComponent _curFooter;
         // private List<PoemGalleryData> _galleryDatas = new List<PoemGalleryData>();
         private List<long> _galleryDatas = new List<long>();
         private int _sortType = 0;//由GallerySortType定义
@@ -95,15 +99,37 @@ namespace GFGGame
             _ui.m_btnJoin.onClick.Add(OnBtnJoinClick);
             _ui.m_btnFavorites.onClick.Add(OnBtnFavoritesClick);
 
-            _ui.m_comNormal.m_comScroll.target.scrollPane.onPullDownRelease.Add(onPullDownRelease);
-            _ui.m_comNormal.m_comScroll.target.scrollPane.onPullUpRelease.Add(OnPullUpToRefresh);
-            _ui.m_comFavorites.m_comScroll.target.scrollPane.onPullDownRelease.Add(onPullDownRelease);
-            _ui.m_comFavorites.m_comScroll.target.scrollPane.onPullUpRelease.Add(OnPullUpToRefresh);
 
+            _ui.m_comNormal.m_comScroll.m_listRecommend.scrollPane.onPullDownRelease.Add(SetPullDownParent0);
+            _ui.m_comNormal.m_comScroll.m_listRecommend1.scrollPane.onPullDownRelease.Add(SetPullDownParent1);
+            _ui.m_comNormal.m_comScroll.m_listRecommend.scrollPane.onPullUpRelease.Add(OnPullUpToRefresh);
+            _ui.m_comNormal.m_comScroll.m_listRecommend1.scrollPane.onPullUpRelease.Add(OnPullUpToRefresh);
+            _ui.m_comNormal.m_comScroll.m_listRecommend.scrollPane.onScroll.Add(SetScrollCom0);
+            _ui.m_comNormal.m_comScroll.m_listRecommend1.scrollPane.onScroll.Add(SetScrollCom1);
+
+            _ui.m_comNormal.m_comScroll.m_listRecommend.SetVirtual();
+            _ui.m_comNormal.m_comScroll.m_listRecommend1.SetVirtual();
             _ui.m_comNormal.m_comScroll.m_listRecommend.itemRenderer = RenderListItem;
             _ui.m_comNormal.m_comScroll.m_listRecommend1.itemRenderer = RenderListItem1;
+            _ui.m_comNormal.m_comScroll.m_listRecommend.scrollPane.twinsScrollPane = _ui.m_comNormal.m_comScroll.m_listRecommend1.scrollPane;
+            _ui.m_comNormal.m_comScroll.m_listRecommend1.scrollPane.twinsScrollPane = _ui.m_comNormal.m_comScroll.m_listRecommend.scrollPane;
+
+
+            _ui.m_comFavorites.m_comScroll.m_listRecommend.scrollPane.onPullDownRelease.Add(OnPullDownRelease);
+            _ui.m_comFavorites.m_comScroll.m_listRecommend1.scrollPane.onPullDownRelease.Add(OnPullDownRelease);
+            _ui.m_comFavorites.m_comScroll.m_listRecommend.scrollPane.onPullUpRelease.Add(OnPullUpToRefresh);
+            _ui.m_comFavorites.m_comScroll.m_listRecommend1.scrollPane.onPullUpRelease.Add(OnPullUpToRefresh);
+            _ui.m_comFavorites.m_comScroll.m_listRecommend.scrollPane.onScroll.Add(SetScrollCom2);
+            _ui.m_comFavorites.m_comScroll.m_listRecommend1.scrollPane.onScroll.Add(SetScrollCom3);
+
+            _ui.m_comFavorites.m_comScroll.m_listRecommend.SetVirtual();
+            _ui.m_comFavorites.m_comScroll.m_listRecommend1.SetVirtual();
             _ui.m_comFavorites.m_comScroll.m_listRecommend.itemRenderer = RenderListItem;
             _ui.m_comFavorites.m_comScroll.m_listRecommend1.itemRenderer = RenderListItem1;
+            _ui.m_comFavorites.m_comScroll.m_listRecommend.scrollPane.twinsScrollPane = _ui.m_comFavorites.m_comScroll.m_listRecommend1.scrollPane;
+            _ui.m_comFavorites.m_comScroll.m_listRecommend1.scrollPane.twinsScrollPane = _ui.m_comFavorites.m_comScroll.m_listRecommend.scrollPane;
+
+
 
             _ui.m_comNormal.m_listRank.itemRenderer = RenderListRankItem;
             // _ui.m_comNormal.m_listRank.SetVirtual();
@@ -155,7 +181,7 @@ namespace GFGGame
                 _ui.m_comNormal.m_comBoBox.selectedIndex = 0;
                 _ui.m_comNormal.m_c1.selectedIndex = _subtabIndex;
                 _ui.m_comFavorites.m_c1.selectedIndex = _subtabIndex;
-                _comScroll = _ui.m_comNormal.m_comScroll.target;
+                // _comScroll = _ui.m_comNormal.m_comScroll.target;
 
 
                 if (_ui.m_comNormal.m_comScroll.m_listRecommend.numItems > 0) _ui.m_comNormal.m_comScroll.m_listRecommend.ScrollToView(0);
@@ -169,16 +195,23 @@ namespace GFGGame
                 _ui.m_comFavorites.m_comScroll.m_listRecommend.numItems = 0;
                 _ui.m_comFavorites.m_comScroll.m_listRecommend1.numItems = 0;
 
-                // OnFavoritesTabChange();
-                // OnNormalTabChange();
-                // _ui.m_comNormal.m_comOpenLoad.target.visible = true;
+                _scrollList = _ui.m_comNormal.m_comScroll.m_listRecommend;
+
                 ViewManager.Show<ModalStatusView>();
                 UpdateList();
                 PullDown();
-                onPullDownRelease();
+                OnPullDownRelease();
             }
 
             _ui.m_c1.selectedIndex = _tabIndex;
+            // _ui.m_comNormal.m_comScroll.m_comHeader.target.y = -_ui.m_comNormal.m_comScroll.m_comHeader.target.height;
+            // _ui.m_comNormal.m_comScroll.m_comFooter.target.y = _ui.m_comNormal.m_comScroll.target.height;
+            // _ui.m_comFavorites.m_comScroll.m_comHeader.target.y = -_ui.m_comFavorites.m_comScroll.m_comHeader.target.height;
+            // _ui.m_comFavorites.m_comScroll.m_comFooter.target.y = _ui.m_comFavorites.m_comScroll.target.height;
+            _ui.m_comNormal.m_comScroll.m_comHeader.m_grpLoad.visible = true;
+            _ui.m_comNormal.m_comScroll.m_comFooter.m_grpLoad.visible = true;
+            _ui.m_comFavorites.m_comScroll.m_comHeader.target.visible = false;
+            _ui.m_comFavorites.m_comScroll.m_comFooter.m_grpLoad.visible = true;
 
             UpdateView();
             if (PoemGalleryDataManager.Instance.HasBonus)
@@ -245,7 +278,7 @@ namespace GFGGame
                 if (_ui.m_comNormal.m_c1.selectedIndex == RecommendType.RECOMMEND)//重新拉取数据
                 {
                     PullDown();
-                    onPullDownRelease();
+                    OnPullDownRelease();
                 }
                 else//切页签并重新拉取数据
                 {
@@ -289,7 +322,7 @@ namespace GFGGame
         private void OnNormalTabChange()
         {
             ResetPullRelease();
-            _ui.m_comNormal.m_comScroll.target.scrollPane.header.visible = false;
+            // _ui.m_comNormal.m_comScroll.target.scrollPane.header.visible = false;
             _subtabIndex = _ui.m_comNormal.m_c1.selectedIndex;
             if (_ui.m_comNormal.m_c1.selectedIndex == RecommendType.RANK)//排行榜
             {
@@ -301,21 +334,36 @@ namespace GFGGame
             {
                 UpdateList();
 
-                if (_list.numItems > 0) _list.ScrollToView(0);
-                if (_list1.numItems > 0) _list.ScrollToView(0);
                 _list.numItems = 0;
                 _list1.numItems = 0;
+                if (_list.numItems > 0) _list.ScrollToView(0);
+                if (_list1.numItems > 0) _list.ScrollToView(0);
                 ReqGalleryList(0);
             }
 
         }
+
+        /// <summary>
+        /// 切换收藏页签
+        /// </summary>
+        private void OnFavoritesTabChange()
+        {
+            _subtabIndex = _ui.m_comFavorites.m_c1.selectedIndex;
+            UpdateList();
+            _list.numItems = 0;
+            _list1.numItems = 0;
+            ReqGalleryList(0);
+
+        }
+
         private void UpdateList()
         {
             if (_tabIndex == TabType.RECOVER)
             {
+                _ui.m_comNormal.m_comScroll.m_comHeader.target.visible = true;
                 if (_subtabIndex == RecommendType.RECOMMEND)//首页
                 {
-                    _ui.m_comNormal.m_comScroll.target.scrollPane.header.visible = true;
+                    // _ui.m_comNormal.m_comScroll.target.scrollPane.header.visible = true;
                     if (_ui.m_comNormal.m_comBoBox.selectedIndex == 0)//推荐
                     {
                         _sortType = (int)GallerySortType.Recommend;
@@ -331,6 +379,7 @@ namespace GFGGame
                 {
                     _sortType = (int)GallerySortType.Friend;
                     _galleryDatas = PoemGalleryDataManager.Instance.FrinedDatas;
+                    _ui.m_comNormal.m_comScroll.m_comHeader.target.visible = false;
                 }
                 else if (_subtabIndex == RecommendType.RANK)
                 {
@@ -338,7 +387,8 @@ namespace GFGGame
                 }
                 _list = _ui.m_comNormal.m_comScroll.m_listRecommend;
                 _list1 = _ui.m_comNormal.m_comScroll.m_listRecommend1;
-                _comScroll = _ui.m_comNormal.m_comScroll.target;
+                _comScroll = _ui.m_comNormal.m_comScroll;
+                // _curScrollPane = _ui.m_comNormal.m_comScroll.m_listRecommend.scrollPane;
             }
             else if (_tabIndex == TabType.FAVORITES)
             {
@@ -354,38 +404,14 @@ namespace GFGGame
                 }
                 _list = _ui.m_comFavorites.m_comScroll.m_listRecommend;
                 _list1 = _ui.m_comFavorites.m_comScroll.m_listRecommend1;
-                _comScroll = _ui.m_comFavorites.m_comScroll.target;
+                _comScroll = _ui.m_comFavorites.m_comScroll;
+                // _curScrollPane = _ui.m_comFavorites.m_comScroll.m_listRecommend.scrollPane;
             }
 
         }
-        /// <summary>
-        /// 切换收藏页签
-        /// </summary>
-        private void OnFavoritesTabChange()
-        {
-            _ui.m_comFavorites.m_comScroll.target.scrollPane.header.visible = false;
-            _subtabIndex = _ui.m_comFavorites.m_c1.selectedIndex;
-            UpdateList();
-            if (_list.numItems > 0) _list.ScrollToView(0);
-            if (_list1.numItems > 0) _list.ScrollToView(0);
-            ReqGalleryList(0);
-
-        }
 
         /********************************************************请求更新列表*************************************************/
 
-        private void onScrollEnd()
-        {
-            GComponent header = _comScroll.scrollPane.header;
-            if (!header.visible || header.height >= header.sourceHeight || isPullDown) return;
-
-            if (_comScroll.scrollPane.percY == 1)
-            {
-                ReqGalleryList(_galleryDatas.Count);
-                // PullUp();
-                // OnPullUpToRefresh();
-            }
-        }
         //请求刷新
         private async void ReqGalleryList(int startIndex)
         {
@@ -421,8 +447,6 @@ namespace GFGGame
                     _list.numItems = (_galleryDatas.Count + 1) / 2;
                     _list1.numItems = (_galleryDatas.Count - 1) / 2;
                 }
-                _list.ResizeToFit();
-                _list1.ResizeToFit();
             }
 
             UpdateView();
@@ -456,7 +480,7 @@ namespace GFGGame
         {
             bool isResulting = PoemGalleryDataManager.Instance.IsResulting();
             _ui.m_comNormal.m_grpResult.visible = isResulting;
-            _ui.m_comNormal.m_comScroll.target.visible = !isResulting;
+            // _ui.m_comNormal.m_comScroll.target.visible = !isResulting;
             _ui.m_comNormal.m_listRank.visible = !isResulting;
 
             GalleryThemeCfg themeCfg = GalleryThemeCfgArray.Instance.GetCfg((int)PoemGalleryDataManager.Instance.ThemeId);
@@ -640,18 +664,62 @@ namespace GFGGame
         private void PullDown()
         {
             if (_list.numItems > 0) _list.ScrollToView(0);
-            GComponent header = _comScroll.scrollPane.header;
-            header.height = header.sourceHeight;
+            _curScrollPane = _list.scrollPane;
+            _curScrollPane.header.height = _curScrollPane.header.sourceHeight;
+        }
+
+        private void SetScrollCom0()
+        {
+            _scrollList = _ui.m_comNormal.m_comScroll.m_listRecommend;
+            UpdateHeaderPos(_ui.m_comNormal.m_comScroll.m_comHeader.target, _ui.m_comNormal.m_comScroll.m_comFooter.target, _ui.m_comNormal.m_comScroll.m_listRecommend);
+        }
+        private void SetScrollCom1()
+        {
+            _scrollList = _ui.m_comNormal.m_comScroll.m_listRecommend1;
+            UpdateHeaderPos(_ui.m_comNormal.m_comScroll.m_comHeader.target, _ui.m_comNormal.m_comScroll.m_comFooter.target, _ui.m_comNormal.m_comScroll.m_listRecommend1);
         }
+        private void SetScrollCom2()
+        {
+            _scrollList = _ui.m_comFavorites.m_comScroll.m_listRecommend;
+            UpdateHeaderPos(null, _ui.m_comFavorites.m_comScroll.m_comFooter.target, _ui.m_comFavorites.m_comScroll.m_listRecommend);
+        }
+        private void SetScrollCom3()
+        {
+            _scrollList = _ui.m_comFavorites.m_comScroll.m_listRecommend1;
+            UpdateHeaderPos(null, _ui.m_comFavorites.m_comScroll.m_comFooter.target, _ui.m_comFavorites.m_comScroll.m_listRecommend1);
+        }
+        private void UpdateHeaderPos(GComponent header, GComponent footer, GList list)
+        {
+            if (header != null && list.scrollPane.container.y > 0)
+            {
+                header.height = list.scrollPane.header.height;
+            }
+            else if (footer != null && list.scrollPane.container.y < -list.scrollPane.posY)
+            {
+                footer.height = list.scrollPane.footer.height;
+            }
 
+        }
+
+
+
+        private void SetPullDownParent0()
+        {
+            _curScrollPane = _ui.m_comNormal.m_comScroll.m_listRecommend.scrollPane;
+            OnPullDownRelease();
+        }
+        private void SetPullDownParent1()
+        {
+            _curScrollPane = _ui.m_comNormal.m_comScroll.m_listRecommend1.scrollPane;
+            OnPullDownRelease();
+        }
         //下拉刷新
-        private async void onPullDownRelease()
+        private async void OnPullDownRelease()
         {
-            GComponent header = _comScroll.scrollPane.header;
-            if (!header.visible || header.height < header.sourceHeight || isPullDown) return;
+            if (!_comScroll.m_comHeader.target.visible || _scrollList.scrollPane.header.height < _scrollList.scrollPane.header.sourceHeight || isPullDown) return;
 
             isPullDown = true;
-            _comScroll.scrollPane.LockHeader(header.sourceHeight);
+            _scrollList.scrollPane.LockHeader(_scrollList.scrollPane.header.sourceHeight);
 
             bool result = await PoemGallerySProxy.ReqGalleryList(_sortType, 0, PoemGalleryDataManager.pageCount);
             // OnPullDownTimeComplete();
@@ -663,38 +731,29 @@ namespace GFGGame
         }
         private void OnPullDownTimeComplete()
         {
-            if (_comScroll == null) return;
-            GComponent header = _comScroll.scrollPane.header;
+            if (_scrollList == null) return;
+            GComponent header = _scrollList.scrollPane.header;
             Transition transition = header.GetTransition("t0");
             transition.Stop();
-            header.height = 1;
-            _comScroll.scrollPane.LockHeader(0);
+            _scrollList.scrollPane.LockHeader(0);
             isPullDown = false;
-        }
-        //自动上拉
-        private void PullUp()
-        {
-            GComponent header = _comScroll.scrollPane.footer;
-            header.height = header.sourceHeight;
+
         }
 
         //上拉刷新
         private async void OnPullUpToRefresh()
         {
-            GComponent header = _comScroll.scrollPane.header;
-            if (!header.visible || header.height >= header.sourceHeight || isPullDown) return;
+            GComponent header = _scrollList.scrollPane.header;
+            if (!header.visible || header.height > header.sourceHeight || isPullDown) return;
 
-            GComponent footer = _comScroll.scrollPane.footer;
-            if (footer.height < footer.sourceHeight || isPullUp) return;
-            // _lastListCount = _list.numItems;
-            // _lastList1Count = _list1.numItems;
-            _lastGalleryDatasCount = _galleryDatas.Count;
+            GComponent footer = _scrollList.scrollPane.footer;
+            if (footer.height <= footer.sourceHeight || isPullUp) return;
 
+            _lastGalleryDatasCount = _galleryDatas.Count;
             isPullUp = true;
-            _comScroll.scrollPane.LockFooter(footer.sourceHeight + 10);
+            _scrollList.scrollPane.LockFooter(footer.sourceHeight + 10);
 
             bool result = await PoemGallerySProxy.ReqGalleryList(_sortType, _galleryDatas.Count, PoemGalleryDataManager.pageCount);
-            // OnPullUpTimeComplete();
             if (result)
             {
                 Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, _lastGalleryDatasCount, UpdateGalleryList));
@@ -704,23 +763,25 @@ namespace GFGGame
 
         private void OnPullUpTimeComplete()
         {
-            if (_comScroll == null) return;
-            GComponent footer = _comScroll.scrollPane.footer;
+
+            if (_scrollList == null) return;
+
+            GComponent footer = _scrollList.scrollPane.footer;
             Transition transition = footer.GetTransition("t0");
             transition.Stop();
-            // header.GetController("c1").selectedIndex = 2;
-            _comScroll.scrollPane.LockFooter(0);
+            _scrollList.scrollPane.LockFooter(0);
             isPullUp = false;
+
+
+            _ui.m_comNormal.m_comScroll.m_comFooter.target.height = footer.initHeight;
+            _ui.m_comFavorites.m_comScroll.m_comFooter.target.height = footer.initHeight;
         }
 
         //重置上拉/下拉刷新状态
         private void ResetPullRelease()
         {
-            // Timers.inst.Remove(OnPullDownTimeComplete);
             OnPullDownTimeComplete();
-            // Timers.inst.Remove(OnPullUpTimeComplete);
             OnPullUpTimeComplete();
-            // _ui.m_comNormal.m_comOpenLoad.target.visible = false;
             ViewManager.Hide<ModalStatusView>();
         }
     }

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


+ 57 - 0
GameClient/Assets/ThirdParty/FairyGUI/Scripts/UI/ScrollPane.cs

@@ -72,6 +72,8 @@ namespace FairyGUI
         GComponent _owner;
         Container _maskContainer;
         Container _container;
+        public Container container { get { return _container; } }
+
         GScrollBar _hzScrollBar;
         GScrollBar _vtScrollBar;
         GComponent _header;
@@ -430,6 +432,23 @@ namespace FairyGUI
             set { _decelerationRate = value; }
         }
 
+
+        private ScrollPane _twinsScrollPane;
+        public ScrollPane twinsScrollPane
+        {
+            get
+            {
+                return _twinsScrollPane;
+            }
+            set
+            {
+                _twinsScrollPane = value;
+                float height = Math.Max(_container.height, _twinsScrollPane._container.height);
+                _container.height = height;
+                _twinsScrollPane._container.height = height;
+            }
+        }
+
         /// <summary>
         /// </summary>
         public bool isDragged
@@ -1569,6 +1588,11 @@ namespace FairyGUI
             if (_overlapSize.y > 0)
                 _yPos = Mathf.Clamp(-_container.y, 0, _overlapSize.y);
 
+            if (_twinsScrollPane != null)
+            {
+                UpdateTwinsScrollMove();
+            }
+
             //循环滚动特别检查
             if (_loop != 0)
             {
@@ -1692,6 +1716,23 @@ namespace FairyGUI
             StartTween(2);
         }
 
+        private void UpdateTwinsScrollMove()
+        {
+
+            float overlapSizeY = Math.Max(_overlapSize.y, _twinsScrollPane._overlapSize.y);
+            _overlapSize.y = overlapSizeY;
+            _twinsScrollPane._overlapSize.y = overlapSizeY;
+
+            if (_container.y > 0 || _container.y < -_yPos)
+            {
+                _twinsScrollPane._container.y = _container.y;
+            }
+            else
+            {
+                _twinsScrollPane.SetPercY(this.percY, false);
+            }
+        }
+
         private void __mouseWheel(EventContext context)
         {
             if (!_mouseWheelEnabled)
@@ -2146,17 +2187,29 @@ namespace FairyGUI
                 if (pos < -max || max == 0 && _footerLockedSize > 0)
                 {
                     if (_footer.displayObject.parent == null)
+                    {
                         _maskContainer.AddChildAt(_footer.displayObject, 0);
 
+                    }
+
+
                     Vector2 vec;
 
                     vec = _footer.xy;
+
                     if (max > 0)
                         vec[_refreshBarAxis] = pos + _contentSize[_refreshBarAxis];
                     else
                         vec[_refreshBarAxis] = Mathf.Max(Mathf.Min(pos + _viewSize[_refreshBarAxis], _viewSize[_refreshBarAxis] - _footerLockedSize), _viewSize[_refreshBarAxis] - _contentSize[_refreshBarAxis]);
                     _footer.xy = vec;
 
+                    if (_twinsScrollPane != null)
+                    {
+                        float distance = this.viewHeight - _footer.xy[_refreshBarAxis];
+                        vec[_refreshBarAxis] = _footer.xy[_refreshBarAxis] + distance - _footer.size[_refreshBarAxis];
+                        _footer.xy = vec;
+                    }
+
                     vec = _footer.size;
                     if (max > 0)
                         vec[_refreshBarAxis] = -max - pos;
@@ -2214,6 +2267,10 @@ namespace FairyGUI
                 UpdateScrollBarPos();
                 _onScroll.Call();
             }
+            if (_twinsScrollPane != null)
+            {
+                UpdateTwinsScrollMove();
+            }
         }
 
         float RunTween(int axis)