|
@@ -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;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|