zhaoyang 2 年之前
父節點
當前提交
ff00c2e4ba

+ 6 - 3
FGUIProject/assets/poem/componentsGallery/ComHead.xml

@@ -2,14 +2,17 @@
 <component size="200,113">
   <controller name="c1" pages="0,,1,,2," selected="0"/>
   <displayList>
-    <movieclip id="n30_r9ri" name="n30" src="r9ri119" fileName="componentsGallery/MovieClip1.jta" xy="0,0">
+    <movieclip id="n30_r9ri" name="n30" src="r9ri119" fileName="componentsGallery/MovieClip1.jta" xy="0,0" group="n34_r9ri">
       <gearDisplay controller="c1" pages="1"/>
     </movieclip>
-    <image id="n32_r9ri" name="n32" src="ly9g1d" fileName="imagesExport/cj_xhua.png" pkg="eg2y0ldp" xy="51,-9" pivot="0.5,0.5" rotation="90">
+    <image id="n32_r9ri" name="n32" src="ly9g1d" fileName="imagesExport/cj_xhua.png" pkg="eg2y0ldp" xy="51,-9" pivot="0.5,0.5" group="n34_r9ri" rotation="90">
       <gearDisplay controller="c1" pages="0"/>
     </image>
-    <image id="n33_r9ri" name="n33" src="ly9g1d" fileName="imagesExport/cj_xhua.png" pkg="eg2y0ldp" xy="51,-9" pivot="0.5,0.5" rotation="-90">
+    <image id="n33_r9ri" name="n33" src="ly9g1d" fileName="imagesExport/cj_xhua.png" pkg="eg2y0ldp" xy="51,-9" pivot="0.5,0.5" group="n34_r9ri" rotation="-90">
       <gearDisplay controller="c1" pages="2"/>
     </image>
+    <group id="n34_r9ri" name="n34" xy="0,-9" size="200,132" advanced="true">
+      <relation target="" sidePair="center-center,bottom-bottom"/>
+    </group>
   </displayList>
 </component>

+ 13 - 45
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemGalleryView.cs

@@ -45,11 +45,7 @@ namespace GFGGame
             _ui.m_comNormal.m_listRecommend.itemRenderer = RenderListItem;
             _ui.m_comNormal.m_listRecommend.SetVirtual();
             _ui.m_comNormal.m_listRecommend.scrollPane.onPullDownRelease.Add(onPullDownRelease);
-            _ui.m_comNormal.m_listRecommend.scrollPane.onScroll.Add(onScroll);
-            _ui.m_comNormal.m_listRecommend.scrollPane.onScrollEnd.Add(OnScrollEnd);
-            // SwipeGesture swipeGesture;
-            // swipeGesture = new SwipeGesture(_ui.m_comNormal.m_listRecommend);
-            // swipeGesture.onMove.Add(OnMove);
+            _ui.m_comNormal.m_listRecommend.scrollPane.header.onSizeChanged.Add(OnSizeChanged);
 
         }
         protected override void AddEventListener()
@@ -136,53 +132,25 @@ namespace GFGGame
         }
         private void onPullDownRelease()
         {
-            UI_ComHead header = UI_ComHead.Proxy(_ui.m_comNormal.m_listRecommend.scrollPane.header);
-            // ScrollPaneHeader header = (ScrollPaneHeader)_ui.m_comNormal.m_listRecommend.scrollPane.header;
-            // if (header.ReadyToRefresh)
-            // {
-            // header.SetRefreshStatus(2);
-            header.m_c1.selectedIndex = 1;
-            _ui.m_comNormal.m_listRecommend.scrollPane.LockHeader(header.target.sourceHeight);
-
-            //Simulate a async resquest
+            GComponent header = _ui.m_comNormal.m_listRecommend.scrollPane.header;
+            Controller controller = header.GetController("c1");
+            controller.selectedIndex = 1;
+            _ui.m_comNormal.m_listRecommend.scrollPane.LockHeader(header.sourceHeight);
             Timers.inst.Add(2, 1, (object param) =>
             {
-                header.m_c1.selectedIndex = 2;
-                //     _ui.m_comNormal.m_listRecommend.numItems += 5;
-
-                //     //Refresh completed
-                //     header.SetRefreshStatus(3);
-                //     _ui.m_comNormal.m_listRecommend.scrollPane.LockHeader(35);
-
-                // Timers.inst.Add(2, 1, (object param2) =>
-                // {
-                //         header.SetRefreshStatus(0);
+                controller.selectedIndex = 2;
                 _ui.m_comNormal.m_listRecommend.scrollPane.LockHeader(0);
-                header.m_c1.selectedIndex = 0;
-                // });
             });
-            // }
-
-        }
-        private void OnMove(EventContext context)
-        {
-            SwipeGesture swipeture = (SwipeGesture)context.sender;
-            ScrollPane scrollPane = _ui.m_comNormal.m_listRecommend.scrollPane;
-            ET.Log.Debug("posY:" + scrollPane.header.position.y + "    swipetureY:" + swipeture.position.y + "    " + (-scrollPane.header.height + swipeture.position.y));
-            scrollPane.header.SetXY(scrollPane.header.position.x, -scrollPane.header.height + swipeture.position.y);
         }
-        private void onScroll()
+        private void OnSizeChanged()
         {
-            ScrollPane scrollPane = _ui.m_comNormal.m_listRecommend.scrollPane;
-            // scrollPane.
+            GComponent header = _ui.m_comNormal.m_listRecommend.scrollPane.header;
+            Controller controller = _ui.m_comNormal.m_listRecommend.scrollPane.header.GetController("c1");
 
-            // ET.Log.Debug("posY:" + scrollPane.posY + "    scrollingPosY:" + scrollPane.scrollingPosY);
-        }
-        private void OnScrollEnd()
-        {
-            // ScrollPane scrollPane = _ui.m_comNormal.m_listRecommend.scrollPane;
-            // scrollPane.header.SetXY();
-            // _ui.m_comNormal.m_listRecommend.scrollPane.header.y = -_ui.m_comNormal.m_listRecommend.scrollPane.header.height;
+            if (header.height <= 1)
+            {
+                controller.selectedIndex = 0;
+            }
         }
 
         //积分商店

二進制
GameClient/Assets/ResIn/UI/Poem/Poem_fui.bytes