|
@@ -69,6 +69,7 @@ namespace GFGGame
|
|
|
|
|
|
private bool isPullDown = false;//是否下拉刷新中,刷新中再次下拉不会重新请求更新数据
|
|
|
private bool isPullUp = false;//是否上拉刷新中,刷新中再次下拉不会重新请求更新数据
|
|
|
+ private int LimitNum = 30;
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
if (_ui != null)
|
|
@@ -200,6 +201,7 @@ namespace GFGGame
|
|
|
UpdateList();
|
|
|
PullDown();
|
|
|
OnPullDownRelease();
|
|
|
+ ViewManager.Hide<ModalStatusView>();
|
|
|
}
|
|
|
|
|
|
_ui.m_c1.selectedIndex = _tabIndex;
|
|
@@ -234,6 +236,7 @@ namespace GFGGame
|
|
|
base.OnHide();
|
|
|
ResetPullRelease();
|
|
|
_ui.m_comNormal.m_comBoBox.selectedIndex = 0;
|
|
|
+ PoemGalleryDataManager.Instance.index = 10;
|
|
|
Timers.inst.Remove(CheckGuide);
|
|
|
}
|
|
|
|
|
@@ -432,7 +435,7 @@ namespace GFGGame
|
|
|
bool result = await PoemGallerySProxy.ReqGalleryList(_sortType, startIndex, PoemGalleryDataManager.pageCount);
|
|
|
if (result)
|
|
|
{
|
|
|
- Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, startIndex, UpdateGalleryList));
|
|
|
+ Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, startIndex, UpdateGallery));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -462,9 +465,21 @@ namespace GFGGame
|
|
|
_list1.numItems = Mathf.Max(0, (_galleryDatas.Count - 1) / 2);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ }
|
|
|
+ private void UpdateGallery()
|
|
|
+ {
|
|
|
UpdateView();
|
|
|
ResetPullRelease();
|
|
|
+ UpdateGalleryList();
|
|
|
+ if (_galleryDatas.Count > LimitNum && PoemGalleryDataManager.Instance.GalleryIDList.Count > LimitNum)
|
|
|
+ {
|
|
|
+ PoemGalleryDataManager.Instance.SetGalleryData();
|
|
|
+ int indexList = LimitNum / 6 * 2;
|
|
|
+ _galleryDatas.RemoveRange(0, PoemGalleryDataManager.pageCount);
|
|
|
+ UpdateGalleryList();
|
|
|
+ _list.ScrollToView(indexList);
|
|
|
+ _list1.ScrollToView(indexList);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//请求排行榜刷新
|
|
@@ -761,13 +776,15 @@ namespace GFGGame
|
|
|
|
|
|
isPullDown = true;
|
|
|
_scrollList.scrollPane.LockHeader(_scrollList.scrollPane.header.sourceHeight);
|
|
|
-
|
|
|
+ PoemGalleryDataManager.Instance.RemoveGalleryData();
|
|
|
+ PoemGalleryDataManager.Instance.GalleryIDList.Clear();
|
|
|
bool result = await PoemGallerySProxy.ReqGalleryList(_sortType, 0, PoemGalleryDataManager.pageCount);
|
|
|
// OnPullDownTimeComplete();
|
|
|
if (result && isShowing)
|
|
|
{
|
|
|
+ PoemGalleryDataManager.Instance.index = 10;
|
|
|
PoemGalleryDataManager.Instance.waitRelease = true;
|
|
|
- Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, 0, UpdateGalleryList));
|
|
|
+ Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, 0, UpdateGallery));
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -799,11 +816,12 @@ namespace GFGGame
|
|
|
isPullUp = true;
|
|
|
_scrollList.scrollPane.LockFooter(footer.sourceHeight + 10);
|
|
|
|
|
|
- bool result = await PoemGallerySProxy.ReqGalleryList(_sortType, _galleryDatas.Count, PoemGalleryDataManager.pageCount);
|
|
|
+ bool result = await PoemGallerySProxy.ReqGalleryList(_sortType, PoemGalleryDataManager.Instance.index, PoemGalleryDataManager.pageCount);
|
|
|
if (result && isShowing)
|
|
|
{
|
|
|
+ PoemGalleryDataManager.Instance.index += PoemGalleryDataManager.pageCount;
|
|
|
PoemGalleryDataManager.Instance.waitRelease = true;
|
|
|
- Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, _lastGalleryDatasCount, UpdateGalleryList));
|
|
|
+ Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, _lastGalleryDatasCount, UpdateGallery));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -829,7 +847,6 @@ namespace GFGGame
|
|
|
{
|
|
|
OnPullDownTimeComplete();
|
|
|
OnPullUpTimeComplete();
|
|
|
- ViewManager.Hide<ModalStatusView>();
|
|
|
}
|
|
|
|
|
|
private void CheckGuide(object param)
|