|
@@ -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;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//积分商店
|