This commit is contained in:
2020-08-01 17:55:18 +08:00
parent 29a8a1dae3
commit 4435098171
160 changed files with 21247 additions and 2405 deletions

View File

@@ -70,8 +70,9 @@ namespace Coolape
}
if (panel != null) {
oldClipOffset = panel.clipOffset;
panel.cullWhileDragging = true;
panel.onClipMove = OnMove;
}
panel.cullWhileDragging = true;
}
}
return _scrollView;
@@ -445,6 +446,10 @@ namespace Coolape
isCanCallOnEndList = true;
isCanCallOnHeadList = true;
if(list.Count == 0)
{
ExecuteOnShowHeadList();
}
} catch (System.Exception e) {
Debug.LogError (e);
}
@@ -575,6 +580,27 @@ namespace Coolape
}
}
}
protected virtual void OnMove(UIPanel panel)
{
if (scrollView == null) return;
bool restrictWithinPanel = false;
if (list == null || list.Count == 0)
{
restrictWithinPanel = true;
}
if (!restrictWithinPanel && firstVislable && int.Parse(head.name) == 0)
{
restrictWithinPanel = true;
}
if (!restrictWithinPanel && lastVisiable && int.Parse(tail.name) == list.Count - 1)
{
restrictWithinPanel = true;
}
scrollView.restrictWithinPanel = restrictWithinPanel;
}
// 从原顺序位置移动到指定位置
void moveCellPos (UIWidget moved, UIWidget target, int newIdx, int targetIdx)
{