public virtual void SetAdapter(IAdapter adapter) { _adapter = adapter; TotalItemCount = _adapter.GetCount(); ItemPrefab = _adapter.GetItemPrototype(); ItemSize = _adapter.GetItemSize(); CalculateContentSize(); CalculateVisibleItemCount(); ClearAllItems(); RepositionItems(); }
public void SetAdapter(IAdapter adapter) { _adapter = adapter; TotalPageCount = adapter.GetCount(); ItemPrefab = adapter.GetItemPrototype(); _curPageIndex = 0; NormalizedPosition = PageIndexToNormalizedPosition(_curPageIndex); CalculateContentSize(); CalculateVisibleItemCount(); StopScroll(); ClearAllItems(); RepositionItems(); }